Code with infinite loop
Forums › ProRealTime English forum › ProBuilder support › Code with infinite loop
- This topic has 7 replies, 3 voices, and was last updated 2 years ago by gianpre.
-
-
11/29/2022 at 8:06 PM #205030
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
nextThanks a lot
11/30/2022 at 5:44 AM #205038I moved it from the Italian forum.
Please choose the correct language and forum, please.
Thank you 🙂
11/30/2022 at 9:50 AM #20505611/30/2022 at 10:11 AM #205058Hi Nicolas, below the entire code, anyway nBarre is intradaybarindex
Thanks12345678910111213if intradaybarindex = 0 thenpvpsmf=undefinedelseprice=TypicalPricenBarre = intradaybarindexvolrange=volume/rangevolprice=price*volrangefor i=1 to nBarre-1 doif price=price[i] thenvolprice=volprice[i]+volpriceendifnextfor i=1 to nBarre-1 do
if price=price[i] then
volprice=volprice[i]+volprice
endif
next11/30/2022 at 1:38 PM #205068Are 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.
12345678910111213141516if intradaybarindex = 0 thenpvpsmf=undefinedelseiprice=TypicalPricenBarre = intradaybarindexvolrange=volume/rangevolprice=iprice*volrangefor i=1 to nBarre-1 doif iprice=iprice[i] thenvolprice=volprice[i]+volpriceendifnextendifreturn volprice11/30/2022 at 1:54 PM #20507012/01/2022 at 9:01 AM #20510012/01/2022 at 1:32 PM #205127 -
AuthorPosts
Find exclusive trading pro-tools on