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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    639 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    572 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X