Algorithmic Trading A-z With Python- Machine Le... Upd Link
Report: Algorithmic Trading A-Z with Python & Machine Learning
Subject Course: Algorithmic Trading A-Z with Python- Machine Le... Report Type: Course Overview & Curriculum Analysis Date: October 26, 2023
2. Python Environment Setup
pip install pandas numpy matplotlib scikit-learn ta yfinance backtrader
Libraries:
yfinance– free historical datapandas/numpy– data manipulationta– technical indicatorsscikit-learn– ML modelsbacktrader– backtesting frameworkmatplotlib– visualization
I. Advanced: LSTM (Long Short-Term Memory)
For price sequences, LSTMs capture long-term dependencies. Using TensorFlow/Keras:
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense, Dropout
def create_lstm_dataset(data, lookback=60):
X, y = [], []
for i in range(lookback, len(data)):
X.append(data[i-lookback:i])
y.append(data[i])
return np.array(X), np.array(y) Algorithmic Trading A-Z with Python- Machine Le...
Part 2: Data Acquisition & Feature Engineering (D-G)
Generate Trading Signals
test_data = data.iloc[split:].copy()
test_data['prediction'] = preds
test_data['signal'] = 0 # 1 = buy, -1 = sell
test_data.loc[test_data['prediction'] == 1, 'signal'] = 1
test_data.loc[test_data['prediction'] == 0, 'signal'] = -1
Phase II: Trading Strategies & Technical Analysis
- Momentum & Trend Following: Implementing Moving Averages (SMA/EMA), MACD, and Bollinger Bands.
- Mean Reversion: Strategies based on the assumption that asset prices revert to their mean (e.g., Pairs Trading, RSI).
- Performance Metrics: Evaluating strategies using the Sharpe Ratio, Sortino Ratio, Maximum Drawdown, and CAGR.
Level 3: Machine Learning (Advanced)
We move from static rules to predictive models.
Problem: Predict whether the price will go up (1) or down (0) in the next 5 minutes. Report: Algorithmic Trading A-Z with Python & Machine
Feature Set (X):
- Last 50 returns.
- Order book imbalance.
- Time of day.
- VIX level.
Label (y):
1 if Close(t+5) > Close(t), else 0. Libraries:
Part B: Setting Up Your Infrastructure (The "Zero" Day)
Do not start by building a Neural Network. Start by building a pipeline.