Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 louiseruch, Today, 01:11 AM
      0 responses
      1 view
      0 likes
      Last Post louiseruch  
      Started by kujista, Today, 12:39 AM
      0 responses
      3 views
      0 likes
      Last Post kujista
      by kujista
       
      Started by tonynt, 05-21-2019, 06:27 AM
      11 responses
      535 views
      1 like
      Last Post NinjaTrader_Jason  
      Started by fitspressotablettry, Today, 12:36 AM
      0 responses
      1 view
      0 likes
      Last Post fitspressotablettry  
      Started by Lancer, 01-29-2020, 10:15 PM
      7 responses
      469 views
      1 like
      Last Post NinjaTrader_Jason  
      Working...
      X