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

ELA code question on trailing stops for channel



PureBytes Links

Trading Reference Links

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