Dollar Cost Averaging with optimisations to minimise risk and maximise profit (Binance/Kraken/FTX)
Dollar Cost Averaging - DCA: Dividing a sum of money to invest periodically, reducing the impact of volatility on the purchase price. DCA is the commonly accepted risk mitigating way to invest in crypto. But can we do better?
Buy the dip - I'm sure you've heard it before but it's much easier said than done. The indicators in this repo are provided to help buy the dip algorithmically: Weighting the buy amount per order to invest more when it's likely crypto is in a dip and less when it is not.
This repo lets you run and backtest DCA strategies for crypto to minimise risk and maximise profits, allowing for user customisation with respect to frequency of purchasing, use of indicators and aggression or weighting
To get started you will need an exchange account from Binance/FTX/Kraken (Fee reducing referral links below):
Load up your spot wallet with USD or USDT or whatever currency you want to use to buy crypto
Create API keys with 'trading' permissions enabled
Put your API keys in a json file called keys.json
one directory above the repo (Only the exchange keys used to trade need to be included)
{
"binance_keys":{
"api_key":"XXXXXXXXXXXXXXXXXXXX",
"secret_key":"XXXXXXXXXXXXXXXXXXXX"
},
"ftx_keys":{
"api_key":"XXXXXXXXXXXXXXXXXXXX",
"secret_key":"XXXXXXXXXXXXXXXXXXXX"
},
"kraken_keys":{
"api_key":"XXXXXXXXXXXXXXXXXXXX",
"secret_key":"XXXXXXXXXXXXXXXXXXXX"
}
}
pip install -r requirements.txt
from the root directory
python dca.py
to start or python dca.py -s
to start in simulation mode (places fake trades)
Places (spot) market buy orders on the exchange at the current price, it then sleeps until the next buy interval. It will save progress so it doesn't have to be continuously run but I would reccomend running this perpetually (on a linux based microcomputer like a Rasberry Pi). Different DCA strategies will be put in as we go!
Strategies tested and planning to be tested:
The fear and greed strategy chart shows 100 - fear and greed index (red) and bitcoin price (blue). When fear is high (red line close to 100) invest more and when greed is high (red line close to 0) invest less. By doing this we can invest according to this weighting to increase the amount of BTC held over a long period of time compared to regular DCA.
Current fear and greed:
September 13th
September 12th
August 27th
August 12th:
August 8th: