• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sun0781, Today, 05:02 PM
    0 responses
    6 views
    0 likes
    Last Post sun0781
    by sun0781
     
    Started by ronhb107, 09-12-2019, 10:09 AM
    4 responses
    41 views
    0 likes
    Last Post Mr.Trader  
    Started by rwilliam, Today, 03:55 PM
    0 responses
    3 views
    0 likes
    Last Post rwilliam  
    Started by asmmbillah, Today, 03:42 PM
    2 responses
    8 views
    0 likes
    Last Post asmmbillah  
    Started by NT-Roland, Today, 03:25 PM
    0 responses
    7 views
    0 likes
    Last Post NT-Roland  
    Working...
    X