OPEN-SOURCE SCRIPT
DCA IN/OUT Calculator {RWCS}

Welcome to the DCA Calculator.
So you've been following your systems, and things are going good. Systems > Feelings.
You have your own Long/Short signals, and know when to hold cash and when to buy in.
Cool. Let's take it one step further.
This DCA calculator will rotate you in or out of your positions, landing you an average entry/exit price which is below/above the median price over a specified timeframe.
* Use the chart to set your preferred DCA timeframe.
* Once initialized, this strategy will fire a signal at the close of every candle.
Example: set chart to 1H, and the strategy will fire a signal every hour until you have exhausted the remaining capital. Pick 4H, 1D, 2D, 1W. Whatever you want, use the chart.
Calculator Mode:
Buy:
So your holding cash, but your system went long. Time to buy in. You have the asset in mind and the allocation of your capital is ready to go.
1) Load this strategy up. Set Calculator Mode to "Buy".
2) Input the total capital you have available for this asset.
3) Input the Allocation % you want to DCA in with on each signal. (This is 0 line, actual allocation % will differ each bar based on price action. Recommend 10%, play around and find out).
- Now the strategy will signal a buy in value on the close of each candle.
- It will do this until your remaining capital is fully allocated.
* At this point you will be fully allocated at an average entry price lower then the median price over that specified time period.
Sell:
So your fully allocated to your systems, which have just gone short. Time to sell.
1) Load this strategy up. Set Calculator Mode to "Sell".
2) Input the total capital you currently have invested into that asset.
3) Input the Allocation % you want to DCA out with on each signal. (This is 0 line, actual allocation % will differ each bar based on price action. Recommend 10%, play around and find out).
- Now the strategy will signal a sell out value on the close of each candle.
- It will do this until your remaining capital is fully rotated into cash.
* At this point you will be fully rotated into cash at an average exit price higher then the median price over that specified time period.
Nothing is perfect. Nothing is guaranteed. We are simply stacking probability's to give ourselves the best chance at an optimal outcome.
God Speed.
RWCS_LTD
Introduced some code clean up to the calculations.
Thank you Dark
So you've been following your systems, and things are going good. Systems > Feelings.
You have your own Long/Short signals, and know when to hold cash and when to buy in.
Cool. Let's take it one step further.
This DCA calculator will rotate you in or out of your positions, landing you an average entry/exit price which is below/above the median price over a specified timeframe.
* Use the chart to set your preferred DCA timeframe.
* Once initialized, this strategy will fire a signal at the close of every candle.
Example: set chart to 1H, and the strategy will fire a signal every hour until you have exhausted the remaining capital. Pick 4H, 1D, 2D, 1W. Whatever you want, use the chart.
Calculator Mode:
Buy:
So your holding cash, but your system went long. Time to buy in. You have the asset in mind and the allocation of your capital is ready to go.
1) Load this strategy up. Set Calculator Mode to "Buy".
2) Input the total capital you have available for this asset.
3) Input the Allocation % you want to DCA in with on each signal. (This is 0 line, actual allocation % will differ each bar based on price action. Recommend 10%, play around and find out).
- Now the strategy will signal a buy in value on the close of each candle.
- It will do this until your remaining capital is fully allocated.
* At this point you will be fully allocated at an average entry price lower then the median price over that specified time period.
Sell:
So your fully allocated to your systems, which have just gone short. Time to sell.
1) Load this strategy up. Set Calculator Mode to "Sell".
2) Input the total capital you currently have invested into that asset.
3) Input the Allocation % you want to DCA out with on each signal. (This is 0 line, actual allocation % will differ each bar based on price action. Recommend 10%, play around and find out).
- Now the strategy will signal a sell out value on the close of each candle.
- It will do this until your remaining capital is fully rotated into cash.
* At this point you will be fully rotated into cash at an average exit price higher then the median price over that specified time period.
Nothing is perfect. Nothing is guaranteed. We are simply stacking probability's to give ourselves the best chance at an optimal outcome.
God Speed.
RWCS_LTD
Introduced some code clean up to the calculations.
Thank you Dark
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。