• 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 billythekid72, Today, 09:47 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by JohnS52, Today, 09:49 AM
    0 responses
    6 views
    0 likes
    Last Post JohnS52
    by JohnS52
     
    Started by DTSSTS, Today, 08:29 AM
    2 responses
    19 views
    0 likes
    Last Post DTSSTS
    by DTSSTS
     
    Started by mtamaku, Today, 08:39 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Douglee, Today, 08:11 AM
    3 responses
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X