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

Channel exit



PureBytes Links

Trading Reference Links

As people have mentioned before, it is difficult to design exits in
MetaStock because of the awkwardness of defining your trade entry price.
One exit system that requires your trade entry price is the channel exit.

For those not familiar with it, the channel exit is quite a straight forward
trailing stop. Once you're in a trade (let's say, long), you maintain your
stops at the lowest low of the past number of days (optimized, in the code
below) until you are taken out of the market.  This method attempts to let
profits run in the direction of the trend, but takes you out when price
makes a significant reversal and you risk giving back profits on a
retracement or the end of the trend.

Below is the code for a channel exit.  It also includes a money management
stop to limit losses to an acceptable level until the channel exit exceeds
it.  Work on variations of this basic theme, such as moving the stop up
faster where the market makes rapid gains and your lowest low in, say, 10 or
20 days is just too far away to adequately protect profits.

Hope this helps.


{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 <= Max(PREV - MoneyMgmtStop, Ref(LLV(LOW,opt1),-1)), -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 >= Min(PREV + MoneyMgmtStop, Ref(HHV(HIGH,opt1),-1)), -PREV,
PREV));

{EXIT IF ENTRY PRICE < 0 (MEANING EXIT)}
EntryPrice < 0