- Modular Strategy System - Each strategy in its own file
- Leverage Support - 1x to 125x leverage
- Risk Management - Control position size (% of account per trade)
- Stop Loss & Take Profit - Automatic risk controls
- Professional Strategies - Advanced indicators and logic
- Easy to Extend - Just drop new strategy files in the folder
backtest_pro.py # Main GUI application
strategies/
βββ base_strategy.py # Base class (inherit from this)
βββ sma_strategy.py # SMA Crossover
βββ rsi_strategy.py # RSI with dynamic levels
βββ macd_strategy.py # MACD with histogram
βββ bollinger_strategy.py # Bollinger Bands with squeeze
βββ scalping_strategy.py # High-frequency scalping
βββ grid_strategy.py # Grid trading for ranges
python backtest_pro.py- Leverage: 1x to 125x (like real exchanges)
- Risk per Trade: Default 2% (adjustable)
- Stop Loss: Automatic stop at X%
- Take Profit: Automatic profit taking
- Conservative: 1-3x leverage, 1-2% risk
- Moderate: 5-10x leverage, 2-3% risk
- Aggressive: 20-50x leverage, 3-5% risk
- Degen: 100-125x leverage, 5-10% risk
# strategies/my_strategy.py
from base_strategy import BaseStrategy
import backtrader as bt
class MyStrategy(BaseStrategy):
strategy_name = "My Custom Strategy" # This appears in dropdown
params = (
# Add your custom parameters here
('my_param', 20),
# Keep these for risk management
('printlog', False),
('risk_per_trade', 2.0),
('leverage', 1),
('stop_loss_pct', 2.0),
('take_profit_pct', 6.0),
('use_risk_management', True),
)
def __init__(self):
super().__init__()
# Initialize your indicators here
self.sma = bt.indicators.SMA(self.dataclose, period=self.params.my_param)
def buy_signal(self):
# Return True when you want to buy
return self.dataclose[0] > self.sma[0]
def sell_signal(self):
# Return True when you want to sell
return self.dataclose[0] < self.sma[0]That's it! Your strategy appears in the dropdown.
- Classic moving average crossover
- Best for: Trending markets
- Timeframes: 1h, 4h, 1d
- RSI with dynamic exit levels
- Best for: Ranging markets
- Timeframes: 15m, 30m, 1h
- MACD with histogram confirmation
- Best for: Momentum trading
- Timeframes: 30m, 1h, 4h
- Mean reversion with squeeze detection
- Best for: Volatile markets
- Timeframes: 15m, 1h, 4h
- High-frequency with tight stops
- Best for: 1m, 5m charts
- Use 10-20x leverage
- Automated grid with dynamic levels
- Best for: Sideways markets
- Timeframes: 5m, 15m, 30m
Strategy: Scalper Pro
Leverage: 10-20x
Risk per Trade: 1%
Stop Loss: 0.5%
Take Profit: 1%
Strategy: RSI Dynamic / MACD
Leverage: 5-10x
Risk per Trade: 2%
Stop Loss: 2%
Take Profit: 4-6%
Strategy: SMA Crossover / MACD
Leverage: 2-5x
Risk per Trade: 2-3%
Stop Loss: 3%
Take Profit: 10%
- 10x leverage + 10% gain = 100% profit
- 10x leverage + 10% loss = 100% loss
- Higher leverage = higher risk/reward
- 2% risk = Maximum 50 trades to blow account
- 5% risk = Maximum 20 trades to blow account
- Always use stop losses with leverage!
- Start with low leverage (1-5x) until profitable
- Backtest all timeframes to find the best
- Use risk management - Never risk more than 5%
- Different strategies for different markets:
- Trending β SMA, MACD
- Ranging β RSI, Bollinger, Grid
- Volatile β Scalper
- Combine strategies - Use different strategies for different pairs
- Leverage amplifies losses - 10x leverage means 10x losses too
- Past performance β future results
- Test on paper trading first
- Never trade money you can't afford to lose
- Check the
strategies/folder exists - Ensure strategy files have
strategy_nameattribute - Click "Reload Strategies" button
- Strategy signals too restrictive
- Try different timeframes
- Adjust strategy parameters
pip install tkinter pandas numpy backtrader ccxt matplotlibWith proper settings you should see:
- Win Rate: 40-60% (typical)
- Total Return: Varies greatly with leverage
- Sharpe Ratio: > 1.5 (good)
- Max Drawdown: < 20% (with risk management)
- Run:
python backtest_pro.py - Select a strategy
- Set leverage (start with 1-5x)
- Set risk per trade (2%)
- Click "Test All Timeframes"
- Find best performing setup
- Create your own strategies!
Remember: This is for backtesting only. Real trading involves real risk!