I was wondering how to screen for MACDLine crossing MACDSignal on the weekly timeframe that occurred on the week January 10th 2022.
There you go:
Timeframe(Weekly)
Cond = 0
ML = MACDline[12,26,9](close)
MS = MACDSignal[12,26,9](close)
FOR i = 253 DOWNTO 0
IF Date[i] = 20220116 THEN
Cond = ML[i] CROSSES OVER MS[i]
break
ENDIF
NEXT
SCREENER[Cond]
Beware that you MUST write the date the weekly bar closes, it is usually 6 days AFTER it opens (which is shown on your chart), but for some instruments/assets it’s 7 days AFTER the opening.
You may add this simple indicator to your weekly chart to find out:
RETURN Date AS "Closing Date"
Be warned that screeners with IG have a 254-bar history (1024 with PRT’s Premium version) and that MACD uses EMAs to make calculations, which require more that twice the PERIODS used in Macd itself. So you won’t be able to use periods larger than 70-80 for any of your MACD periods(MACD[70,110,10] will fail).