[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)

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)
Looks great. Thanks for sharing mate
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out