REM Compute a simple moving average on the last 1 day
ma1 = AVERAGE[1]
REM Compute a simple moving average on the last 20 days
ma20 = AVERAGE[20]
REM Compute the differential speed between the short and the long moving average
speed = MOMENTUM(ma20-ma1) * 100 / CLOSE
REM Select all the currencies on which that crossing over has just occured
IF ma1 CROSSES OVER ma20 THEN
SCREENER (speed AS "Speed")
ENDIF
Hi,
How can I add this condition:
Price must also be trading over the 200 day simple moving average.
Thanks,
Segie
JSParticipant
Senior
Hi,
Ma1=Average[1] is the same as “Close”…
You can’t use the “Momentum” instruction like that…
https://www.prorealcode.com/documentation/momentum/
This “screener” checks if the “Close” crosses over MA20 and that the “Close” is also higher than MA200…
MA1=Average[1](Close) // MA1=Close
MA20=Average[20](Close)
MA200=Average[200](Close)
PctDifference=(MA1-MA20)/Close*100
C1=PctDifference crosses over 0
C2=Close > MA200
Screener[C1 and C2]