Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose=true vs False. Please clarify.

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

    CalculateOnBarClose=true vs False. Please clarify.

    Hello,
    I am new to NinjaScript and am trying to develop a Custom Strategy.
    I am confused on "calculateOnBarClose" value for "BackTesting" vs "Live Strategy".

    Question 1:
    ********
    When I am executing a Live Strategy, and if "executeOnBarClose=True", will NinjaTrader fire the entry order on the Open of Next bar after the bar on which my signal is triggered??

    Question 2:
    **********
    When I am executing a Live Strategy, and if "executeOnBarClose=True", will NinjaTrader fill me if my exit target is reached, even before the close of a bar or it strictly evaluates my target ONLY on the close of each bar?

    Thanks in Advance,
    Sudharsanv.

    #2
    Hello Sudharsanv,

    Thank you for your post.

    1) Yes. The bar isn't complete until the opening of the next bar. This is when your order will be placed.

    2) It only evalutes on the close. If the condition is true on the close then it will submit. If your condition is true while the bar is forming and then is false when the bar closes, then an order will not be submitted.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hello Ryan,
      Then, I have quite a dilemna. Please see my Issue.
      1.) I do not want my Signal to be triggered intra-bar, before the bar closes. In other words, I always want my entry signal to be evaluated ON BAR CLOSE.
      2.) However, after I am filled on entry, I do not want to wait till the next bar close, to evaluate Exit condition. Is there any way, ONLY FOR EXIT, that an intra-bar evaluation can be done?
      Thanks,
      Sudharsanv

      Comment


        #4
        Hi Sudharsanv,

        Take a look at this reference sample at the link below:


        This reference sample demonstrates running some logic once per bar and running other logic on every single tick.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        368 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X