Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate - BarsInProgress structure

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    OnBarUpdate - BarsInProgress structure

    Hello,

    I want to ask please if it is working ok in the code of a strategy and indicator when using in onbarupdate eg 3 dataseries and coding
    if(BarsInProgress==1 || BarsInProgress=02) {if(Closes{[1][0]>Opens[1][0] || Closes{[2][0]>Opens[2][0]) then do}
    or should be the conditions for each dataseries in an own {} to have each working like a seperate gear
    if(BIP==1){}
    if(BIP==2){}


    Thank you!
    Tony

    #2
    Hello tonynt,

    Thanks for your post.

    Regarding:

    if(BarsInProgress==1 || BarsInProgress=02)
    {
    if(Closes{[1][0]>Opens[1][0] || Closes{[2][0]>Opens[2][0])
    //then do
    }


    The conditions Closes{[1][0]>Opens[1][0] || Closes{[2][0]>Opens[2][0] are evaluated only when the 1st added data series or the 2nd added data series calls OnBarUpdate().

    Regarding, "or should be the conditions for each dataseries in an own {}" There are too many unknowns to answer the question. In both cases we recommend that you test your code and verify its performance by using Print statements.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    55 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    132 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X