Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Chandelier Exit for Amibroker (AFL)
kaiji
about 14 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 4)
Tags:
oscillator, amibroker

These two forms of the same indicator are designed to act as the Chandelier Exit stop loss as described by Barbara Rockefeller in “Technical Analysis for Dummies”, and is written especially for use with AmiBroker. She describes the Chandelier exit as a dataset of “the highest high or the highest close SINCE YOUR ENTRY.” To allow the Chandelier exit to stop you out it gives you a couple of average-true-ranges (ATRs) from the best price the stock has reached SINCE YOUR ENTRY.

Only you know when your trading rules will dictate that you enter the trade, and so my Chandelier Exit Preview here allows you to preview the Chandelier exit series by clicking on the bar that AmiBroker’s back-test/optimize says you should buy on. If your RSI says buy; on the 1st of June, simply overlay my Chandelier Exit formula onto your price data, and click on the bar corresponding to the 1st of June. The three series named “Chand…” will change each time you click a different bar. Thus when you click the 1st of June bar, you get a Chandelier Exit stop loss especially designed for buying that stock on the 1st of June. The second formula, the Chandelier Exit, is designed to fit into your automated AmiBroker trading formula.

By Jarod Marshall

Similar Indicators / Formulas

Debu Market Efficiency Ratio
Submitted by agent301 over 11 years ago
MACD (new timing)
Submitted by tigernifty over 11 years ago
3 Days Track
Submitted by janet0211 almost 14 years ago
KILL THE OPERATOR MACD
Submitted by prasadmuni over 11 years ago
%R ++
Submitted by reb almost 14 years ago
DMI Spread
Submitted by pipstar almost 14 years ago

Indicator / Formula

Copy & Paste Friendly
/* These two forms of the same indicator are designed to act as the Chandelier
Exit stop loss as described by Barbara Rockefeller in 
"Technical Analysis for Dummies", and is written especially for use with
AmiBroker. She describes the Chandelier exit as a dataset of 
"the highest high or the highest close SINCE YOUR ENTRY." To allow the
Chandelier exit to stop you out gives you a couple of 
average-true-ranges (ATRs) from the best price the stock has reached SINCE YOUR
ENTRY.

Only *you* know when your trading rules will dictate that you enter the trade,
and so my Chandelier Exit Preview here allows you to preview 
the Chandelier exit series by clicking on the bar that AmiBroker?s
back-test/optimize says you should buy on. If your RSI says ?buy? on the 
1st of June, simply overlay my Chandelier Exit formula onto your price data,
and click on the bar corresponding to the 1st of June. The three 
series named "Chand..." will change each time you click a different bar. Thus
when you click the 1st of June bar, you get a Chandelier Exit 
stop loss especially designed for buying that stock on the 1st of June. The
second formula, the Chandelier Exit, is designed to fit into your
automated AmiBroker trading formulae.

Why do all this?.... 1) Adaptive trailing stops allow you to crystallize
profits made. 2) The Chanderlier Exit takes into account when you
bought the stock, making it more relevant. 3) This AmiBroker version allows you
to preview when it would stop you out for any bar that your
trading system tells you. 4) It can be fairly easily integrated into your
automated AmiBroker back-tests and optimizations.

How to integrate it into your personal AmiBroker trading system:

Pretend your "buy" formula is simply [MA(Close, 10) > O] and your "sell"
formula is [MA(Close, 10) < 0] for simplicity. Run a window with 
the MA(Close, 10) graph so you can see when it crosses zero, and place another
window with the price, and overlay with the Chandelier Exit
formula you wish to use. If you use Chandelier Exit Preview, simply click on
each day when the MA(Close, 10) crosses zero, and the appropriate
Chandelier exit lines for the highest High and Close, and lowest Low will
appear. The point of the Preview is that you can click on any day
and see how the Chandelier exit would behave :).

As for the second, Chandelier Exit formula, simply copy your "[MA(Close, 10) >
O]" and use it to replace the <your "buy" criterion>. Then 
go to your Sell criterion and add "OR" then copy the appropriate Graph1, Graph2
or Graph3 depending on whether your Chandelier Exit should
use the highest High (Graph1) or Close (Graph2) or lowest Low (Graph3), in the
form of "OR Cross(Graph1, Close)". If you wish to optimize 
the "ATRPeriods" and "Multiple" paramaters, simply replace "Param" with
"Optimize" and run it through the Automatic Analysis.*/


_SECTION_BEGIN("Chandelier Exit Preview");

YourHold = BarIndex() - SelectedValue(BarIndex()); //How many bars between the selected bar AND each bar following

Multiple = Param("Multiple", 3, 1, 10, 1); //How many ATR?s to be allowed below the Highest High since selected bar
ATRPeriods = Param("ATR Periods", 22, 1, 50, 1); //How many periods to use for the ATR
Graph1 = HHV(Close,YourHold) - (Multiple * ATR(ATRPeriods)); //Chandelier exit line from Highest Close
Graph2 = HHV(High, YourHold) - (Multiple * ATR(ATRPeriods)); //Chandelier exit line from Highest High
Graph3 = LLV(Low, YourHold) + (Multiple * ATR(ATRPeriods)); //Chanderlier exit from Lowest Low (used when going Short)
Plot(Graph1, "ChandClose", ParamColor( "ChandClose Color", colorCycle ),
ParamStyle("ChandClose Style")  );
Plot(Graph2, "ChandHigh", ParamColor( "ChandHigh Color", colorCycle ),
ParamStyle("ChandHigh Style")  );
Plot(Graph3, "ChandLow", ParamColor( "ChandLow Color", colorCycle ),
ParamStyle("ChandLow Style")  );

_SECTION_END();

_SECTION_BEGIN("Chandelier Exit");

YourHold = BarIndex() - ValueWhen(EMA(C,25) > C, BarIndex(), 1);//Replace 'EMA(C,25) > C' with your 'buy' formula

Multiple = Param("Multiple", 3, 1, 10, 1); //How many ATR?s to be allowed below the Highest High since latest "buy" bar
ATRPeriods = Param("ATR Periods", 22, 1, 50, 1); //How many periods to use for the ATR
Graph1 = HHV(Close,YourHold) - (Multiple * ATR(ATRPeriods)); //Chandelier exit line from Highest Close
Graph2 = HHV(High, YourHold) - (Multiple * ATR(ATRPeriods)); //Chandelier exit line from Highest High
Graph3 = LLV(Low, YourHold) + (Multiple * ATR(ATRPeriods)); //Chanderlier exit from Lowest Low (used when going Short)
Plot(Graph1, "ChandClose", ParamColor( "ChandClose Color", colorCycle ),
ParamStyle("ChandClose Style")  );
Plot(Graph2, "ChandHigh", ParamColor( "ChandHigh Color", colorCycle ),
ParamStyle("ChandHigh Style")  );
Plot(Graph3, "ChandLow", ParamColor( "ChandLow Color", colorCycle ),
ParamStyle("ChandLow Style")  );

_SECTION_END();

//<Change your by and sell rules here>
Buy = EMA(C,25) > C;
Sell = EMA(C,25) < C OR Cross(Graph1, Close); //Use the appropriate Graph1, Graph2 OR Graph3 for whichever Chandelier exit you wish

Short = Sell;
Cover = Buy;

_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.

Back