• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Captain Jack, Today, 02:53 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by samatron, Today, 09:49 PM
    0 responses
    4 views
    0 likes
    Last Post samatron  
    Started by johnnybegoode, Today, 08:55 PM
    0 responses
    2 views
    0 likes
    Last Post johnnybegoode  
    Started by yrch1985, 11-03-2019, 11:49 AM
    8 responses
    102 views
    0 likes
    Last Post aligator  
    Started by Dr3am, Today, 05:10 PM
    0 responses
    3 views
    0 likes
    Last Post Dr3am
    by Dr3am
     
    Working...
    X