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


          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

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by jeronymite, 04-12-2024, 04:26 PM
              2 responses
              29 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by Mindset, 05-06-2023, 09:03 PM
              10 responses
              263 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by michi08, 10-05-2018, 09:31 AM
              5 responses
              742 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by The_Sec, Today, 02:29 PM
              0 responses
              4 views
              0 likes
              Last Post The_Sec
              by The_Sec
               
              Started by tsantospinto, 04-12-2024, 07:04 PM
              4 responses
              63 views
              0 likes
              Last Post aligator  
              Working...
              X