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 aussugardefender, Today, 01:07 AM
      0 responses
      1 view
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      238 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      383 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      1 view
      0 likes
      Last Post oviejo
      by oviejo
       
      Started by pechtri, 06-22-2023, 02:31 AM
      10 responses
      125 views
      0 likes
      Last Post Leeroy_Jenkins  
      Working...
      X