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

Chandelier Exit based on system entries



PureBytes Links

Trading Reference Links

Got a fair number of requests for this so here it is. This is
the chandelier exit as an indicator that starts automatically
at your system entries. It allows you to visually compare your
exits to what the Chandelier would have done.

Background - I coded this after there was a flurry of discussion
about it some years back. Chuck LeBeau has more information at his
site - traderclub.com - and he calls it "extremely effective".
I did not find this to be the case and I do not use it. So this
is for educational purposes only.

The major value of this is it is a nice example of coding an
indicator that starts/stops at system entries/exits.

TT


{Chandelier Exit Sys  - TT 12/10/98}

{ This version is for system trading - plots based on your system entries}
{Suggested settings -  ShortExit: cyan, LongExit: red, style: point, weight:
medium}

Input:      Fac(3.5),         {True range multiplier}
            ATRLen(10);       {Length of average}

Vars:       MaxTradeHigh(0),  {Highest High since entry}
            MinTradeLow(0),   {Lowest Low since entry}
            MP(0),            {Market position}
            MaxChand(0),      {Chandelier exit var}
            MinChand(0)       {Chandelier exit var};

MP = I_MarketPosition;        {Get market position}

if MP <> 1 then MaxTradeHigh = -999999;
if MP <> 1 then MaxChand = -999999;
if H>MaxTradeHigh[1] then MaxTradeHigh=H;
if MP=1 and (MaxTradeHigh -Fac*Average(TrueRange,ATRLen)) > MaxChand then
      MaxChand= (MaxTradeHigh -Fac*Average(TrueRange,ATRLen));
if MP =1 then Plot1(MaxChand,"LongExit");

if MP <> -1 then MinTradeLow = 999999;
if MP <> -1 then MinChand = 999999;
if L<MinTradeLow[1] then MinTradeLow=L;
if MP=-1 and (MinTradeLow +Fac*Average(TrueRange,ATRLen)) < MinChand then
      MinChand= (MinTradelow +Fac*Average(TrueRange,ATRLen));
if MP = -1 then Plot2(MinChand,"ShortExit");