Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Preventing Backtesting when enabling a strategy

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

    Preventing Backtesting when enabling a strategy

    Hello Ninjatrader Support,

    I'm currently trying to perfect a work around for creating a strategy that manages my exits only. Since this isn't possible in the current version of NT, my thought process has been to create a strategy that trades on the open of next bar when enabled and then manages the exit accordingly.

    The problem is I only want the strategy to handle one order the entire time it is enabled. With maxpositions, the strategy currently enters, exits, and then re-enters at the open of the next bar after a close.

    In an attempt to remedy this issue, I implemented a counter that prevents more than one entry from occurring during the life of the strategy (if counter == 0, trade). However, when I enable my strategy, the historical backtesting that goes along with it brings the counter to 1, thus preventing any live trading.

    What is a functional solution to this problem?

    Thanks

    #2
    Hi Elynt, welcome to our forums. One approach would be to not process anything historical then and just return out - https://www.ninjatrader.com/support/...historical.htm

    So your logic would then only kick into gear once realtime bars are processed by the script.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Elynt, welcome to our forums. One approach would be to not process anything historical then and just return out - https://www.ninjatrader.com/support/...historical.htm

      So your logic would then only kick into gear once realtime bars are processed by the script.
      Brilliantly simple. Thank you for the help!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by jclose, Today, 09:37 PM
      0 responses
      5 views
      0 likes
      Last Post jclose
      by jclose
       
      Started by WeyldFalcon, 08-07-2020, 06:13 AM
      10 responses
      1,414 views
      0 likes
      Last Post Traderontheroad  
      Started by firefoxforum12, Today, 08:53 PM
      0 responses
      11 views
      0 likes
      Last Post firefoxforum12  
      Started by stafe, Today, 08:34 PM
      0 responses
      11 views
      0 likes
      Last Post stafe
      by stafe
       
      Started by sastrades, 01-31-2024, 10:19 PM
      11 responses
      169 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X