chandelier exit for amibroker

November 10, 2008 | The next 60 posts are a glossary of backtesting terms.   I wrote them in blog form, so each post has an associated creation date.    I may edit these definitions over time but will keep the initial dates so that the definitions stay in alphabetical order. I use the term Active Investor to identify people who manage their market positions.  An active investor not only investigates a stock before buying, but also considers when and why they might sell.    This distinguishes the active investor from the passive investor.  The latter often simply invests in a market index, and whatever they buy, they set out to keep • Read More » An Adverse Excursion is the amount that a trade goes in the wrong direction after entry and before exit.   The Maximum Adverse Excursion (MAE) is the worst over the life of the trade. For example, say a stock is bought at $30, then drops to $28 before rising to $38 then settling back to an exit at $35.  
The • Read More » Tags: exit, productivity, trading ATR Trailing Stop Definition The ATR Trailing Stop is one way to limit losses and protect profits. A stop loss order is set a multiple of the Average True Range (ATR) away from the current stock price. As the price moves in the trade’s favor, the stop rachets along with, always calculated from a better closing prices and never from worse • Read More »chandelier pokemon smogon Tags: Alexander Elder, ATR, backtesting, chandelier Chuck LeBeau, exit, long, stop, stop loss, strategy, TradeStation, trading, Volatilitychandelier szótár Average True Range Definitionchandelier padd The Average True Range (ATR) is a measure of a stock’s volatility.   The idea is to take the day’s range from low to high, including gaps from the previous day and average that range across several days.
The ATR was first described by Welles Wilder in New Concepts in Technical Trading Systems. Extra Insight: The • Read More » Tags: ATR, Welles Wilder Avg Hold is also known as the average holding time.   The holding time is the length of time that the trade is open.   The average is taken across all the trades which resulted from backtesting a particular strategy. The average holding time is measured on the same scale as the chart time scale.    Since I am backtesting on daily • Read More » Tags: avg hold, backtesting, productivity November 6, 2008 | Backtesting is the process of checking a trading strategy by applying the strategy to historical price data to generate hypothetical trades, then analyzing the results to assess the performance of the trading strategy. The backtesting engine is the most glorified piece of the operation however it would not be successful without clean data, objective trading strateiges, statiscally • Read More »
Tags: backtesting, data, skid, slippage, trading The Backtesting Engine is the core software doing the backtest.  It takes as inputs the historical price data and trading strategies. The backtesting engine applies the trading strategies to the historical price data to get a series of hypothetical trades and records the results. The outputs of the backtesting engine are typically performance statistics.    I have added instrumentation to gather • Read More » Tags: Amibroker, backtesting, data, instrumentation, TD Ameritrade, TradeStation, trading, WealthLab, Worden Blocks Backscanner Click here to download the baseline issue of BackTesting Report free without registration.   The Baseline is the backtesting results from a very simple trading strategy.  We use this as a basis for comparision.   We do this to weed out the trading strategies that look good because they happened by chance to be in sync with the market over the test period.   Instead we want to find • Read More »
Tags: baseline, data, expectancy, monte carlo, trading, win rate Most mutual funds quote their performance versus a benchmark — an index which most closely represents the holdings of the fund. Extra Insight: Grading a manager solely on performance versus the benchmark is known as relative returns.    This allows managers to quote that they beat the market when the merely lost less than their benchmark • Read More » Tags: backtesting, baseline, dataA while ago, I used a quote from Winton manager and trend Follower David Harding (found in this interview) saying: If you put in stops and run your profits and trade randomly you make money; and if you put in targets and no stops, and you trade randomly you lose money. So the old saw about cutting losses and running profits has some truth to it. The quote was used to illustrate a post stating that a large driver of Trend Following returns is based on the mechanics of those systems (“cut your losses short, let your winners run“) which therefore benefit from the right tail of market return distributions – which are “fatter” than the usually assumed normal distribution – and avoid the left tail.
Like the proverbial dart-throwing monkey? In effect, Harding is saying that entry points do not matter so much: a random entry coupled with a smart exit strategy would make money. I once met with a fund manager, who described his strategy as very similar to that random system in the Harding quote. What was really important to them was the position sizing for each new signal, as well as the exit strategy. The entry signal direction was “irrelevant”. I found this puzzling at the time and have been wanting to test this idea since then, to verify whether a “random trading” system could indeed be profitable. The system tested here is composed of random entries with additional “classic” components: a volatility-based fixed fractional money management and volatility-based trailing stop exits. For this test, I used fairly standard parameter values: The portfolio used for this test is a subset of the one used in the State of Trend Following report, basically all those instruments that I have data for going back to the start of the test: in January 1990 (click for the exact list).
Since this is a random experiment, I generated multiple test outputs (200), all based on the same parameters, and averaged their monthly returns to create a composite equity curve, which performance summary statistics can be seen below: The 2-ATR stop level is somehow an arbitrary choice and I wanted to check whether this bore an impact on the test results. I ran a further test, stepping the ATR-multiple for stop calculation from 2 to 10. Each ATR-multiple set was run 200 times again and averaged to give a composite equity curve. Normalizing these 9 composite equity curves (for equal monthly standard deviation) and averaging them produced a “super-composite” equity curve composed of 2000 random tests (equally split between ATR-multiples ranging from 2 to 10). The performance summary statistics of this “super-random-composite” equity curve are below: Note how the diversification and rebalancing over several ATR-multiple stop levels have a substantial impact on the Max Drawdown and volatility.
Both equity curves are charted below: All in all, not too bad for “monkey-style” trading! It goes to show that signal entries, which most beginning traders/system developers focus so much on, are not so important after all… Update: follow-up post tackling other aspects of randomness in trading systems and clarifying subjects such as averaging and commissions/slippage: Further Musings on Randomness Credits/Additional Reading: The concept of random entries with trailing stops has actually been discussed before. It seems like it was introduced by Van Tharp in his Trade your Way to Financial Freedom book, and mentioned on this article by Chuck Le Beau, where he expands on the concept of “Chandelier Exit” (name for volatility-based trailing stops). Thanks and credits also to user “sluggo” on the Trading Blox forum, who published a similar study four years ago, and some code which I reused most of for this study. Note that his study found an opposite result, showing a turn in profitability (downwards) of random systems after 1997 (portfolio and parameter values are different though), so you might want to run your own test to verify this concept for yourself…