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 llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Working...
    X