Smart DCA StrategyINSPIRATION
While Dollar Cost Averaging (DCA) is a popular and stress-free investment approach, I noticed an opportunity for enhancement. Standard DCA involves buying consistently, regardless of market conditions, which can sometimes mean missing out on optimal investment opportunities. This led me to develop the Smart DCA Strategy – a 'set and forget' method like traditional DCA, but with an intelligent twist to boost its effectiveness.
The goal was to build something more profitable than a standard DCA strategy so it was equally important that this indicator could backtest its own results in an A/B test manner against the regular DCA strategy.
WHY IS IT SMART?
The key to this strategy is its dynamic approach: buying aggressively when the market shows signs of being oversold, and sitting on the sidelines when it's not. This approach aims to optimize entry points, enhancing the potential for better returns while maintaining the simplicity and low stress of DCA.
WHAT THIS STRATEGY IS, AND IS NOT
This is an investment style strategy. It is designed to improve upon the common standard DCA investment strategy. It is therefore NOT a day trading strategy. Feel free to experiment with various timeframes, but it was designed to be used on a daily timeframe and that's how I recommend it to be used.
You may also go months without any buy signals during bull markets, but remember that is exactly the point of the strategy - to keep your buying power on the sidelines until the markets have significantly pulled back. You need to be patient and trust in the historical backtesting you have performed.
HOW IT WORKS
The Smart DCA Strategy leverages a creative approach to using Moving Averages to identify the most opportune moments to buy. A trigger occurs when a daily candle, in its entirety including the high wick, closes below the threshold line or box plotted on the chart. The indicator is designed to facilitate both backtesting and live trading.
HOW TO USE
Settings:
The input parameters for tuning have been intentionally simplified in an effort to prevent users falling into the overfitting trap.
The main control is the Buying strictness scale setting. Setting this to a lower value will provide more buying days (less strict) while higher values mean less buying days (more strict). In my testing I've found level 9 to provide good all round results.
Validation days is a setting to prevent triggering entries until the asset has spent a given number of days (candles) in the overbought state. Increasing this makes entries stricter. I've found 0 to give the best results across most assets.
In the backtest settings you can also configure how much to buy for each day an entry triggers. Blind buy size is the amount you would buy every day in a standard DCA strategy. Smart buy size is the amount you would buy each day a Smart DCA entry is triggered.
You can also experiment with backtesting your strategy over different historical datasets by using the Start date and End date settings. The results table will not calculate for any trades outside what you've set in the date range settings.
Backtesting:
When backtesting you should use the results table on the top right to tune and optimise the results of your strategy. As with all backtests, be careful to avoid overfitting the parameters. It's better to have a setup which works well across many currencies and historical periods than a setup which is excellent on one dataset but bad on most others. This gives a much higher probability that it will be effective when you move to live trading.
The results table provides a clear visual representation as to which strategy, standard or smart, is more profitable for the given dataset. You will notice the columns are dynamically coloured red and green. Their colour changes based on which strategy is more profitable in the A/B style backtest - green wins, red loses. The key metrics to focus on are GOA (Gain on Account) and Avg Cost .
Live Trading:
After you've finished backtesting you can proceed with configuring your alerts for live trading.
But first, you need to estimate the amount you should buy on each Smart DCA entry. We can use the Total invested row in the results table to calculate this. Assuming we're looking to trade on BITSTAMP:BTCUSD
Decide how much USD you would spend each day to buy BTC if you were using a standard DCA strategy. Lets say that is $5 per day
Enter that USD amount in the Blind buy size settings box
Check the Blind Buy column in the results table. If we set the backtest date range to the last 10 years, we would expect the amount spent on blind buys over 10 years to be $18,250 given $5 each day
Next we need to tweak the value of the Smart buy size parameter in setting to get it as close as we can to the Total Invested amount for Blind Buy
By following this approach it means we will invest roughly the same amount into our Smart DCA strategy as we would have into a standard DCA strategy over any given time period.
After you have calculated the Smart buy size , you can go ahead and set up alerts on Smart DCA buy triggers.
BOT AUTOMATION
In an effort to maintain the 'set and forget' stress-free benefits of a standard DCA strategy, I have set my personal Smart DCA Strategy up to be automated. The bot runs on AWS and I have a fully functional project for the bot on my GitHub account. Just reach out if you would like me to point you towards it. You can also hook this into any other 3rd party trade automation system of your choice using the pre-configured alerts within the indicator.
PLANNED FUTURE DEVELOPMENTS
Currently this is purely an accumulation strategy. It does not have any sell signals right now but I have ideas on how I will build upon it to incorporate an algorithm for selling. The strategy should gradually offload profits in bull markets which generates more USD which gives more buying power to rinse and repeat the same process in the next cycle only with a bigger starting capital. Watch this space!
MARKETS
Crypto:
This strategy has been specifically built to work on the crypto markets. It has been developed, backtested and tuned against crypto markets and I personally only run it on crypto markets to accumulate more of the coins I believe in for the long term. In the section below I will provide some backtest results from some of the top crypto assets.
Stocks:
I've found it is generally more profitable than a standard DCA strategy on the majority of stocks, however the results proved to be a lot more impressive on crypto. This is mainly due to the volatility and cycles found in crypto markets. The strategy makes its profits from capitalising on pullbacks in price. Good stocks on the other hand tend to move up and to the right with less significant pullbacks, therefore giving this strategy less opportunity to flourish.
Forex:
As this is an accumulation style investment strategy, I do not recommend that you use it to trade Forex.
STRATEGY IN ACTION
Here you see the indicator running on the BITSTAMP:BTCUSD pair. You can read the indicator as follows:
Vertical green bands on historical candles represents where buy signals triggered in the past
Table on the top right represents the results of the A/B backtest against a standard DCA strategy
Green Smart Buy column shows that Smart DCA was more profitable than standard DCA on this backtest. That is shown by the percentage GOA (Gain on Account) and the Avg Cost
Smart Buy Zone label marks the threshold which the entire candle must be below to trigger a buy signal (line can be changed to a box under plotting settings)
Green color of Smart Buy Zone label represents that the open candle is still valid for a buy signal. A signal will only be generated if the candle closes while this label is still green
Below is the same BITSTAMP:BTCUSD chart a couple of days later. Notice how the threshold has been broken and the Smart Buy Zone label has turned from green to red. No buy signal can be triggered for this day - even if the candle retraced and closed below the threshold before daily candle close.
Notice how the green vertical bands tend to be present after significant pullbacks in price. This is the reason the strategy works! Below is the same BITSTAMP:BTCUSD chart, but this time zoomed out to present a clearer picture of the times it would invest vs times it would sit out of the market. You will notice it invests heavily in bear markets and significant pullbacks, and does not buy anything during bull markets.
Finally, to visually demonstrate the indicator on an asset other than BTC, here is an example on CRYPTO:ETHUSD . In this case the current daily high has not touched the threshold so it is still possible for this to be a valid buy trigger on daily candle close. The vertical green band will not print until the buy trigger is confirmed.
BACKTEST RESULTS
Now for some backtest results to demonstrate the improved performance over a standard DCA strategy using all non-stablecoin assets in the top 30 cryptos by marketcap.
I've used the TradingView ticker (exchange name denoted as CRYPTO in the symbol search) for every symbol tested with the exception of BTCUSD because there was some dodgy data at the beginning of the TradingView BTCUSD chart which overinflated the effectiveness of the Smart DCA strategy on that ticker. For BTCUSD I've used the BITSTAMP exchange data. The symbol links below will take you to the correct chart and exchange used for the test.
I'm using the GOA (Gain on Account) values to present how each strategy performed.
The value on the left side is the standard DCA result and the right is the Smart DCA result.
✅ means Smart DCA strategy outperformed the standard DCA strategy
❌ means standard DCA strategy outperformed the Smart DCA strategy
To avoid overfitting, and to prove that this strategy does not suffer from overfitting, I've used the exact same input parameters for every symbol tested below. The settings used in these backtests are:
Buying strictness scale: 9
Validation days: 0
You can absolutely tweak the values per symbol to further improve the results of each, however I think using identical settings on every pair tested demonstrates a higher likelihood that the results will be similar in the live markets.
I'm presenting results for two time periods:
First price data available for trading pair -> closing candle on Friday 26th Jan 2024 (ALL TIME)
Opening candle on Sunday 1st Jan 2023 -> closing candle on Friday 26th Jan 2024 (JAN 2023 -> JAN 2024)
ALL TIME:
BITSTAMP:BTCUSD 80,884% / 133,582% ✅
CRYPTO:ETHUSD 17,231% / 36,146% ✅
CRYPTO:BNBUSD 5,314% / 2,702% ❌
CRYPTO:SOLUSD 1,745% / 1,171% ❌
CRYPTO:XRPUSD 2,585% / 4,544% ✅
CRYPTO:ADAUSD 338% / 353% ✅
CRYPTO:AVAXUSD 130% / 160% ✅
CRYPTO:DOGEUSD 13,690% / 16,432% ✅
CRYPTO:TRXUSD 414% / 466% ✅
CRYPTO:DOTUSD -16% / -7% ✅
CRYPTO:LINKUSD 1,161% / 2,164% ✅
CRYPTO:TONUSD 25% / 47% ✅
CRYPTO:MATICUSD 1,769% / 1,587% ❌
CRYPTO:ICPUSD 70% / 50% ❌
CRYPTO:SHIBUSD -20% / -19% ✅
CRYPTO:LTCUSD 486% / 718% ✅
CRYPTO:BCHUSD -4% / 3% ✅
CRYPTO:LEOUSD 102% / 151% ✅
CRYPTO:ATOMUSD 46% / 91% ✅
CRYPTO:UNIUSD -16% / 1% ✅
CRYPTO:ETCUSD 283% / 414% ✅
CRYPTO:OKBUSD 1,286% / 1,935% ✅
CRYPTO:XLMUSD 1,471% / 1,592% ✅
CRYPTO:INJUSD 830% / 1,035% ✅
CRYPTO:OPUSD 138% / 195% ✅
CRYPTO:NEARUSD 23% / 44% ✅
Backtest result analysis:
Assuming we have an initial investment amount of $10,000 spread evenly across each asset since the creation of each asset, it would have provided the following results.
Standard DCA Strategy results:
Average percent return: 4,998.65%
Profit: $499,865
Closing balance: $509,865
Smart DCA Strategy results:
Average percent return: 7,906.03%
Profit: $790,603
Closing balance: $800,603
JAN 2023 -> JAN 2024:
BITSTAMP:BTCUSD 47% / 66% ✅
CRYPTO:ETHUSD 26% / 33% ✅
CRYPTO:BNBUSD 15% / 17% ✅
CRYPTO:SOLUSD 272% / 394% ✅
CRYPTO:XRPUSD 7% / 12% ✅
CRYPTO:ADAUSD 43% / 59% ✅
CRYPTO:AVAXUSD 116% / 151% ✅
CRYPTO:DOGEUSD 8% / 14% ✅
CRYPTO:TRXUSD 48% / 65% ✅
CRYPTO:DOTUSD 24% / 35% ✅
CRYPTO:LINKUSD 83% / 124% ✅
CRYPTO:TONUSD 7% / 21% ✅
CRYPTO:MATICUSD -3% / 7% ✅
CRYPTO:ICPUSD 161% / 196% ✅
CRYPTO:SHIBUSD 1% / 8% ✅
CRYPTO:LTCUSD -15% / -7% ✅
CRYPTO:BCHUSD 47% / 68% ✅
CRYPTO:LEOUSD 9% / 11% ✅
CRYPTO:ATOMUSD 1% / 15% ✅
CRYPTO:UNIUSD 9% / 23% ✅
CRYPTO:ETCUSD 27% / 40% ✅
CRYPTO:OKBUSD 21% / 30% ✅
CRYPTO:XLMUSD 11% / 19% ✅
CRYPTO:INJUSD 477% / 446% ❌
CRYPTO:OPUSD 77% / 91% ✅
CRYPTO:NEARUSD 78% / 95% ✅
Backtest result analysis:
Assuming we have an initial investment amount of $10,000 spread evenly across each asset for the duration of 2023, it would have provided the following results.
Standard DCA Strategy results:
Average percent return: 61.42%
Profit: $6,142
Closing balance: $16,142
Smart DCA Strategy results:
Average percent return: 78.19%
Profit: $7,819
Closing balance: $17,819
Etherium
EMP PEG / TWAP 1.01 Crypto DefiThis script is for my EMP friends. This addon is based upon Etherium price. It will take the Etherium price and divide by 4,000 to get the PEG price. From there, it will multiply by 1.01 to get the TWAP 1.01. Since it takes 1.01 for the boardroom to print, the yellow line is the important line. TWAP will be showed by default. You can switch between or have both indicators on. You can drag the indicator screen up to get a bigger chart. You can also use this for looking back to see where PEG or TWAP 1.01 was during certain EMP prices. Understand this will get you close to seeing when Boardroom will print. Nothing is exact. How I use it: I place a green and yellow horizontal line on an EMP chart from Dexscreener dexscreener.com You can check this chart to find out what to move your horizontal lines to. Come join the fun at emp.money
[Bitnalysis] Altcoin Season IndicatorThe Altcoin Season Indicator compares performance of Bitcoin with the performance of the top altcoins over a specified period. The indicator weights the results, giving greater weight to the first specified altcoins. By default, the larger market cap altcoins, such as ETH, BNB, ADA, etc., are included first and therefore given greater weight in the algorithm. To remove the weighting from the formula and consider the performance of all listed altcoins equally, set the weighting setting to "0".
The output shows to what extent altcoins are outperforming Bitcoin; the higher the number, the more altcoins are outperforming Bitcoin. This indicator helps traders predict when "altcoin season" is about to begin or end.
coin statistics
This script displays statistics for 10 coins
for which coins you need to display statistics, you can specify in the script settings.
The script shows the:
- CURRENT PRICE
- RSI
- EMA
- Trend status - which is based on the closing of the candle above the em
you can also specify the length of ema and rsi in the settings
Данный скрипт отображает статистику 10 монет
за какие монеты нужно отображать статистику , вы можете указать в настройка скрипта.
скрипт показывает:
- ТЕКУЩУЮ ЦЕНУ
- RSI
- EMA
- ТРЕНДОВЫЙ СТАТУС - который основан на закрытии свечи выше ема
длину ема и рси вы так же можете указать в настройках
ape[x] v1.0 15minFor more info or access
Contact
Twitter : @quantdegen
Discord : Find it in twitter info.