Attachments forums

List of attachments posted on this forum.


All files on forums: 163276

Re: Absolute Momentum - Coding Help

global, Tue Feb 23, 2021 11:43 pm

Hi All,

After reading the article Absolute Momentum: A Simple Rule-Based Strategy and Universal Trend-Following Overlay posted in this forum here app.php/attach/file/3309284 I searched for an MT4 Absolute Momentum indicator online and I was surprised that I only found one Absolute Momentum indicator but I can't post the link here since that's not allowed but here is the code. Can anyone here convert this Absolute Momentum code below to MT4 code so we can all test Absolute Momentum in our trading strategies to see if it gives us an edge? Thanks.

Code: Select all

study("Absolute Momentum")

p = input(12,minval=1,title = "LookBack Period")
sym = input(title="Symbol", type=symbol, defval="SHY")
sm = input(1,minval=1,title = "Smooth Period")

rc = roc(close,p)

bil = security(sym,"M",close)
bilr = roc(bil,p)

rcdm = rc-bilr
srcdm = sma(rcdm,sm)

line = 0 

plot(rcdm,color= red,title= "Absolute Momentum" )
plot(srcdm,color = blue,title="Smooth Abs Momentum")
plot(line , color = gray,title="Zero Line")

barcolor(rcdm > 0 ? lime:red)
And here is what the indicator looks like:
All files in topic