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

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by frslvr, 04-11-2024, 07:26 AM
    7 responses
    109 views
    1 like
    Last Post caryc123  
    Started by rocketman7, Today, 09:41 AM
    3 responses
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by traderqz, Today, 09:44 AM
    2 responses
    4 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by stafe, 04-15-2024, 08:34 PM
    8 responses
    41 views
    0 likes
    Last Post stafe
    by stafe
     
    Started by rocketman7, Today, 02:12 AM
    7 responses
    31 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X