[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: more ela code questions



PureBytes Links

Trading Reference Links

Andy,

The following code should do the trick.  I'm not sure if you want to work
off the close or the high (low) for the entry.

Paul


Inputs: Length(20);

Vars: TrailStop(0);

TrailStop = Highest(High,Length) - Lowest(Low,Length);

{Entries}
If Close > Highest(Close,Length)[1] then Buy ("BrkOut LE") next bar at open;
If Close < Lowest(Close,Length)[1] then Sell ("BrkOut SE") next bar at open;

{Exits}
If MarketPosition = 1 then begin
   ExitLong ("TrailStop LX") at Highest(High,Length) - TrailStop on stop;
end;
If MarketPosition = -1 then begin
   ExitShort ("TrailStop SX") at Lowest(Low,Length) + TrailStop on stop;
end;

-----Original Message-----
From:	Andy Dunn [mailto:andy@xxxxxxxx]
Sent:	Wednesday, 18 November 1998 07:53
To:	omega-list@xxxxxxxxxx
Subject:	more ela code questions

I have written Omega ela support about 5 times on this one and they can't
seem to get it correct...perhaps some of you ela gurus can help...I am
looking for the code for a break-out system, and the stop is the distance
between the highest high and lowest low the day before the trade. So Richard
Donchian 20 day break out with a trailing stop that essentially has the
volatility of the last X days built in

- go LONG tomorrow at open on a breakout of the last 20 days
- a trailing stop that is the difference between the highest high and lowest
low for the last 20 days