Screening by monthly ATR

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #83383 quote
    YogiB
    Participant
    New

    Hello all,

    I am trying to build a screener based on monthly ATR. since I cannot use monthly time frame, I coded an indicator for the weekly timeframe which i intend to use as a function .

    nbrWeeksInMonth = 4
    
    
    if barindex > nbrWeeksInMonth then
    
    weekIndex = barindex mod nbrWeeksInMonth
    if weekIndex = 0 then
    weekindex = 4
    endif
    
    monthlyHigh = highest[weekIndex](high)
    monthlyLow = lowest[weekIndex](low)
    closePrevMonth = close[weekIndex]
    
    a = monthlyHigh - monthlyLow
    b = abs(monthlyHigh - closePrevMonth)
    c = abs(monthlyLow - closePrevMonth)
    atrCurrent = max(max(a,b),c)
    atrMonthly = ((19 * atrMonthly[weekindex]) + atrCurrent) / 20
    endif

    when I look on graph of the indicator it provides pretty good results for me.

    My problem is that when I call this indicator from the screener code using “CALL” function I get different values from those I see on the graph.

    Please assist.

    #83692 quote
    Nicolas
    Keymaster
    Master

    I think that the problem is that ProScreener have a max history of 254 bars available. So it’s possible that the data is not sufficient for your monthly ATR to be calculated. On which timeframe on ProScreener did you test the code? Did you try to include the code directly into the screener code rather than using it with a CALL instruction?

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

Screening by monthly ATR


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
YogiB @yogib Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
7 years, 4 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 10/23/2018
Status: Active
Attachments: No files
Logo Logo
Loading...