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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    39 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    289 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    289 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    135 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    96 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X