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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    76 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    45 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    26 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    62 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X