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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    56 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X