1,306 bytes added,
23:00, 27 February 2017 Closes out the entire position or the entry if profit reaches the specified tick value; generates the appropriate Limit exit order depending on whether the position is long or short.
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether single profit target order will be applied to the entire position or multiple SetProfitTarget_pt orders will be applied to each entry in position individualy; by default, profit target is applied to the entire position.
SetProfitTarget_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==
<syntaxhighlight>SetProfitTarget_pt(Amount)</syntaxhighlight>
Where:
:'''Amount''' - a numerical expression, specifying the profit target amount in ticks.
==Notes==
This function can only be used in signals.
SetProfitTarget_pt function does not factor in commissions or slippage.
==Example==
Generate an exit order for the entire position if the position profit reaches 100 ticks:
<syntaxhighlight>SetStopPosition;
SetProfitTarget_pt(100); </syntaxhighlight>
Generate an exit order for the entry if the profit per entry reaches 10 ticks:
<syntaxhighlight>SetStopContract;
SetProfitTarget_pt(10); </syntaxhighlight>
[[Category:Strategy Orders]]