Is this a bug ?
The following code always return 4.
if Hour >= 22 or Hour<1 or (Hour=1 and minute<15) then
spread = 4
elsif Hour = 17 then //and minute >= 30 or Hour >= 18 then
spread = 2
elsif hour >= 9 then
spread = 1
elsif hour >= 8 then
spread = 2
else
spread = 3
endif
return spread
// this code always return 4 !!????
But this works perfectly in ProBackText/ProOrder
if Hour >= 22 or Hour<1 or (Hour=1 and minute<15) then
spread = 4
elsif Hour = 17 then //and minute >= 30 or Hour >= 18 then
spread = 2
elsif hour >= 9 then
spread = 1
elsif hour >= 8 then
spread = 2
else
spread = 3
endif
Graph spread as "spread"
if 0 then
buy at market
endif
Did I miss something ? Or isn’t this a bug ?
Also same code runs faster in ProBackTest than in ProBuilder (even working code)
Please try to write a topic title more explicit next time! And please update your profile by selecting your country.
The first code (indicator) runs correctly for me on 5-minutes timeframe. What timeframe and instrument did you check?
Thank you for testing the code.
I am using tick time frame.
p.s.: Yeah I’m new to this forum.
I have indeed the same issue on tick-charts. I will try to know more about it and let you know.
This is a problem specific in v10.3 (not present with new version 11). You should be able to get rid of the issue by using this kind of code instead:
MyHOur=Hour
if MyHour >= 22 or MyHour<1 or (MyHour=1 and minute<15) then
spread = 4
elsif MyHour = 17 then //and minute >= 30 or MyHour >= 18 then
spread = 2
elsif MyHour >= 9 then
spread = 1
elsif MyHour >= 8 then
spread = 2
else
spread = 3
endif
return spread