Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Turning onbarclose on and off

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

    Turning onbarclose on and off

    Is there any issue with turning onbarclose for a strategy on and off. I can conserve my cpu most of the time but would liek to dynamically turn on onbarclose=false when getting close to my target.

    I wasn't sure if there were any problems in doing this.

    Cheers

    ct

    #2
    I dont think you can change that input while the strategy is running without having it recalculate for the entire chart. If you do that, NT will likely close your position.
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      We do not recommended doing this, but you can try and see if its behavior is still acceptable for your needs. If you experience what mrlogik's point then you will most likely not be able to use this approach.

      Alternatively you can create your own logic to mimic CalculateOnBarClose with if-statement for if (FirstTickOfBar) { } which essentially is on close of previous bar. Remember you will need to change all bar indexing to be one back (Close[0] should be Close[1]).
      Last edited by NinjaTrader_JoshP; 09-17-2008, 08:34 AM.
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      576 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X