SameExitFromOneEntryOnce

From MultiCharts
Revision as of 16:08, 5 October 2018 by Abeloglazova (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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;