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!

Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?