# paneertikka01/bitcoin-algo-trading-strategy architecture

> Architecture diagram of the GitHub repository paneertikka01/bitcoin-algo-trading-strategy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paneertikka01/bitcoin-algo-trading-strategy
- Repository: https://github.com/paneertikka01/bitcoin-algo-trading-strategy

## Overview

#### Purpose and Entry Point
This is a notebook-centric Bitcoin algorithmic trading strategy for historical analysis and potential order execution. The primary executable artifact is `BTC-algotrad-strat.ipynb`; there is no standalone Python package, service, or CLI. Historical OHLCV-style market input is supplied by `btc_4h_data_2018_to_2024-2024-12-10.csv`.

#### Data Ingestion and Preparation
The notebook loads locally stored Bitcoin 4-hour historical data, then formats it for indicator computation and backtesting. The README notes that notebook path/name variables may currently expect a different CSV name, creating an operational boundary between the checked-in dataset and runtime configuration.
- `BTC-algotrad-strat.ipynb`
- `btc_4h_data_2018_to_2024-2024-12-10.csv`

#### Technical Signal Layer
Strategy decisions combine Ichimoku Cloud structure—Tenkan-sen, Kijun-sen, and Senkou spans—with supporting technical indicators such as RSI, MACD, and moving averages. This is the core market-state transformation: cleaned price series become trend, momentum, and confirmation features.
- `BTC-algotrad-strat.ipynb`

#### Trading Decision and Risk Layer
The notebook converts indicator conditions into long/short or buy/sell trade signals. Risk controls described by the repository include stop-loss handling and leverage control; these constrain position behavior rather than acting as a separate deployable risk service.
- `BTC-algotrad-strat.ipynb`

#### Backtest and Portfolio Accounting
Historical signals are simulated against the BTC dataset to produce trades, portfolio balance evolution, fees, returns, drawdown, and risk-adjusted metrics such as Sharpe and Sortino ratios. The backtest is the main evaluation path and is driven by local data rather than an external market-data service.
- `BTC-algotrad-strat.ipynb`
- `btc_4h_data_2018_to_2024-2024-12-10.csv`

#### Execution Integration Boundary
For live or paper order placement, the strategy is intended to integrate with `untrade-sdk`, an external dependency installed separately. The repository itself does not contain SDK source, credentials, exchange adapters, scheduling, or deployment infrastructure, so execution is an external boundary reached from the notebook.
- `BTC-algotrad-strat.ipynb`

#### Runtime and Dependencies
The expected runtime is Python in Jupyter. Architecturally material libraries are `ta` and `pandas_ta` for indicators, `tqdm` for iterative progress, and `untrade-sdk` for trading execution. Reproducibility depends on manually installing these packages and aligning notebook CSV configuration with `btc_4h_data_2018_to_2024-2024-12-10.csv`.

