SetTrailingStop pt: Difference between revisions
From MultiCharts
no edit summary
(→Usage) |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
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. | 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 | 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. | [[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. | ||
Line 22: | Line 22: | ||
SetStopPosition; | SetStopPosition; | ||
SetTrailingStop_pt(50); </syntaxhighlight> | |||
Generate an exit order for the entry if per entry profit drops by 10 ticks: | Generate an exit order for the entry if per entry profit drops by 10 ticks: | ||
Line 28: | Line 28: | ||
SetStopContract; | SetStopContract; | ||
SetTrailingStop_pt(10); </syntaxhighlight> | |||
[[Category:Strategy Orders]] | [[Category:Strategy Orders]] |