Loading repository data…
Loading repository data…
e49nana / repository
Open-source trading tools (MQL5 & NinjaTrader) + DeFi crypto bot + AlgoSphere Quant showcase
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Open-source tools & strategies for algorithmic trading — from traditional markets to DeFi.
Commercial products by AlgoSphere Quant are listed below but hosted on the MQL5 Marketplace.
This repository brings together my algorithmic trading work across two worlds:
| TradFi | DeFi | |
|---|---|---|
| Platforms | MetaTrader 5, NinjaTrader | Ethereum, Arbitrum, Polygon, Solana |
| Languages | MQL5, C# | Python, Solidity (learning) |
| Focus | Indicators, EAs, position management | CEX/DEX connectors, arbitrage, MEV |
| Status | Mature (14+ products) | Active development |
My most advanced open-source system: AI-powered crude oil trading based on real-time geopolitical analysis.
Claude API scores Iran/Middle East tensions (-10 to +10), a composite engine blends geo + technical + sentiment signals, Kelly sizing computes position size, and a MetaTrader 5 EA executes WTI/Brent trades — with a real-time React dashboard on top.
FastAPI · React/TypeScript · MQL5 · Docker · 98 tests
Algorithmic-Trading/
│
├── tradfi/
│ ├── mql5/
│ │ ├── libraries/
│ │ │ ├── SessionTimeFilter.mqh
│ │ │ └── PositionSizer.mqh
│ │ ├── indicators/
│ │ │ ├── SpreadAnalyzer.mq5
│ │ │ ├── CandlePatternDetector.mq5
│ │ │ └── MultiTimeframeDashboard.mq5
│ │ ├── experts/
│ │ │ ├── DrawdownGuard.mq5
│ │ │ └── TradeStatistics.mq5
│ │ └── scripts/
│ │ ├── RiskCalculator.mq5
│ │ └── TradeJournal.mq5
│ │
│ └── ninjatrader/
│ ├── indicators/
│ │ ├── VolumeProfile.cs
│ │ ├── OrderFlowImbalance.cs
│ │ └── SessionHighLow.cs
│ └── strategies/
│ └── snippets/
│
├── defi/
│ ├── crypto-trade-bot/
│ │ ├── connectors/
│ │ │ ├── cex/ # CEX connectors (Binance, Bybit, OKX)
│ │ │ │ ├── base.py
│ │ │ │ ├── binance.py
│ │ │ │ ├── bybit.py
│ │ │ │ └── okx.py
│ │ │ └── dex/ # DEX connectors
│ │ │ ├── base.py # AbstractDEXConnector
│ │ │ └── uniswap.py # Uniswap V3 (Web3.py)
│ │ ├── services/
│ │ │ └── exchange_rate_limiter.py # Token bucket rate limiting
│ │ ├── config/
│ │ └── tests/ # 294 tests, 0 failures
│ │
│ └── contracts/ # Solidity (coming soon)
│ └── README.md
│
└── docs/
├── architecture.md
└── defi-roadmap.md
| Tool | Description | Type |
|---|---|---|
| SessionTimeFilter | Filter trades by session (London, NY, Tokyo, Sydney) with overlap detection | Library |
| PositionSizer | Risk-based position sizing — fixed lot, percent risk, Kelly criterion | Library |
| SpreadAnalyzer | Real-time spread monitoring with statistics (avg, max, percentile) | Indicator |
| CandlePatternDetector | Automated detection of 15+ candlestick patterns with alerts | Indicator |
| MultiTimeframeDashboard | Multi-timeframe trend direction panel (RSI, MA, ADX) | Indicator |
| DrawdownGuard | Automated equity protection with daily/weekly drawdown limits | Expert |
| TradeStatistics | Real-time win rate, expectancy, profit factor, Sharpe ratio | Expert |
| RiskCalculator | One-click lot size calculator based on SL distance & risk % | Script |
| TradeJournal | Export complete trade history to CSV for external analysis | Script |
All MQL5 tools are also available on the MQL5 Code Base.
| Indicator | Description | Market |
|---|---|---|
| VolumeProfile | Volume distribution at each price level, VAH/VAL/POC | Futures |
| OrderFlowImbalance | Bid/Ask imbalance detection for scalping | Futures |
| SessionHighLow | Automatic session (RTH/ETH) high/low/mid levels | Futures |
Multi-exchange, multi-chain trading bot with CEX and DEX support, built in Python with async architecture.
┌──────────────────────────────────────────────────────────────┐
│ Telegram Bot Interface │
├──────────────────────────────────────────────────────────────┤
│ Strategy Engine │
├────────────────────┬─────────────────────────────────────────┤
│ CEX Connectors │ DEX Connectors │
│ ┌───────────────┐ │ ┌────────────────────────────────────┐ │
│ │ Binance │ │ │ Uniswap V3 (Web3.py) │ │
│ │ Bybit │ │ │ ├─ Ethereum mainnet │ │
│ │ OKX │ │ │ ├─ Arbitrum │ │
│ └───────┬───────┘ │ │ └─ Polygon │ │
│ │ │ └────────────────────────────────────┘ │
│ ▼ │ │
│ ┌───────────────┐ │ Smart Contracts │
│ │ Rate Limiter │ │ ┌────────────────────────────────────┐ │
│ │ Token Bucket │ │ │ Quoter V2 (price quotes) │ │
│ │ per-exchange │ │ │ SwapRouter02 (execute swaps) │ │
│ │ per-endpoint │ │ │ ERC-20 (approve/balance) │ │
│ └───────────────┘ │ └────────────────────────────────────┘ │
├────────────────────┴─────────────────────────────────────────┤
│ Config │ Logging │ 294 Tests │
└──────────────────────────────────────────────────────────────┘
aiogram for Telegram, asyncio.to_thread() for sync ccxt calls| Exchange | Global | Orders | Market Data | Account |
|---|---|---|---|---|
| Binance | 1000/min | 400/min | 800/min | 400/min |
| Bybit | 5000/min | 500/min | 2000/min | 600/min |
| OKX | 2000/min | 500/min | 1200/min | 500/min |
Currently learning Solidity and smart contract development. Planned projects:
| Phase | Project | Stack | Status |
|---|---|---|---|
| 1 | Solidity fundamentals + first contract deployment | Solidity, Remix, Hardhat | 📋 Planned |
| 2 | DEX mechanics — study Uniswap V2/V3 source code | Solidity, Foundry | 📋 Planned |
| 3 | Flashloan arbitrage bot | Solidity, Aave V3, Foundry | 📋 Planned |
| 4 | MEV extraction (backrunning, sandwich detection) | Solidity, Flashbots | 📋 Planned |
| 5 | Smart contract security auditing | Slither, Mythril, CTFs | 📋 Planned |
Learning resources in progress: CryptoZombies, Ethernaut, Damn Vulnerable DeFi
Source code is private — links point to the MQL5 Marketplace.
| Product | Description | Version |
|---|---|---|
| Trade Manager PRO | Position management — automated BE, trailing, partial closes, TP ladders, session filter, journal export | v7.10 |
| SafeScalperPro | Automated scalping EA with risk management and prop firm compliance | v3.0 |
Indicators: SmartMoney Concepts, Liquidity Heatmap, Volume Profile, Divergence Scanner, Order Flow, Correlation Matrix, Session Control, Account Analytics, Risk Manager
Utilities: PropGuard (prop firm compliance), Risk Manager (drawdown protection), Trade Journal, Position Sizer, News Filter
All products feature the unified ASQ Dark Theme built on shared includes (ASQ_Theme.mqh, ASQ_Common.mqh).
┌─────────────────────────────────────────────────────┐
│ EA / Bot / DApp │
├─────────────────────────────────────────────────────┤
│ ┌──────────┐ ┌──────────┐ ┌───────────────────┐ │
│ │ Signal │ │ Filter │ │ Risk Management │ │
│ │ Module │ │ Module │ │ Module │ │
│ └────┬─────┘ └────┬─────┘ └────────┬──────────┘ │
│ └──────────────┼─────────────────┘ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ Trade Management │ │
│ └────────┬─────────┘ │
│ ▼ │
│ ┌────────────────────┐ │
│ │ Execution Layer │ │
│ │ (Deterministic) │ │
│ └────────────────────┘ │
├─────────────────────────────────────────────────────┤
│ TradFi: MQL5/C# │ DeFi: Web3.py/Solidity │
└─────────────────────────────────────────────────────┘
Shared principles across TradFi & DeFi:
git clone https://github.com/e49nana/Algorithmic-trading.git
cd Algorithmic-trading
# ── TradFi ──
# MQL5: Copy to MetaTrader data folder (Indicators/, Experts/, Include/, Scripts/)
# NinjaTrader: Tools → Import → NinjaScript Add-On
# ── DeFi ──
cd defi/crypto-trade-bot
pip install -r requirements.txt
# Configure your API keys in config/
python -m pytest tests/ -q # 294 tests
| Domain | Languages | Frameworks & Tools |
|---|---|---|
| TradFi | MQL5, C# | MetaTrader 5, NinjaTrader |
| DeFi | Python, Solidity (learning) | Web3.py, ccxt, aiogram, Hardhat |
| Blockchain | — | Ethereum, Arbitrum, Polygon, Solana |
| Testing | Python | pytest (294 tests) |
| Smart Contracts | — | Uniswap V3 (Quoter, Router, Pool) |