Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

OnExecutionUpdate Callback Called before SubmitOrderUnmanaged Returns

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

    OnExecutionUpdate Callback Called before SubmitOrderUnmanaged Returns

    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
    Last edited by reach4thelasers; 02-12-2017, 03:43 PM.

    #2
    Hello reach4thelasers,

    Thank you for your patience.

    You would want to assign the order object in OnOrderUpdate() rather than assigning the object in OnBarUpdate. Please refer to the example at the following link: http://ninjatrader.com/support/helpG...rderupdate.htm

    Please let me know if you continue to see this behavior when assigning the order object in OnOrderUpdate.

    Comment


      #3
      Hey Thanks for the assistance... ok.. That explains it. So I need to hook into the OnOrderUpdate event, and identify the order based on the Name property, which is the signal name? Is that correct?

      Is there another way than using Signal names? because my signal names are not unique at present, but I could make them if necessary.

      Comment


        #4
        Originally posted by reach4thelasers View Post
        Hey Thanks for the assistance... ok.. That explains it. So I need to hook into the OnOrderUpdate event, and identify the order based on the Name property, which is the signal name? Is that correct?

        Is there another way than using Signal names? because my signal names are not unique at present, but I could make them if necessary.
        Thank you for your response, reach4thelasers,

        That would be correct, you would need to use the signal name strings given to the orders when calling their function (EnterLong() for example).

        Please let me know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by firefoxforum12, Yesterday, 08:53 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by kmunroe478, Yesterday, 05:39 PM
        2 responses
        14 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by kevinenergy, 02-17-2023, 12:42 PM
        115 responses
        2,699 views
        1 like
        Last Post kevinenergy  
        Started by prdecast, Today, 06:07 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Christopher_R, Today, 12:29 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X