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:	168
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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        72 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X