{LONG
EXIT}
LongEntry:= {this your entry system, eg.
Cross(CLOSE, Mov(C,20,E))};
MoneyMgmtStop:= {this is your maximum
loss, in points};
{DEFINE
ENTRY PRICE, WITH EXIT BEING -ENTRY
PRICE AND NO TRADE BEING 0}
EntryPrice:= If(PREV <= 0,
{Trade entered today?}
If(LongEntry, CLOSE, 0),
{Trade entered before today. Stopped
today?}
If(LOW <= PREV - MoneyMgmtStop, -PREV,
If(LOW <= HighestSince(1,PREV=0,
HIGH) - 3 * ATR(10), -PREV,
If(LOW <= HighestSince(1,PREV=0,
CLOSE) - 2.5 * ATR(10), -PREV, PREV))));
{EXIT IF ENTRY PRICE < 0 (MEANING
EXIT)}
EntryPrice < 0
{SHORT EXIT}
ShortEntry:= {this your entry system,
eg. Cross(Mov(C,20,E), CLOSE)};
MoneyMgmtStop:= {this is your maximum
loss, in points};
{DEFINE
ENTRY PRICE, WITH EXIT BEING -ENTRY
PRICE AND NO TRADE BEING 0}
EntryPrice:= If(PREV <= 0,
{Trade entered today?}
If(ShortEntry, CLOSE, 0),
{Trade entered before today. Stopped
today?}
If(HIGH >= PREV + MoneyMgmtStop, -PREV,
If(HIGH >= LowestSince(1,PREV=0, LOW)
+ 3 * ATR(10), -PREV,
If(HIGH >= LowestSince(1,PREV=0,
CLOSE) + 2.5 * ATR(10), -PREV,
PREV))));
{EXIT IF ENTRY PRICE < 0 (MEANING
EXIT)}
EntryPrice < 0
|