Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting strategy with oco order

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

    Backtesting strategy with oco order

    Hi,

    i am new to NT an tried to backtest some of my strategies but i get into some limitations of my knowledge were neither the forum nor the documentation gave me an answer. So maybe someone else can give me a hint.

    I want to create an oco order to better test an eod strategy since i have no better granularity i tried this as suggested in the forum (intrabar). So what i need is some sort of enterlongstop & entershortstop at the same time if possible with stoploss, or if not i can write some routine with OnOrderUpdate to generate this after one of the orders would be filled.

    But a simple try to open both positions led to an error in the logs, that only one of those orders could be executed. Is there some sort of oco capability i can use or a workaround which can lead to the same result?

    I am aware of the problem that a bar have no mind in which order the OLHC prices occure but this is a problem i probably can handle with some other glue logic.

    Thanks

    #2
    Hi Tommyknocker, welcome to the NinjaTrader support forums!

    If you try placing your bracket entry orders you will run into the 'Internal Order Handling Rules' - http://www.ninjatrader-support.com/H...verview36.html (scroll to the last section).

    To work around those you would need to monitor for your bracket prices and send just one order as the market triggers them.

    For more testing granularity, please check this sample - http://www.ninjatrader-support2.com/...ead.php?t=6652

    Comment


      #3
      Thanks for your instant reply i read the sections you posted.

      The intrabar sample link was that what i meant by mention the intrabar statement, this was the post which inspired may to try to simulate intraday granularity by executing stop orders. But sometimes the entry points are too close to make a decision what next happens so i have to put an oco order to let the market decide which direction to go.

      As i have no more data granularity i still get stuck to that problem, so is it possible to workaround this internal order handling/verifications in historical backtests?

      Or is it possible to access future data (nextbar high/low) so the logic can decide which order will be filled and place only one order?
      Last edited by Tommyknocker; 03-30-2009, 06:52 AM.

      Comment


        #4
        Tommyknocker,

        If you do not have more granular data there is nothing you can do from a backtest. Without information the strategy cannot work around the Internal Order Handling Rules.

        NinjaTrader cannot peak into the future. You will not have any future information available at any point in a backtest.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          OK, then there is nothing i can do but import some data in a smaller timeframe.

          Thank you for your answer.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          580 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          335 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          102 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X