Code with infinite loop
- This topic has 7 replies, 3 voices, and was last updated 2 years ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
Similar topics:
Forums › ProRealTime English forum › ProBuilder support › Code with infinite loop
Hello all,
I created an indicator that works well till 85 tick, but when i decrease tick under 85 the sistem show me infinite cicle.
Could anyone help me to understand where is the problem?
Here the block code that cause error:
for i=1 to nBarre-1 do
if price=price[i] then
volprice=volprice[i]+volprice
endif
next
Thanks a lot
I moved it from the Italian forum.
Please choose the correct language and forum, please.
Thank you 🙂
Hi Nicolas, below the entire code, anyway nBarre is intradaybarindex
Thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 |
if intradaybarindex = 0 then pvpsmf=undefined else price=TypicalPrice nBarre = intradaybarindex volrange=volume/range volprice=price*volrange for i=1 to nBarre-1 do if price=price[i] then volprice=volprice[i]+volprice endif next |
for i=1 to nBarre-1 do
if price=price[i] then
volprice=volprice[i]+volprice
endif
next
Are you using version prior to v11.1? “price” is now a reserved keyword. How many units do you displayed? The code is working fine for me on a 20 ticks timeframes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
if intradaybarindex = 0 then pvpsmf=undefined else iprice=TypicalPrice nBarre = intradaybarindex volrange=volume/range volprice=iprice*volrange for i=1 to nBarre-1 do if iprice=iprice[i] then volprice=volprice[i]+volprice endif next endif return volprice |
Find exclusive trading pro-tools on