Changes
Jump to navigation
Jump to search
Created page with "Closes out the entire position or the entry if profit reaches the specified currency value; generates the appropriate Limit exit order depending on whether the position is lon..."
Closes out the entire position or the entry if profit reaches the specified currency value; generates the appropriate Limit exit order depending on whether the position is long or short.
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether the profit target will be applied to the entire position or to each contract or share individualy; by default, profit target is applied to the entire position.
SetProfitTarget 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(Amount)</syntaxhighlight>
Where: [[Amount]] - a numerical expression, specifying the profit target amount
==== Notes ====
This function can only be used in signals.
==== Example ====
<syntaxhighlight>Generate an exit order for the entire position if the position profit reaches $100:
SetStopPosition;
SetProfitTarget(100);
Generate an exit order for the entry if the profit per contract reaches $10:
SetStopContract;
SetProfitTarget(10);</syntaxhighlight>
[[Category:Strategy Orders]]
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether the profit target will be applied to the entire position or to each contract or share individualy; by default, profit target is applied to the entire position.
SetProfitTarget 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(Amount)</syntaxhighlight>
Where: [[Amount]] - a numerical expression, specifying the profit target amount
==== Notes ====
This function can only be used in signals.
==== Example ====
<syntaxhighlight>Generate an exit order for the entire position if the position profit reaches $100:
SetStopPosition;
SetProfitTarget(100);
Generate an exit order for the entry if the profit per contract reaches $10:
SetStopContract;
SetProfitTarget(10);</syntaxhighlight>
[[Category:Strategy Orders]]