Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

order cancelled

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

    order cancelled

    Hello,

    I observe some of my orders are cancelled.and being replaced by a new position.
    I don't know why because I make sure that postition.quantity=0 (means there is not any current trade executing) before taking a new position. Here's my code :

    if(count_higher_high>=2 && current_trend=="bearish" && Position.Quantity==0)

    {
    EnterLongStopLimit(High[1]+ticksize,High[1]+ticksize,@"long_seb");
    }

    Any suggestions?
    Thanks,
    gotham

    #2
    Hello gotham,

    I would recommend printing the time of the bar and all values used in the conditions that place orders.

    Enable TraceOrders, and print the order object in OnOrderUpdate().

    Below is a link to a forum post that demonstrates.


    Save the output to a text file and I will be happy to assist with analyzing the output.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    46 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    33 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X