Screener quarter bar
Forums › ProRealTime English forum › ProScreener support › Screener quarter bar
- This topic has 4 replies, 3 voices, and was last updated 3 years ago by Vonasi.
-
-
02/25/2018 at 5:31 PM #63899
Hello,
I am trying to do a screener to compare the quarter high / low with the previous quarter.
I saw I can use this code for the previous quarter
12345678910trimH=max(trimH,high)trimL=min(trimL,low)If openMonth<>openMonth[1] thenif openmonth=4 or openmonth=7 or openmonth=10 or openmonth=1 thentrimestrialH=trimHtrimestrialL=trimLtrimL=close*100trimH=0endifEndif1/ How can I do to get current quarter H/L?
2/ How to get the preceding quarter H/L? (the one N-2)
I believe this could be easier if we have a quarterly timeframe. Is there a solution?
Many thx
05/09/2020 at 5:00 AM #13068505/09/2020 at 8:15 AM #130692Simply store the last value in a different set of variables before storing the latest values. You can also reset the trimL to the high rather than to close*100 which is more guaranteed to work on every instrument.
123456789101112trimH=max(trimH,high)trimL=min(trimL,low)If openMonth<>openMonth[1] thenif openmonth=4 or openmonth=7 or openmonth=10 or openmonth=1 thentrimestrialH2=trimestrialHtrimestrialL2=trimestrialLtrimestrialH=trimHtrimestrialL=trimLtrimL=hightrimH=0endifEndif1 user thanked author for this post.
05/10/2020 at 5:18 AM #130823Hello Vonaci,
Thank you for reactivating this topic.
As reminder, The idea is to build a screener for quarter bars, starting with the instruction “timeframe (Monthly) as workaround.
Previous code allows to retrieve current high and past high only.
Is there a way to use instructions like
- trimestrialH[i], trimestrialL[i], trimestrialC[i], trimestrialO[i]
to retrieve the high, low, close and open of the bar number i in the past?
Many thanks in advance.
05/10/2020 at 11:04 AM #130860You could use something like this code that I’ve stolen from my OHLC MTF indicator.
123456789101112131415161718192021222324252627lookback = 2 //How many quarters back to get results fromif openmonth <> openmonth[1] and (openmonth = 1 or openmonth = 4 or openmonth = 7 or openmonth = 10) thenquarterindex = quarterindex + 1quarterhigh = 0quarterlow = closequarteropen = openquarterclose = closeif quarterindex > lookback thenfor j = 1 to barindexif quarterindex[j] = quarterindex - lookback thenmyquarterhigh = quarterhigh[j]myquarterlow = quarterlow[j]myquarteropen = quarteropen[j]myquarterclose = quarterclose[j]breakendifnextendifendifquarterhigh = max(quarterhigh,high)quarterlow = min(quarterlow,low)quarterclose = closereturn myquarterhigh, myquarterlow, myquarterclose, myquarteropen1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on