This BTC trading bot is designed to operate on 5-minute intervals, using the Aroon indicator from the TA-Lib library to inform trade decisions. It follows a core-satellite investment approach to balance long-term investments with active trading. The bot allocates 80% of the portfolio to a stable, core investment in BTC while using the remaining 20% as a satellite for active trading.
- The core portfolio represents a stable, long-term investment in BTC.We are currently doing paper trading to test the strategy with 1000$.
- To implement Dollar-Cost Averaging (DCA), an $800 allocation is split into $66 increments, which will be invested monthly (e.g., every 30 days) regardless of BTC price.
- This DCA approach mitigates the impact of short-term volatility by spreading out purchases over time.
- The satellite portfolio actively trades BTC based on Aroon indicator signals.
- The Aroon indicator helps identify the strength and direction of market trends, guiding buy or sell decisions within the 20% allocation.
- Dynamic Rebalancing: In bearish markets, the bot shifts to a 90% core / 10% satellite allocation, while in bullish markets, it moves to 60% core / 40% satellite. The bullish/bearish determination is made by comparing the current BTC price to its all-time high (ATH).
- TA-Lib: The primary library used for technical analysis, specifically the Aroon indicator, which detects trends and signals potential buy or sell points.
- Pandas: Used for data manipulation, particularly to track price movements and evaluate trade outcomes.
- Numpy: For numerical computations, essential for calculating metrics like returns and standard deviations.
- Matplotlib (Optional): Visualization tool to plot BTC price trends and Aroon indicator values.
The bot fetches real-time BTC price data from a cryptocurrency exchange API (e.g., coingecko API ). The data includes price snapshots every 5 minutes, which the bot uses to calculate Aroon indicator values and make trade decisions.
The bot calculates the following performance metrics to evaluate its success:
- Total Returns: Measures the profitability of both core and satellite investments.
- Alpha: Measures the excess return generated by the bot compared to BTC’s overall performance.
- Sharpe Ratio: Assesses risk-adjusted returns by dividing the return by the standard deviation.
- Standard Deviation of Returns: Tracks the volatility of BTC and bot performance.
- Final Profit: The total profit at the end of each bot session.
- Duration: The time the bot is active in a single run.
- Trade Count: Total number of trades executed by the bot.
-
To enhance the bot's robustness, backtesting is essential before live implementation. Backtesting on historical BTC data with 5-minute intervals will help evaluate the bot's performance across varying market conditions. This testing will provide insights into the strategy’s viability, allowing for adjustments and optimizations.
-
Backtesting will also test the impact of core and satellite rebalancing, particularly how well DCA and dynamic rebalancing strategies adjust to market changes. Incorporate periodic Dynamic Rebalancing evaluations (e.g., monthly) to ensure that core and satellite allocations remain aligned with bullish or bearish trends, as indicated by BTC’s current price relative to its ATH.