Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

issue with cancelling order.

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

    issue with cancelling order.

    if (StratState == 2 && Close[0] > Silver_Stop)
    {
    EnterLongStopLimit(0, false, 1, Entry_Sig_High, Entry_Sig_High, "Gold_" + CurrentBar);
    EnterLongStopLimit(0, false, 1, Entry_Sig_High, Entry_Sig_High, "Silver_" + CurrentBar);
    SetProfitTarget("Silver_" + CurrentBar, CalculationMode.Price, Silver_Goal);
    SetProfitTarget("Gold_" + CurrentBar, CalculationMode.Price, Gold_Goal);
    SetStopLoss(CalculationMode.Price, Silver_Stop);
    }

    from my understanding, since I have live until canceled as false, these 2 enter long limits should stay active until the IF statement is no longer true. so in this case, as soon as the close price moves bellow the silver stop (red diamond in image) but as you can see it stays active and just waits for the price to rise up to the entry (green diamond). what can I do to have this order vanish as soon as price dips bellow the stop diamond before hitting the entry diamond?
    Click image for larger version

Name:	cancelorder.jpg
Views:	177
Size:	94.5 KB
ID:	1116129

    #2
    Hello CoffeeOutlaw,

    The isLiveUntilCancelled parameter should be true for the order to remain live until it is cancelled or filled. When false the order will automatically cancel when the submission bar closes.


    I also recommend calling set methods before placing the entry order (as these cannot be unset).
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea, I still am having no luck getting these orders to cancel even when I load up the sample strategy "Sample Cancel Order" the orders still don't cancel. from looking at that code it seems that it should cancel the order named "Long Limit Entry" after 3 bars and replace it with one called "market order" but looking back thru a lot of past data with that script I have zero "market orders" and all my filled orders are the "long limit entry" it seems that nothing I can do even running the sample scripts will make it cancel an order

      Comment


        #4
        Hello CoffeeOutlaw,

        Are you referring to this reference sample in the help guide?


        Are you looking at the Strategy Performance window for Historical & Real-time on the Orders display and confirming no orders are cancelled? (This cancels the entry if not filled in 3 bars)

        I've tested on my end and I am seeing tons of cancelled orders.
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        87 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        132 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        118 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        67 views
        0 likes
        Last Post PaulMohn  
        Working...
        X