RicardoSantos

[RS]Leading Momentum Oscilator V0

EXPERIMENTAL: Momentum oscilator based on offset, can also be used for divergence/convergence
Remove from Favorite Scripts Add to Favorite Scripts
study("[RS]Leading Momentum Oscilator V0")
ma_length = input(title='ma length', type=integer, defval=5)
signal_length = input(title='signal length', type=integer, defval=21)
offset = input(title='offset', type=integer, defval=8)

leading_cd(_src, ma_l, signal_l, offset_l)=>
    _ma = sma(_src, ma_l)
    _signal = sma(_src, signal_l)
    _hist = _ma-offset(_signal, offset_l)
    _hist

o = leading_cd(open, ma_length, signal_length, offset)
h = leading_cd(high, ma_length, signal_length, offset)
l = leading_cd(low, ma_length, signal_length, offset)
c = leading_cd(close, ma_length, signal_length, offset)

plotcandle(o, h, l, c, color=c>o?green:c<o?maroon:gray)
hline(0)
Looks great. Thanks for sharing mate
Reply
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out