lukescream

DCA Simulator

A simple yet powerful Dollar Cost Averaging (DCA) simulator.

You just add the script to your chart, and you'll be able to see:
- Every single entry with its size
- The evolution of you average price in time (blue line)
- The profit and loss areas (where market price < average price the DCA is at loss, and the background is colored in red. At the contrary, where mkt price is > average price, it's profit area and the background is green).
- Max drawdown: the point in price and time where the DCA loss is maximum in the considered time interval. The drawdown amount is specified.
- Profit (or loss) and total cost at the end of the time interval or at the present day: the script shows how much the DCA is netting at a profit or loss, as well as the total cost of the DCA itself.

The parameters are:

- Date start and date end: time interval of the DCA simulation
- DCA period (you can choose between daily, weekly and monthly)
- Week day or month day if you choose those periods
- Single operation size (in base currency)
- Option to choose a DCA LONG or DCA SHORT (for uber bears)
- Option to include an exit strategy that partially closes your position (the % size closed can be chosen as well with the parameter "exit_close_perc") every time the DCA realizes a specific gain (choosable with the parameter "exit_gain_threshold"). If you choose "none" as an exit strategy, the script will assume to never close positions until the end of the period or the present day for simulation purpose.

NB: just ignore the TV strategy tester results, all the data are visible on the chart.

Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?