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:	33
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.
    https://ninjatrader.com/support/help...gstoplimit.htm

    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?
        https://ninjatrader.com/support/help...thod_to_ca.htm

        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 WNorton, Today, 11:23 AM
        0 responses
        1 view
        0 likes
        Last Post WNorton
        by WNorton
         
        Started by stafe, Today, 10:43 AM
        0 responses
        8 views
        0 likes
        Last Post stafe
        by stafe
         
        Started by UltraNIX, Today, 09:13 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Tuxstuff215, Today, 06:32 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by carlot, Today, 08:10 AM
        2 responses
        21 views
        0 likes
        Last Post carlot
        by carlot
         
        Working...
        X