• 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

OnExecutionUpdate Callback Called before SubmitOrderUnmanaged Returns

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

    OnExecutionUpdate Callback Called before SubmitOrderUnmanaged Returns

    Posted this in the NT7 Section by Mistake.

    When the attached strategy is run on a Playback Connection, the OnExecutionUpdate Callback fires before the SubmitOrderUnmanaged Method returns a reference to the order.

    I've added Trace output lines to illustrate this.

    Connected to Playback the output is:
    Code:
    ***OnExecutionUpdate method called, long stop entry is: null
    Assigned the longStopEntry order reference in OnBarUpdate
    and on the simulation feed the output is....

    Code:
    Assigned the longStopEntry order reference in OnBarUpdate
    ***OnExecutionUpdate method called, long stop entry is: orderId='b7f5181a0082428bbf62832870ad183f' account='Sim101' name='longStopEntry' orderState=Filled instrument='GBPNZD' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=1 tif=Gtc oco='5a947726-1531-4bad-84bd-335676a9007e' filled=1 averageFillPrice=1.73219 onBehalfOf='' id=783 time='2017-02-12 21:25:50' gtd='2099-12-01' statementDate='2017-02-12'
    Hopefully you can reproduce this, because I've literally wasted 2 days trying to figure out why my strategy wasn't working right. Before stripping it right back to this and realising that the playback connection was the issue.
    Attached Files

    #2
    Hello reach4thelasers,

    I was able to replicate and have passed this on to development.

    Thank you for bringing this to our attention.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello reach4thelasers,

      To follow up on this ticket, order objects should be assigned in OnOrderUpdate and not in OnBarUpdate.

      Please see OnOrderUpdate section of our helpguide as well as the the attached revised strategy.
      http://ninjatrader.com/support/helpG...rderupdate.htm

      Please let us know if you need further assistance.
      Attached Files
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        Hey Alan,

        this is contrary to all the advice and examples on these forums; as well as the docs.

        ninjatrader.com/support/helpGuides/nt8/en-us/onexecutionupdate.htm?zoom_highlightsub=ExecutionU pdate

        Its also impossible to have multiple positions per strategy using the example you posted. The main reason people want to use Unmanaged orders is to enable us to have multiple entry orders - possibly in opposing directions for breakouts.

        Therefore when each entry order is submitted, we need to get a reference to the order- so that we can manage changes to that order (submitting brackets etc) at a later date. Otherwise there's no way to know which order was filled.

        Regardless of this.... The issue I originally reported was only evident on the SimFeed - live and replay were fine. There's clearly a problem here if the Simulated feed behaves differently to the others....

        Comment


          #5
          Hello reach4thelasers,

          The link you provided assigns an order object in OnExecutionUpdate, which could be done, but it would be best practice to assign in OnOrderUpdate.

          It would not be impossible to have multiple entry orders in the example I provided. You would need to uniquely name another signal name for which you could assign an order object to in OnOrderUpdate and use that order object to manage changes.

          Regarding the original issue, did you correctly assign the order object in OnOrderUpdate?

          I look forward to your reply.
          Alan P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Conall, Today, 06:11 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Kate  
          Started by CaptainAmericaXX, Today, 07:41 AM
          0 responses
          2 views
          0 likes
          Last Post CaptainAmericaXX  
          Started by Longhornmark, Today, 07:06 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by 2sureshk, Today, 07:29 AM
          0 responses
          3 views
          0 likes
          Last Post 2sureshk  
          Started by uday12, Yesterday, 10:26 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X