إطار Backtrader
إطار اختبار خلفي متكامل قائم على الأحداث. بناء واختبار وتحسين استراتيجيات التداول مع مؤشرات ومحللات مدمجة.
التثبيت
بنية الإطار
Cerebro Engine
Central coordinator managing strategies, data feeds, and execution
Strategy Classes
Define your trading logic with init(), next(), and notify methods
Indicators
100+ built-in technical indicators and easy custom indicator creation
Analyzers
Calculate performance metrics like Sharpe ratio, drawdown, and returns
أمثلة كود شاملة
Your First Backtrader Strategy
Simple SMA crossover strategy implementation
Using Built-in Indicators
Leverage backtrader's extensive indicator library
Advanced Order Types
Market, limit, stop, and bracket orders
Position Sizing Strategies
Fixed, percentage, and Kelly criterion sizing
Performance Analysis
Use analyzers to calculate metrics
Parameter Optimization
Find optimal strategy parameters
Walk-Forward Analysis
Avoid overfitting with out-of-sample testing
Live Trading Integration
Connect to live broker feeds
أفضل الممارسات
استخدم المحللات
Always add analyzers to track performance metrics automatically
اختبار المشي للأمام
Validate strategies with out-of-sample data to avoid overfitting
حجم المركز
Implement proper risk management with custom sizers
تجنب انحياز الاستباق
Never access future data in your strategy logic
العمولة والانزلاق
Always include realistic commission and slippage in backtests
جودة البيانات
Ensure clean, adjusted data for accurate backtest results
الموارد
الموارد الرسمية
المجتمع
- Backtrader Community Forum
- GitHub Examples Repository