The multi timeframe screener doesn’t work?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #257543 quote
    thomas2004ch
    Participant
    Average

    Hi,


    Here is my screener:

    // sample screener code
    cPrice = close > 5
    
    
    MyEMA1 = ExponentialAverage[5](close)
    MyEMA2 = ExponentialAverage[10](close)
    MyEMA3 = ExponentialAverage[20](close)
    
    MyMACDLine = MACDline[12,26,9](close)
    
    TIMEFRAME(monthly)
    MonthlyCondition = (close[2] > MyEMA1[2]) and (close[1] > MyEMA1[1]) and (close[0] > MyEMA1[0]) and (close > open)
    
    TIMEFRAME(weekly)
    SlopeEMA1 = LinearRegressionSlope[10](MyEMA1)
    SlopeEMA2 = LinearRegressionSlope[10](MyEMA2)
    SlopeEMA3 = LinearRegressionSlope[10](MyEMA3)
    
    WeeklyConditions = SlopeEMA1 and SlopeEMA2 and SlopeEMA3
    
    TIMEFRAME(daily)
    DailyConditions = MyMACDLine crosses over 0
    
    ///////////////////////////////////////////
    conditions = cPrice and MonthlyCondition and WeeklyConditions and DailyConditions
    //conditions = cPrice and cVol and DailyConditions and WeeklyConditions
    //////////////////////////////////////////
    TIMEFRAME(default)
    SCREENER[conditions](close as "close")
    


    But it doesn’t seem to work. Only the daily condition is filled. But the weekly and monthly not.


    Attached is the “selection to scan”.

    #257551 quote
    Iván González
    Moderator
    Master

    At first glance, I see several errors. For example, the slopeEMA is not a binary number. Perhaps you meant slopeEMA > 0.

    On the other hand, I don’t know if it was your intention or not, but the right thing to do is to define each indicator in its own timeframe.

    #257553 quote
    Nicolas
    Keymaster
    Master

    Indeed, in your code, the indicators are declared in the timeframe you launch the screener on because they are not inside a TIMEFRAME declaration.

    To be clear: for each timeframe you want to use an indicator value, add this indicator value into a variable and change its variable name if you are using the same indicator in other timeframe.

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

The multi timeframe screener doesn’t work?


Platform Support: Charts, Data & Broker Setup

New Reply
Author
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Nicolas
12 hours, 56 minutes ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 02/04/2026
Status: Active
Attachments: 1 files
Logo Logo
Loading...