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.

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?