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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    46 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X