1,425 bytes added,
22:55, 27 February 2017 Closes out the entire position or the entry if it is at the breakeven point after the profit has reached the specified tick value; generates the appropriate Stop order depending on whether the position is long or short.
[[SetStopPosition]] and [[SetStopContract]] or [[SetStopShare]] functions determine whether single SetBreakEven_pt order will be applied to the entire position or multiple SetBreakEven_pt orders will be applied to each entry in position individually; by default, SetBreakEven_pt is applied to the entire position.
SetBreakEven_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>SetBreakEven_pt(Profit)</syntaxhighlight>
Where:
:'''Profit''' - a numerical expression, specifying the amount of the profit in ticks that must be reached first
==Notes==
This function can only be used in signals.
SetBreakEven_pt function does not factor in commissions or slippage.
==Example==
Generate an exit order for the entire position if it is at the breakeven point after position profit has reached 50 ticks:
<syntaxhighlight>SetStopPosition;
SetBreakEven_pt(50); </syntaxhighlight>
Generate an exit order for the entry if it is at the breakeven point after per entery profit has reached 10 ticks:
<syntaxhighlight>SetStopContract;
SetBreakEven_pt(10); </syntaxhighlight>
[[Category:Strategy Orders]]