Thank you Roberto
I was trying to describe a rising 50 moving average.
Would If avg[50](close)>avg[50][3] then….. be correct.
I know the trailing moving average omits (close) because it’s already
happened, I got the wrong brackets for the 3 which was supposed to be 3 candles back.
back.
The StocK>80 then…. line did work .
Is all this correct ?
MyMACDmainline=MACDline[12,26,9](close)//difference between the two EMA's
MyMACDsignal=ExponentialAverage[9](MyMACDmainline)//ema of the above line (MyMACDmainline)
MyMACDhistoGram=MACD[12,26,9](close)//histogram
AboveMACD=MyMACDmainline>MyMACDsignal
BelowMACD=MyMACDmainline<MyMACDsignal
you can use variables AboveMACD and BelowMACD in your code (in the above code the histogram is not used, if you don’t need it you may want to either remove or comment out line 3).
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok