Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exits are executed 3 minutes later

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

    Exits are executed 3 minutes later

    Hi,

    I've written a strategy that I'm backtesting on historical data. To see what happens I've put a lot of Print statements within the code.

    I'm working on a 3 minute timeframe.
    I see that on 15:33 the statement ExitLong() is called. On the trades tab of the strategy analyser (and the chart tab) I see that the ExitLong is executed at 15:36? How can this happen while the function is called at 15:33?

    How to fix this?

    BTW I'm just beginning with the building of strategies...
    Last edited by johannes; 12-14-2008, 03:10 PM.

    #2
    Functions are called at the close of a bar thus, any action taken on the 15:33 executes on the next bar which is the 15:36 bar. This is expected and how backtesting works...in any platform.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks for your response!

      I now added a 1 minute timeframe, in that way it's executed at 15:34, what makes a big difference. But thank you for the help.

      Comment


        #4
        Originally posted by NinjaTrader_Ray View Post
        Functions are called at the close of a bar thus, any action taken on the 15:33 executes on the next bar which is the 15:36 bar. This is expected and how backtesting works...in any platform.
        Wait, are you saying NT cannot trade based on ticks???
        I.e if you Enter strategy on 15 min bars but want to exit at a specific tickbased profit target or stop loss you can't do it?

        Thanks

        Comment


          #5
          Originally posted by coolraz View Post
          Wait, are you saying NT cannot trade based on ticks???
          I.e if you Enter strategy on 15 min bars but want to exit at a specific tickbased profit target or stop loss you can't do it?

          Thanks
          As far as I found out, it can be done, only to be not the time period behind the moment the action is triggerd is by adding a timeperiod smaller to the one that triggers, for e.g. when my indicator is triggered on a 3 minute timeframe I could set a 10 second timeframe that checks for a trigger from the 3 minute indicator and then executes.

          So indicator says at 15:00 action, then I could have the order executed at 15:00:10. But when I check from the 3 minute, the order is executed at 15:03:00.

          Comment


            #6
            Originally posted by johannes View Post
            As far as I found out, it can be done, only to be not the time period behind the moment the action is triggerd is by adding a timeperiod smaller to the one that triggers, for e.g. when my indicator is triggered on a 3 minute timeframe I could set a 10 second timeframe that checks for a trigger from the 3 minute indicator and then executes.

            So indicator says at 15:00 action, then I could have the order executed at 15:00:10. But when I check from the 3 minute, the order is executed at 15:03:00.
            Yeah I see, 1 min is still kinda bad for a real strategy though. Seriously, in a moving market, do you really want your trade to sit there for a whole minute going against you????

            I would really like a Support Rep response to this.
            Thanks!

            Comment


              #7
              Hi coolraz, sure can NinjaTrader 'trade on ticks'. If you for example enter a OCO Stoploss order and Profit Target they are like live working orders in realtime and will fill 'intrabar'.

              If you want more (finer) backtesting control, check out this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=6652

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              558 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              324 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              545 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              547 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X