TradingView
antondmt
Dec 6, 2021 2:25 AM

Simple/Compounded Returns & Drawdowns Table 

Bitcoin / TetherUSBinance

描述

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!

评论
RicardoSantos
Thank you for this little pearl, it would be nice if this would be converted into a library, so that it could be used on any strategy ;)
BillionaireLau
@RicardoSantos, FYI you can find the same indicator originated by @QuantNomad which is published 3 months earlier.
(which has 1500+ likes and users have discussed a lot of issues about this indicator there)
Haven't see this guy have gave enough reputation in the script description to the original author, but plagiarism and stealing reputation is violating house rule 4.

This guy trys to mislead people in the script description that this is his original idea. Your response is the evidence that his mislead really worked.
instead, he should points out: what he contributed in this script.
The only difference he made is this script has only added "maximum drawdown" at the top other people's work.
If everyone in the server copy other one's work and change 1% and publish it and steal reputation from other guy, the community would be messy.

Work of @QuantNomad (published in August):
tradingview.com/script/kzp8e4X3-Monthly-Returns-in-PineScript-Strategies/
RicardoSantos
@BillionaireLau, thank you, added a appropriate cheer there, in my opinion this added a few extra stuff, still code seems largely based on QuantNomad's, plagiarism is not ok, when a simple mention/pingback of it would suffice, and every one would be happy.. :facepalm: :)
antondmt
@BillionaireLau, Yes, the inspiration is from QuantNomad, who was absolutely okay with the post. If you compare the scripts, they are very different, no plagiarism here. This script has simple equity, compound equity and drawdowns. It also works with replay funciton unlike the original it is inspired from. If you call making a monthly table "plagiarism", I don't know what to say...
RicardoSantos
@antondmt, well some think of it more serious than others, personally on my own scripts i do not care how the code is used, that is why i do not post private scripts, but regardless giving some props to were inspiration comes from is always nice and avoids mishaps :)
antondmt
@RicardoSantos, and props were given! Perhaps mishaps are unavoidable sometimes :')
antondmt
@RicardoSantos, Thanks for the dono. I've added "PLACE YOUR STRATEGY CODE HERE" brackets where you can post your own strategy in and the table will work. I don't think it can be made into a library due to TV restrictions of what a library can contain. Regardless, pasting your own strategy code in is the best way.
Jeetonysant
Thank you very much for sharing your work! I'll check this one.
更多