I found a bug
Forums › ProRealTime English forum › ProBuilder support › I found a bug
- This topic has 4 replies, 3 voices, and was last updated 4 months ago by Iván.
-
-
06/21/2024 at 7:47 AM #234163
The indicator bellow, if I try to attach it to a chart is says “A positive integer field is expected with round”
Two things, that is a weird message because it surely should expect a floating point field, secondly “round()” is not used within the indicator! although it was in a previous iteration. Please advise?
timeframe(1 hour,updateonclose)
trend=MACD[12,26,9](close)
BolUp1,BolDown1, BolUp2, BolMiddle, BolDown2, BolUp3, BolDown3, BolUp1Direction, BolDown1Direction, BolUp2Direction, BolDown2Direction=CALL “#HourlyBollinger”T1Status=call “#T1″[0]
timeframe(5 Minute, updateonclose)
signal=0if OpenHour >=8 and OpenHour <=15 then
//Long R1
if tR1 and close>open and BolDown1Direction>0 and low<=BolDown1 and close>BolDown1 and high<BolMiddle then
signal=low-0.5
endif//Short R1
if tR1 and close<open and BolUp1Direction<0 and high>=Bolup1 and close<BolUp1 and low>BolMiddle then
signal=high+0.5
endif//Long R2
if tR2 and close>open and BolDown2Direction>0 and low<=BolDown2 and close>BolDown2 and close<BolDown1 and high<BolDown1 then
signal=low-0.5
endif//Short R2
if tR2 and close<open and BolUp2Direction<0 and high>=Bolup2 and close<BolUp2 and close>BolUp1 and low>BolUp1 then
signal=high+0.5
endifendif
if tT1 and T1Status[1]=0 and T1Status=1 then
signal=low-0.5
endifif tT1 and T1Status[1]=0 and T1Status=-1 then
signal=high+0.5
endifif tT2 and T1Status[1]=0 and T1Status=2 then
signal=low-0.5
endifif tT2 and T1Status[1]=0 and T1Status=-2 then
signal=high+0.5
endifreturn signal as “Signal”
06/21/2024 at 8:30 AM #234166It seems the issue is related to switching time frames, I managed to find a work around, by returning unrounded values from #HourlyBollinger and then rounding them in #Signals within the 5 minute timeframe.
The tine frame switching feature, seems a little flaky
06/21/2024 at 8:37 AM #234167It seems the issue is related to switching time frames, I managed to find a work around, by returning unrounded values from #HourlyBollinger and then rounding them in #Signals within the 5 minute timeframe.
The time frame switching feature, seems a little flaky
06/21/2024 at 9:02 AM #234170While writing this, you posted your work around message, this is what I was thinking.
Usually when I get, ‘a Positive integer field’ in error message, it means an index value, is either, not an integer or its less than 1 or 0, some index values don’t like being zero.
The fact that ’round’ is mentioned, would lead me to believe that the parameter for setting number the decimal places could be out of bounds.
I can see you ‘call’ other indicators, the problem could be in there. #T1, sends value ‘0’, or in a stock code segment.
Based on a couple other posts, using different time frames can give different values between code and chart. I always verify now.
Failing finding anything obvious, try to isolate, what part of code throwing error.
06/21/2024 at 11:02 AM #234182 -
AuthorPosts
Find exclusive trading pro-tools on