RicardoSantos

[RS]Study into sequential probabilitys V0

EXPERIMENTAL:
just some experimentation to check results, putting it out there. :P
odds of the next bar being up or down bar.
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
//@version=2
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)