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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    87 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    92 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    70 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    87 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    64 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X