Code with infinite loop

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #205030 quote
    gianpre
    Participant
    New

    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

    #205038 quote
    robertogozzi
    Moderator
    Master

    I moved it from the Italian forum.

    Please choose the correct language and forum, please.

    Thank you 🙂

    #205056 quote
    Nicolas
    Keymaster
    Master

    What is the value of “nBarre” please?

    #205058 quote
    gianpre
    Participant
    New

    Hi Nicolas, below the entire code, anyway nBarre is intradaybarindex
    Thanks

    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

    #205068 quote
    Nicolas
    Keymaster
    Master

    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.

    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
    #205070 quote
    gianpre
    Participant
    New

    I’m using T3 version, I don’t know what but is old.
    Regarding the unit the code crashing below 84 tick of dax.

    #205100 quote
    Nicolas
    Keymaster
    Master

    T3 is based upon PRT version from 2009 and it is not supported anymore. I’m sorry I dont think I can do anything about your issue. The platform core and language had considerably evolved since then!

    #205127 quote
    gianpre
    Participant
    New

    Ok Nicolas. thanks again

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Code with infinite loop


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
gianpre @gianpre Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by gianpre
3 years, 2 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/29/2022
Status: Active
Attachments: No files
Logo Logo
Loading...