Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Entry Order

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

    Trailing Entry Order

    Trailing Entry Order

    Hi,
    I would like to code an Entry limit order to trail the highest High of the last three bars by X number of ticks.

    myEntryLongOrder = EnterLongLimit(0, true, DefaultQuantity, MAX(High,3)[0] - 4 * TickSize, "LongSignal");
    barNumberofLongOrder = CurrentBar;

    When the limit order is activated by the prescribed conditions it does not trail the high. It simply remains static.

    Note two things: I set Live until cancel to true because I wanted the order to remain until it is filled sometime after the signal bar closed.

    Second, the signal bar is unique and the bars after it do not meet the trigger conditions.

    Any insight would be appreciated.

    #2
    Hello jeddy0510,

    Thank you for your post.

    The order would need to be re-submitted on each OnBarUpdate() call as the MAX(High,3)[0] - 4 * TickSize value is only valid for the first submission. You will want to check this value on each OnBarUpdate() in the order submission method you are using in order to create a true trailing entry order.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    35 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    130 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    184 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    95 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    138 views
    0 likes
    Last Post cmoran13  
    Working...
    X