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 lorem, Yesterday, 09:18 AM
    3 responses
    13 views
    0 likes
    Last Post lorem
    by lorem
     
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    12 responses
    42 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by FrazMann, Today, 11:21 AM
    0 responses
    5 views
    0 likes
    Last Post FrazMann  
    Started by geddyisodin, Yesterday, 05:20 AM
    8 responses
    52 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by DayTradingDEMON, Today, 09:28 AM
    4 responses
    27 views
    0 likes
    Last Post DayTradingDEMON  
    Working...
    X