Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to detect "Entered internal SubmitOrderManaged()"

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

    How to detect "Entered internal SubmitOrderManaged()"

    Hi,

    I am using this function :

    protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time){

    if (execution.Order.OrderState == OrderState.Filled){

    if(execution.Order.Name == Long_Entry_Name){
    ...my commands;
    }

    ...

    But sometimes "my commands" get executed whereas they should not.

    In the output I see :

    6/26/2019 6:20:00 PM Strategy 'ON_V4_SIM/167471567': Entered internal SubmitOrderManaged() method at 6/26/2019 6:20:00 PM: ...
    6/27/2019 8:39:00 AM Strategy 'ON_V4_SIM/167471567: Cancelled pending exit order, since associated position is closed, ....

    (Tested on 6/27/2019 after 11:00 AM)

    I would like to not execute "my commands" when the strategy enters in internal SubmitOrderManaged()

    How could I do that?

    Thanks

    #2
    Hello Vincere,

    If your commands were executed, that would indicate the logic was called. Based on what you provided, that would be if an execution happened.

    Did an execution happen?

    The sample provided does not contain enough information to really answer the question. In this situation it would be helpful to add Print statements to find out what specifically is happening surrounding this syntax. Something like the following may be helpful in combination with the other data you see.

    Code:
    Print(execution.Order.ToString());
    
    if (execution.Order.OrderState == OrderState.Filled){
    
    if(execution.Order.Name == Long_Entry_Name){
    Print("Calling commands, condition true");
    ...my commands;
    }

    The message says an exit order was closed, is the sample you provided surrounding exit logic?

    do you have any methods which exit being called from OnBarUpdate or other areas in the script? This would include the Exit methods or SetStopLoss/ProfitTarget methods.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    131 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X