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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      59 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      143 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      161 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      97 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      283 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X