antondmt

Simple/Compounded Returns & Drawdowns Table

Very excited to bring this script to the public. This is a very useful table that displays the performance of any strategy you give it in a more detailed view. It runs on all timeframes and at any position on the chart with the replay function. It also updates on tick changes. The table consists of three modes: Simple Equity, Compound Equity and Drawdown.

Simple Equity – shows the change in equity for every month and year. It is calculated by finding the difference in initial equity at the beginning of the month/year and the end of the month/year. The table will thus display strategy performance in blocks of time that are not correlated. It is an excellent way to see individual month/year performance from start to finish but it may not represent true change in equity over time. For example, let's assume that 100% of equity is used on every trade for simplicity. If a loss of 50% is made in the first month and a profit of 100% is made in the next month, the strategy will show 50% profit for the year. This aggregate value might be helpful to know for testing purposes, but in reality, the account is actually at break-even for the year (Initial Equity * 0.5 * 2 = Initial Equity).

Compound Equity – shows compounded change in equity for every month and year. It is calculated by finding the difference in starting equity when the strategy is run and equity at the end of the month/year. The table will thus display the true strategy performance – compounded equity at the end of each month/year.

Drawdown – shows max drawdown for every month and year. It is calculated by finding the difference between the highest equity achieved for the month/year and the trough in equity for the same month/year. Notice: strategy tester might have a max drawdown value higher than any of the drawdown values in the table. This is because the strategy tester calculates the difference between the highest and lowest equity for the entire strategy, whereas the table displays drawdowns for months and years only. Sometimes, the max drawdown for the year will also be the max drawdown for the entire strategy; hence the two values will be the same.

To use this table with your own strategy, simply find "PLACE YOUR STRATEGY CODE HERE" at the bottom of the script and place your strategy code there. Special thanks to QuantNomad for the inspiration. As always, please let me know if there are any bugs or if you need some help. Leave a like if you wish!

Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?