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 Pattontje, Yesterday, 02:10 PM
        2 responses
        14 views
        0 likes
        Last Post Pattontje  
        Started by flybuzz, 04-21-2024, 04:07 PM
        17 responses
        229 views
        0 likes
        Last Post TradingLoss  
        Started by agclub, 04-21-2024, 08:57 PM
        3 responses
        17 views
        0 likes
        Last Post TradingLoss  
        Started by TradingLoss, 04-21-2024, 04:32 PM
        4 responses
        43 views
        2 likes
        Last Post TradingLoss  
        Started by cre8able, 04-17-2024, 04:16 PM
        6 responses
        56 views
        0 likes
        Last Post cre8able  
        Working...
        X