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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    47 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    15 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X