Skip to content

A cryptocurrency trading bot for BTC using a core-satellite strategy and Aroon indicator, designed to optimize returns with Dollar-Cost Averaging and dynamic rebalancing based on market conditions.

License

Notifications You must be signed in to change notification settings

sai-123-code/CRYPTO_TRADING_BOT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

BTC Trading Bot with Core-Satellite Strategy and Aroon Indicator

Overview

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.

image

Core-Satellite Strategy

Core Portfolio:

  • 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.

Satellite Portfolio:

  • 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).

Indicators and Libraries

  • 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.

Data Source

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.

Key Performance Metrics

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.

Future Development

  • 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.

About

A cryptocurrency trading bot for BTC using a core-satellite strategy and Aroon indicator, designed to optimize returns with Dollar-Cost Averaging and dynamic rebalancing based on market conditions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published