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

Fw: ELA code question on trailing stops for channel



PureBytes Links

Trading Reference Links



>Here you go !
>
>input:fac(1.7),exit(1);
>
>var:ts(0),tl(0);
>
>
>tl=Lowest(low,length/fac)-exitx;
>ts=Highest(high,length/fac)+exitx;
>
>condition5=marketposition=1;
>condition6=marketposition=-1;
>
>
>if condition5 then exitlong("TrailLongExitStop")tl stop;
>If condition6 then exitshort("TrailShortExitStop")ts stop;
>
>
>
>
>
>
>-----Original Message-----
>From: Andy Dunn <andy@xxxxxxxx>
>To: omega-list@xxxxxxxxxx <omega-list@xxxxxxxxxx>
>Date: Wednesday, October 07, 1998 5:46 PM
>Subject: ELA code question on trailing stops for channel
>
>
>>Let's say you are trading a basic "break-out" system and you want to trail
>the entry with a stop as wide as the channel...how do I write this??
>>
>>here is the system
>>
>>Input: Length(10);
>>IF CurrentBar > 1 and Close > Highest(High,Length)[1] Then Buy on Close;
>>IF CurrentBar > 1 and Close < Lowest(Low,Length)[1] Then Sell on Close;
>>
>>let's say the highest high is "40"
>>and the lowest low is "20"
>>
>>and I get into a long trade
>>what is the code to trail that upward at the width of the channel on
>entry...so if it goes to 70 and then down to 45, you would get stopped out
>at 50.
>>
>>
>>any help would be appreciated.
>>
>>thanks
>>
>>Andy
>>
>>
>