• 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 edunwa, Today, 04:11 PM
    0 responses
    2 views
    0 likes
    Last Post edunwa
    by edunwa
     
    Started by yeshujbp, Today, 02:40 PM
    0 responses
    7 views
    0 likes
    Last Post yeshujbp  
    Started by Venom, Today, 01:05 PM
    0 responses
    10 views
    0 likes
    Last Post Venom
    by Venom
     
    Started by Dert66, Today, 12:11 PM
    0 responses
    7 views
    0 likes
    Last Post Dert66
    by Dert66
     
    Started by jjanguda, Today, 10:04 AM
    0 responses
    225 views
    0 likes
    Last Post jjanguda  
    Working...
    X