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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        50 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        16 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X