[RS]Study into sequential probabilitys V0

just some experimentation to check results, putting it out there. :P
odds of the next bar being up or down bar.
Remove from Favorite Scripts Add to Favorite Scripts
study(title='[RS]Study into sequential probabilitys V0')
up_bar = close > open
down_bar = close < open

up_sequence = max(0, barssince(up_bar == 0) - 1)
down_sequence = max(0, barssince(down_bar == 0) - 1)

up_bars = cum(up_bar)
down_bars = cum(down_bar)

up_odds = (up_bars/n)*100
down_odds = (down_bars/n)*100

forecast_up_odds = ((up_bars/n) * pow((up_bars/n), up_sequence))*100
forecast_down_odds = ((down_bars/n) * pow((down_bars/n), down_sequence))*100

plot(forecast_up_odds, color=green)
plot(forecast_down_odds, color=maroon)


Hello, this is an interesting idea, I am playing with the script and noticed that : up_odds = (up_bars/n)*100
down_odds = (down_bars/n)*100
are currently not used I think these should be substitued in the line
forecast_up_odds = ((up_bars/n) * pow((up_bars/n), up_sequence))*100
which could then read
forecast_up_odds = (up_odds * pow((up_bars/n), up_sequence))

This is just for clarity it works even without this.
yes that is correct, thx.
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out