Hi,
I’m trying to screen for the previous week price movement (price candle close).
How can I add a date range to the attached code e.g. if I want to screen dates 18th-24th May?
Regards,
Segie
ST1 = SuperTrend[3, 4]
ST2 = SuperTrend[5, 6]
// Define conditions
C1 = Close crosses over ST1 AND Close crosses over ST2 // Price crosses above both ST1 and ST2
C2 = Close >= 1 AND Close <= 5 // Price within the specified range (adjust as necessary)
// Combine the conditions into a signal
Signal = C1 AND C2
// Use the signal for screening
Screener[Signal]
Try this one:
ST1 = SuperTrend[3, 4]
ST2 = SuperTrend[5, 6]
Signal = 0
FOR i = 0 TO BarIndex
IF (OpenDate[i] >= 20250518) AND (OpenDate[i] <= 20250524) THEN
// Define conditions
C1 = Close[i] crosses over ST1[i] AND Close crosses over ST2[i] // Price crosses above both ST1 and ST2
C2 = Close[i] >= 1 AND Close[i] <= 5 // Price within the specified range (adjust as necessary)
// Combine the conditions into a signal
Signal = C1 AND C2
// Use the signal for screening
IF Signal THEN
break
ENDIF
ENDIF
NEXT
Screener[Signal]