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에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.