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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    19 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    60 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    43 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X