• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

A bug with OnExecution ?

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

    A bug with OnExecution ?

    Hi,

    I've just come across a weird NT behaviour. Wondering if it's a bug or not.

    I've got two series of the same instrument in my strategy: a 30-minute (index =0) and 1-minute (index=1). I'm making trading decisions based on price action on the 1-minute series and am sending stop orders to barsInProgrrssIndex = 1 (the 1-minute one). Everything's fine till now. When the stop orders gets filled OnExecution is called. However, it's called only after the close of the 30-minute bar following the fill and what's even more weird BarsInProgress = 0.
    Is this expected or is it a bug? I'd certainly expect OnExecution to be called with BarsInProgress = 1 and immediately following a fill.

    Cheers,
    ipso

    #2
    Hello ipso33,

    Thanks for the post.

    Originally posted by ipso33 View Post
    However, it's called only after the close of the 30-minute bar following the fill
    How are you verifying this? OnExecution is called during fills, not bar updates.

    What environment are you doing this on? (Historical or real time)
    CalculateOnBarClose setting?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for such a quick reply!


      Originally posted by NinjaTrader_RyanM View Post
      Hello ipso33,


      How are you verifying this? OnExecution is called during fills, not bar updates.

      What environment are you doing this on? (Historical or real time)
      CalculateOnBarClose setting?
      This is historical so everything inluding fills happens on a bar close, right? I verify this by printing out the "current" time.

      Code:
      protected override void OnExecution(IExecution ex)
      {
      	Print(Time[0] + " execution -> BIP: " + BarsInProgress);	
      }
      CalculateOnBarClose is false but it doesn't matter in backtest, does it?

      Cheers,
      Ipso

      Comment


        #4
        Thanks for the reply and your patience. We are currently checking into this and will update you tomorrow.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Hello,

          This is Brett responding for Ryan who is out today.

          Executions only know of the INSTRUMENT it is traded on and does not relate to bars in progress. Therefor this is expected to occur in current architecture.

          -Brett


          BrettNinjaTrader Product Management

          Comment


            #6
            Originally posted by NinjaTrader_Brett View Post
            Executions only know of the INSTRUMENT it is traded on and does not relate to bars in progress. Therefor this is expected to occur in current architecture.
            Cool! Thanks for clearing this one up! However it only answers part of my question. I'm still wondering why OnExecution is called on the primary series bar close (30m in my case) rather than the 1-minute secondary series when I'm sending stop/limit orders to the 1-minute one. Any help whether it's a bug or wrong configuration on my part will be much appreciated.

            Cheers,
            Ipso

            Comment


              #7
              Hello,

              Sure.

              They would execute on both time frames. Whichever would trigger the order first.

              Also, make sure you are using the BIP filtering to submit your orders.

              -Brett
              BrettNinjaTrader Product Management

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by vivekniwas, Today, 11:31 AM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_Heath  
              Started by Austiner87, Yesterday, 04:59 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by rlcheny, Today, 10:38 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Tyler  
              Started by JAtrades, Today, 05:38 AM
              5 responses
              24 views
              0 likes
              Last Post rlcheny
              by rlcheny
               
              Started by RobotSyndicate, Today, 08:27 AM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X