Multi breakout screener
Forums › ProRealTime English forum › ProScreener support › Multi breakout screener
- This topic has 18 replies, 3 voices, and was last updated 6 years ago by tradingtrader80.
-
-
01/20/2018 at 1:39 PM #59950
Hello,
I was inspired with this topic :
https://www.prorealcode.com/topic/monthly-high-low-close-indicator/
and try to improve the screener on 2sd page. The purpose is to have a 2 digits number in the result column : first number is trimestrial tendency ans 2sd number is monthly tendency. 22 is above trim high and Monthly high (N-1), 21 is above trim high and below monthly low, 01 between trim high and low and below monthly low, etc …
Instead of adding numbers, Iwould like to have them print in the result column because 0+1 = 1 (and not 01) 0+0 = 0
Moreover, it seems that it’s working only for extreme (22,0 or 1) but not for mixed (21,11,12, …)
Any idéa to help me fix that ?
Here is the code :
12345678910111213141516171819202122232425262728293031323334353637383940414243444546timeframe(daily)//previous monthly high/lowif Month < Month[1] thenMhi = Highest[BarIndex - lastMonthBarIndex](DHigh(1))Mlo = Lowest[BarIndex - lastMonthBarIndex](DLow(1))lastMonthBarIndex = BarIndexendif// previous quartly high/lowtrimH = max(trimH,high)trimL = min(trimL,low)if month < month[1] then//Mhi=trimH//Mlo=trimLif month = 4 or month = 7 or month = 10 or month = 1 thenQhi = trimHQlo = trimLtrimL = close*100trimH = 0endifendifif close > Qhi thenq = 20endifif close < Qlo thenq = 10endifif close < Qhi and close > Qlo thenq = 0endif//m=0if close > Mhi thenm = 2endifif close < Mlo thenm = 1endifif close < Mhi and close > Mlo thenm = 0endift = q + mSCREENER (t as "Q M")01/20/2018 at 4:39 PM #59955To write code, please use the <> “insert PRT code” button. Thanks.
01/21/2018 at 11:12 AM #6006501/21/2018 at 7:33 PM #60092Screener conditions must be under brackets and not parenthesis.
Thanks for your answer.
There is no conditions for that screener, (t as “Q M”) is only the indication how to display results.
And my question is how to display result as 2 numbers and not an addition.
Thanks
01/21/2018 at 8:39 PM #60098Sorry.. did not understand your question the first time.
10+1 should return 11 obviously. If it doesn’t, there must something wrong in your code or in the quarterly calculation. Did you try to return the variables and to compare it with an indicator?
01/22/2018 at 8:29 AM #60124Thanks, I will check that tonignt
01/22/2018 at 8:36 PM #60219Hello,
It seems to works all right except that sometimes the calculation is wrong. but I think it’s only a reference problem.
It returns that prices are between High and Low, even if we are above last trimester or month high. We can see on Audjpy graph joined that price is under October’s high and program considers that we are under monthly high. I would like to consider only last month or last trimester’s high for calculation.
Is that possible ? I put the code below.
Thanks a lot for your help.
Detection HighLow mod212345678910111213141516171819202122232425262728293031323334353637383940414243444546timeframe(daily)//previous monthly high/lowif Month < Month[1] thenMhi = Highest[BarIndex - lastMonthBarIndex](DHigh(1))Mlo = Lowest[BarIndex - lastMonthBarIndex](DLow(1))lastMonthBarIndex = BarIndexendif// previous quartly high/lowtrimH = max(trimH,high)trimL = min(trimL,low)if month < month[1] then//Mhi=trimH//Mlo=trimLif month = 4 or month = 7 or month = 10 or month = 1 thenQhi = trimHQlo = trimLtrimL = close*100trimH = 0endifendifif close > Qhi thenq = 20endifif close < Qlo thenq =0endifif close < Qhi and close > Qlo thenq =10endif//m=0if close > Mhi thenm = 2endifif close < Mlo thenm = 0endifif close < Mhi and close > Mlo thenm = 1endift = q + mSCREENER ( t as "QM")01/22/2018 at 8:38 PM #60220here are attachments
01/23/2018 at 10:53 AM #6027201/23/2018 at 8:01 PM #60345I modified that because there is no result returned with <>
01/23/2018 at 8:37 PM #60348Indeed it’s working ok for trimestrial but do not refer to last month’s high for monthly. Probably for the reason you said, but I don’t understand why no result are returned.
01/24/2018 at 9:50 PM #60449I modified that because there is no result returned with <>
Hello,
Any idea why ?
01/26/2018 at 9:42 AM #60568I think I fixed it, here is the code:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647//previous monthly high/lowif Month <> Month[1] thenMhi = Highest[max(1,BarIndex - lastMonthBarIndex)](High[1])Mlo = Lowest[max(1,BarIndex - lastMonthBarIndex)](Low[1])lastMonthBarIndex = BarIndexendif// previous quartly high/lowtrimH = max(trimH,high)trimL = min(trimL,low)if month <> month[1] then//Mhi=trimH//Mlo=trimLif month = 4 or month = 7 or month = 10 or month = 1 thenQhi = trimHQlo = trimLtrimL = close*100trimH = 0endifendifif qhi>0 and qlo>0 thenif close > Qhi thenq = 20endifif close < Qlo thenq =0endifif close < Qhi and close > Qlo thenq =10endifendifif mhi>0 and mlo>0 thenif close > Mhi thenm = 2endifif close < Mlo thenm = 0endifif close < Mhi and close > Mlo thenm = 1endift = q + mendifSCREENER ( t as "QM")The problem came from a wrong period for the look of Highest high and the Lowest low, no error was fired by ProScreener for it, but I think it was caused by a period set to 0 at the first run of the code.
01/26/2018 at 7:15 PM #60636GREAT ! It works perfectly ! Thanks a lot, I would never find that !
I’m really graceful for the help you provide to all of us.
02/13/2018 at 8:46 PM #62658Hello,
I’m back with a similar problem I had with monthly return.
I want to had Weekly classification in the screener, and sometimes it returns the right number and sometimes not.
I suppose that it’s because it doesn’t reffer to last week but older week.
Again the line “if month < month[1] then” is probably wrong but if I use <> the screener doesn’t return anything.
Any idéa to fix that ?
I will add Daily after that.
Thanks a lot for your help
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374once Whi=undefinedonce Wlo=undefineddailyHigh= DHigh(1)dailyLow= DLow(1)//Calcul le +Haut Weekly de la semaine passéeIf DayOfWeek < DayOfWeek[1] thenWhi = Highest[BarIndex - lastWeekBarIndex](dailyHigh)Wlo = Lowest[BarIndex - lastWeekBarIndex](dailyLow)lastWeekBarIndex = BarIndexendif//previous monthly high/lowif Month <> Month[1] thenMhi = Highest[max(1,BarIndex - lastMonthBarIndex)](High[1])Mlo = Lowest[max(1,BarIndex - lastMonthBarIndex)](Low[1])lastMonthBarIndex = BarIndexendif// previous quartly high/lowtrimH = max(trimH,high)trimL = min(trimL,low)if month <> month[1] then//Mhi=trimH//Mlo=trimLif month = 4 or month = 7 or month = 10 or month = 1 thenQhi = trimHQlo = trimLtrimL = close*100trimH = 0endifendifif qhi>0 and qlo>0 thenif close > Qhi thenq = 200endifif close < Qlo thenq =0endifif close < Qhi and close > Qlo thenq =100endifendifif mhi>0 and mlo>0 thenif close > Mhi thenm = 20endifif close < Mlo thenm = 0endifif close < Mhi and close > Mlo thenm = 10endift = q + m + wendifif Whi>0 and Wlo>0 thenif close > Whi thenw = 2endifif close < Wlo thenw =0endifif close < Whi and close > Wlo thenw =1endifendifSCREENER ( t as "QM") -
AuthorPosts
Find exclusive trading pro-tools on