Difference between revisions of "SameExitFromOneEntryOnce"
Jump to navigation
Jump to search
(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...") |
(→Usage) |
||
Line 2: | Line 2: | ||
== Usage == | == Usage == | ||
− | [SameExitFromOneEntryOnce = LogicalValue]</syntaxhighlight> | + | <syntaxhighlight> [SameExitFromOneEntryOnce = LogicalValue]</syntaxhighlight> |
Where: | Where: |
Revision as of 15:49, 7 June 2013
Allowing or forbidding the signal script to exit multiple time from the same entry using only 1 line to exit.
Usage
[SameExitFromOneEntryOnce = LogicalValue]
Where:
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;