Created page with "Allowing or forbidding the signal script to exit multiple time from the same entry using only 1 line to exit. == Usage == [SameExitFromOneEntryOnce = LogicalValue]</syntaxh..."
Allowing or forbidding the signal script to exit multiple time from the same entry using only 1 line to exit.
* [[:Category:Attributes|Attributes]] like the ''SameExitFromOneEntryOnce '' statement are applied at the time of compilation and cannot be changed at run-time.
== Example ==
To exit partially from a position opened with a single entry order there are 2 ways:
You can divide your script into 3 separate exit lines:
<syntaxhighlight>if (time = 430) then buytocover ("BC1") 5 contracts next bar at X stop;
if (time = 431) then buytocover ("BC2") 5 contracts next bar at X stop;
if (time = 432) then buytocover ("BC3") 5 contracts next bar at X stop;</syntaxhighlight>
You can use [SameExitFromOneEntryOnce = false] in the beginning of the script to use only 1 line for exiting multiple times from the same entry:
<syntaxhighlight>[SameExitFromOneEntryOnce = false]
if (time >= 430) then buytocover ("BC") 5 contracts next bar at X stop;</syntaxhighlight>