Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitOrders do not work

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

    ExitOrders do not work

    Hello,

    I would like to ask for help with programing of exit orders ExitStopLimit and ExitStopLoss, I have programmed simple strategy, but when i run it in chart, i realized it does not work properly

    In my strategy i placed EnterLongStop order

    Code:
    entryOrderLong = EnterLongStop(0, false, 1, High[0] + 1 *  TickSize, "LONG");
    and in OnOrderUpdate block i have added stop and limit order

    Code:
    exitLimitLong = ExitLongLimit(0, true, 1,  entryOrderLong.AvgFillPrice + 100 * TickSize, "PROFIT  TARGET",entryOrderLong.FromEntrySignal);
                    
    exitStopLong = ExitLongStop(0, true, 1,  entryOrderLong.AvgFillPrice - 100 * TickSize, "STOP LOSS",  entryOrderLong.FromEntrySignal);
    When i enter in a position i want to place stoploss 100 ticks bellow entry and profit target 100 ticks above my entry. The problem is, when i run strategy (e.g. futures ZS/ZC) on a chart, sometimes it ommits my exit orders. I enter in a trade but my exit orders does not trigger, or they trigger but with totally wrong data...

    Confusing is that sometimes exitorders works, but sometimes do not work :s I have attached image of this issue in chart.

    Is there any mistake in my code? Could somebody help pls?

    Thank you

    Filip
    Attached Files

    #2
    ok problem fixed

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    156 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    90 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    138 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X