How tubakhxn/trading-bots works
Repository Scope
A collection of three standalone Python market-research bots. Each analyzes a distinct price behavior, fetches market data, derives signals or metrics, and writes matplotlib visualizations to its own output directory. It is not a unified trading execution system.
Entry Points and Runtime
Each bot is launched independently through its local main.py:
• Drawdown Recovery Curve Bot/main.py
• Volatility Compression Expansion Bot/main.py
• Liquidity Sweep Detection Bot/main.py
The runtime is Python with pandas/numpy for time-series work, matplotlib for charts, and yfinance as the implied external market-data provider. Each bot can install missing dependencies at execution time.
Drawdown Recovery Analysis Pipeline
The drawdown bot obtains price data, transforms it into cumulative-return and drawdown series, then identifies drawdown-to-recovery cycles. Its output is a relationship between drawdown depth and recovery duration, suited to risk/recovery research rather than trade execution.
• Data boundary: Drawdown Recovery Curve Bot/data.py
• Analysis stage: Drawdown Recovery Curve Bot/analysis.py
• Visualization/output stage: Drawdown Recovery Curve Bot/visualize.py, Drawdown Recovery Curve Bot/outputs
Volatility Compression-to-Expansion Pipeline
This bot calculates Bollinger Bands and band width, classifies low-volatility squeeze periods, and detects subsequent expansion/breakout behavior. The main control flow is price data → indicator computation → compression/expansion labeling → annotated price chart.
• Orchestration: Volatility Compression Expansion Bot/main.py
• Indicator and detection logic: Volatility Compression Expansion Bot/indicators.py
• Presentation boundary: Volatility Compression Expansion Bot/visualize.py, Volatility Compression Expansion Bot/outputs
Liquidity Sweep Detection Pipeline
The liquidity bot derives swing highs and lows, evaluates whether price breaches those levels and reverses, and converts recognized bullish/bearish sweeps into buy/sell-oriented signals. It is the repository’s most explicitly signal-generating workflow, though the README does not establish brokerage integration or order execution.
• Data acquisition/preparation: Liquidity Sweep Detection Bot/data.py
• Signal strategy: Liquidity Sweep Detection Bot/strategy.py
• Orchestration and charting: Liquidity Sweep Detection Bot/main.py, Liquidity Sweep Detection Bot/visualize.py
Key Architectural Boundaries
Each bot is isolated by directory, with its own entry point, data/analysis modules, visualization module, and outputs sink. There is no shared package, common execution engine, persistence layer, API service, or cross-bot orchestration evident in the tree. The primary external boundary is historical market-data retrieval; the primary artifact boundary is locally generated chart output.
Operational Model
These are batch-style, local research scripts: run one bot, retrieve/process historical prices, generate derived observations, and save visual artifacts. Outputs are intended for manual interpretation of risk, volatility regime transitions, or liquidity-reversal patterns rather than automated portfolio management.
Main entry points: Drawdown Recovery Curve Bot/data.py Price acquisition · Liquidity Sweep Detection Bot/data.py Price preparation · strategy.py Sweep signal strategy · main.py Volatility entry point
Components 14
Drawdown Recovery Bot
Independent risk and recovery research workflow.
- Drawdown entry point
Drawdown Recovery Curve Bot/main.py - Price acquisition
Drawdown Recovery Curve Bot/data.py - Recovery-cycle analysis · Builds cumulative returns, drawdowns, and recovery cycles.
Drawdown Recovery Curve Bot/analysis.py - Recovery visualization
Drawdown Recovery Curve Bot/visualize.py - Recovery charts
Drawdown Recovery Curve Bot/outputs
Volatility Compression Bot
Independent volatility-regime research workflow.
- Volatility entry point
Volatility Compression Expansion Bot/main.py - Compression detection · Computes Bollinger width, squeeze periods, and expansions.
Volatility Compression Expansion Bot/indicators.py - Annotated charting
Volatility Compression Expansion Bot/visualize.py - Volatility charts
Volatility Compression Expansion Bot/outputs
Liquidity Sweep Bot
Independent reversal-signal research workflow.
- Liquidity entry point
Liquidity Sweep Detection Bot/main.py - Price preparation
Liquidity Sweep Detection Bot/data.py - Sweep signal strategy · Finds swing breaches, reversals, and bullish/bearish signals.
Liquidity Sweep Detection Bot/strategy.py - Sweep charting
Liquidity Sweep Detection Bot/visualize.py
Other components
- Historical market data · yfinance is the implied price-data source.
Connections 14
- Drawdown entry point → Price acquisition: loads prices
- Price acquisition → Historical market data: retrieves
- Price acquisition → Recovery-cycle analysis: price series
- Recovery-cycle analysis → Recovery visualization: drawdown and recovery metrics
- Recovery visualization → Recovery charts: saves charts
- Volatility entry point → Historical market data: retrieves prices
- Volatility entry point → Compression detection: runs
- Compression detection → Annotated charting: bands and regime labels
- Annotated charting → Volatility charts: saves charts
- Liquidity entry point → Price preparation: loads prices
- Price preparation → Historical market data: retrieves
- Price preparation → Sweep signal strategy: prepared prices
- Liquidity entry point → Sweep signal strategy: runs
- Sweep signal strategy → Sweep charting: sweep signals