Hi Nicholas, im trying to write code that involves an EMA break above or below the Coppock “Zero line”. Im trying to delete “Buy” signals above the zero line and delete “Sell” signals below the zero line. ONLY “SEL’L SIGNALS ABOVE THE ZERO LINE AND ONLY “BUY” SIGNAL BELOW THE ZERO LINE ! How do i write “Zero line” in code when there is no “Zero line” in the coding constraints? Any suggestions?
cheers
Pleidian
a = ROC[70](close)
b = ROC[10](close)
coppock = weightedaverage[50](a+b)
avg = average[20,1](coppock)
if avg crosses over coppock then
DRAWTEXT("SELL", barindex, average[20,1](coppock), SansSerif, standard,15)coloured(0,0,0)
endif
if avg crosses under coppock then
DRAWTEXT("BUY", barindex, average[20,1](coppock), SansSerif, standard,15)coloured(0,0,0)
endif
RETURN coppock as "Coppock curve", 0 as "0 level", avg as "average of coppock"
Since the dawn of time, 0 is just … 0! 😆
coppock > 0
(translation: coppock is above 0)