Adding a date range to screener

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #247721 quote
    segie
    Participant
    Senior

    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]
    
    #247731 quote
    robertogozzi
    Moderator
    Master

    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]
    segie and Iván González thanked this post
    #247748 quote
    segie
    Participant
    Senior

    thank you

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Adding a date range to screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
segie @segie Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by segie
9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 05/29/2025
Status: Active
Attachments: No files
Logo Logo
Loading...