×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

SameExitFromOneEntryOnce

1,173 bytes added, 15:48, 7 June 2013
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.

== Usage ==
[SameExitFromOneEntryOnce = LogicalValue]</syntaxhighlight>

Where:

:'''LogicalValue''' - a true/false value: [[True]] = Forbid; [[False]] = Allow.

== Notes ==

* [[: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>

[[Category:Attributes]]