SetTrailingStop pt

From MultiCharts
Jump to: navigation, search

Closes out the entire position or the entry if the current profit is less than the maximum profit by the specified amount; generates the appropriate Stop order depending on whether the position is long or short. For example, if the specified amount is 50 ticks and the profit has reached the maximum of 120 ticks, the position will be closed once the profit drops to 70 ticks.

SetStopPosition and SetStopContract or SetStopShare functions determine whether SetTrailingStop_pt will be applied to the entire position or to each entry in position individually; by default, SetTrailingStop_pt is applied to the entire position.

SetTrailingStop_pt function is evaluated intra-bar and not only on close of a bar, and can exit within the same bar as the entry.

Usage

SetTrailingStop_pt(Amount)

Where:

Amount - a numerical expression, specifying the tick value of the maximum loss of profit in ticks.

Notes

This function can only be used in signals.

SetTrailingStop_pt function does not factor in commissions or slippage.

Example

Generate an exit order for the entire position if position profit drops by 50 ticks:

SetStopPosition; 
 
SetTrailingStop_pt(50);

Generate an exit order for the entry if per entry profit drops by 10 ticks:

SetStopContract; 
 
SetTrailingStop_pt(10);