×

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.

Difference between revisions of "SameExitFromOneEntryOnce" - MultiCharts
Open main menu

Difference between revisions of "SameExitFromOneEntryOnce"

(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...")
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Allowing or forbidding the signal script to exit multiple time from the same entry using only 1 line to exit.  
+
Allowing or forbidding the signal script to exit multiple times from the same entry using only 1 line to exit.  
 
   
 
   
 
== Usage ==
 
== Usage ==
[SameExitFromOneEntryOnce = LogicalValue]</syntaxhighlight>  
+
<syntaxhighlight> [SameExitFromOneEntryOnce = LogicalValue]</syntaxhighlight>  
  
 
Where:  
 
Where:  

Latest revision as of 16:08, 5 October 2018

Allowing or forbidding the signal script to exit multiple times from the same entry using only 1 line to exit.

Usage

 [SameExitFromOneEntryOnce = LogicalValue]

Where:

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

Notes

  • 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:

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;

You can use [SameExitFromOneEntryOnce = false] in the beginning of the script to use only 1 line for exiting multiple times from the same entry:

[SameExitFromOneEntryOnce = false]
if (time >= 430) then buytocover ("BC") 5 contracts next bar at X stop;