Main entry points: [`BTC-algotrad-strat.ipynb`](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb) (Data Preparation), [`btc_4h_data_2018_to_2024-2024-12-10.csv`](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/btc_4h_data_2018_to_2024-2024-12-10.csv) (BTC 4h Historical Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_notebook["Jupyter Strategy Notebook"]
  node_notebook_entry["Strategy Notebook<br/>Jupyter notebook"]
  node_data_preparation["Data Preparation<br/>notebook stage"]
  node_technical_indicators["Technical Indicators<br/>notebook stage"]
  node_signal_generation["Trade Signals<br/>notebook stage"]
  node_risk_controls["Risk Controls<br/>notebook stage"]
  node_backtest_engine["Backtest Simulation<br/>notebook stage"]
  node_portfolio_accounting["Portfolio Accounting<br/>notebook stage"]
  node_analysis_output["Strategy Evaluation<br/>notebook output"]
end

subgraph group_external["External Dependencies"]
  node_indicator_libraries["ta / pandas_ta<br/>Python libraries"]
  node_progress_library["tqdm<br/>Python library"]
  node_untrade_sdk{{"untrade-sdk<br/>external SDK"}}
  node_execution_boundary{{"Order Execution<br/>external boundary"}}
end

node_market_csv[("BTC 4h Historical Data<br/>CSV dataset")]

node_notebook_entry -->|"runs"| node_data_preparation
node_market_csv -->|"OHLCV input"| node_data_preparation
node_data_preparation -->|"clean price series"| node_technical_indicators
node_indicator_libraries -.->|"computes"| node_technical_indicators
node_technical_indicators -->|"market features"| node_signal_generation
node_signal_generation -->|"candidate positions"| node_risk_controls
node_risk_controls -->|"constrained signals"| node_backtest_engine
node_data_preparation -->|"historical prices"| node_backtest_engine
node_backtest_engine -->|"trades and balances"| node_portfolio_accounting
node_portfolio_accounting -->|"performance metrics"| node_analysis_output
node_progress_library -.->|"iteration progress"| node_backtest_engine
node_risk_controls -.->|"execution intent"| node_untrade_sdk
node_untrade_sdk -->|"places orders"| node_execution_boundary

click node_market_csv "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/btc_4h_data_2018_to_2024-2024-12-10.csv"
click node_notebook_entry "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb"
click node_data_preparation "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb"
click node_technical_indicators "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb"
click node_signal_generation "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb"
click node_risk_controls "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb"
click node_backtest_engine "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb"
click node_portfolio_accounting "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb"
click node_analysis_output "https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_notebook_entry,node_data_preparation,node_technical_indicators,node_signal_generation,node_risk_controls,node_backtest_engine,node_portfolio_accounting,node_analysis_output toneBlue
class node_indicator_libraries,node_progress_library,node_untrade_sdk,node_execution_boundary toneAmber
class node_market_csv toneNeutral
```

## Components

### Jupyter Strategy Notebook

Single runtime for analysis, backtesting, and execution integration.

- [Strategy Notebook](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb): Jupyter notebook · Primary executable artifact and runtime entry point. · `BTC-algotrad-strat.ipynb`
- [Data Preparation](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb): notebook stage · Loads and formats local price data; CSV naming must match runtime configuration. · `BTC-algotrad-strat.ipynb`
- [Technical Indicators](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb): notebook stage · Builds Ichimoku, RSI, MACD, and moving-average features. · `BTC-algotrad-strat.ipynb`
- [Trade Signals](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb): notebook stage · Converts market-state conditions into buy/sell or long/short signals. · `BTC-algotrad-strat.ipynb`
- [Risk Controls](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb): notebook stage · Applies stop-loss and leverage constraints. · `BTC-algotrad-strat.ipynb`
- [Backtest Simulation](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb): notebook stage · Simulates historical trades from signals and prices. · `BTC-algotrad-strat.ipynb`
- [Portfolio Accounting](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb): notebook stage · Calculates balances, fees, returns, drawdown, Sharpe, and Sortino. · `BTC-algotrad-strat.ipynb`
- [Strategy Evaluation](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/BTC-algotrad-strat.ipynb): notebook output · Historical performance and risk evaluation. · `BTC-algotrad-strat.ipynb`

### External Dependencies

Manually installed libraries and execution boundary.

- **ta / pandas_ta**: Python libraries · Indicator computation dependencies.
- **tqdm**: Python library · Iterative progress dependency.
- **untrade-sdk**: external SDK · Separately installed order-placement integration.
- **Order Execution**: external boundary · Live or paper execution; exchange adapters and credentials are outside the repository.

### Other components

- [BTC 4h Historical Data](https://github.com/paneertikka01/bitcoin-algo-trading-strategy/blob/main/btc_4h_data_2018_to_2024-2024-12-10.csv): CSV dataset · Local OHLCV-style Bitcoin market history. · `btc_4h_data_2018_to_2024-2024-12-10.csv`

## Connections

- Strategy Notebook → Data Preparation: runs
- BTC 4h Historical Data → Data Preparation: OHLCV input
- Data Preparation → Technical Indicators: clean price series
- ta / pandas_ta → Technical Indicators: computes
- Technical Indicators → Trade Signals: market features
- Trade Signals → Risk Controls: candidate positions
- Risk Controls → Backtest Simulation: constrained signals
- Data Preparation → Backtest Simulation: historical prices
- Backtest Simulation → Portfolio Accounting: trades and balances
- Portfolio Accounting → Strategy Evaluation: performance metrics
- tqdm → Backtest Simulation: iteration progress
- Risk Controls → untrade-sdk: execution intent
- untrade-sdk → Order Execution: places orders
