Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecution and OnOrderUpdate

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

    OnExecution and OnOrderUpdate

    Hi,

    I'm using the above methods for exiting existing orders. Since I want to melt two strategies; I need to filter incoming orders by their entries they belong to.
    I tried for incoming order events:

    Code:
    protected override void OnOrderUpdate(IOrder order)
            {
                
                if (entryOrder != null && entryOrder == order && entryOrder.FromEntrySignal == "entry long DP13")
    and for incoming executions:

    Code:
     protected override void OnExecution(IExecution execution)
            {
               
                if (entryOrder != null && entryOrder == execution.Order && entryOrder.FromEntrySignal == "entry long DP13")
    and for resetting orders after being closed:

    Code:
    if ((stopOrder != null && stopOrder == execution.Order && stopOrder.FromEntrySignal == "entry long DP13"
                    ) || (targetOrder != null && targetOrder == execution.Order && targetOrder.FromEntrySignal == "entry long DP13"))
    but obviously it's not the right way to do it. How to identify order objects by their entry signal string?

    #2
    Hello Stephan123,

    Thank you for your post.

    If you are trying to call the order that is an entry it will not have a FromEntrySignal attached. You will want to use execution.Name and then the name of the order.

    For information on the IOrder properties please visit the following link: http://www.ninjatrader.com/support/h...nt7/iorder.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X