-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindicators_config.py
More file actions
287 lines (240 loc) · 7.43 KB
/
Copy pathindicators_config.py
File metadata and controls
287 lines (240 loc) · 7.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
"""
Technical Indicators Configuration
Constants and parameters for all technical indicators used in trading
"""
class IndicatorParams:
"""Parameters for technical indicators"""
# Basic momentum indicators
RSI_PERIOD = 14
RSI_DEFAULT = 50.0
# MACD parameters
MACD_FAST = 12
MACD_SLOW = 26
MACD_SIGNAL = 9
# Bollinger Bands
BB_LENGTH = 20
BB_STD = 2.0
# ATR (Average True Range)
ATR_PERIOD = 14
# Stochastic
STOCH_K = 14
STOCH_D = 3
STOCH_SMOOTHING = 3
# ADX (Average Directional Index)
ADX_PERIOD = 14
ADX_THRESHOLD = 25 # Trend strength threshold
# ROC (Rate of Change)
ROC_PERIOD = 10
# Williams %R
WILLR_PERIOD = 14
# CCI (Commodity Channel Index)
CCI_PERIOD = 14
CCI_CONSTANT = 0.015
# MFI (Money Flow Index)
MFI_PERIOD = 14
# Supertrend
SUPERTREND_PERIOD = 10
SUPERTREND_MULTIPLIER = 3.0
# Moving Averages
SMA_SHORT = 20
SMA_LONG = 50
EMA_SHORT = 12
EMA_LONG = 26
# Volume indicators
VWAP_PERIOD = 20
VOLUME_RATIO_PERIOD = 20
# Additional indicators we might add
# These are available in pandas_ta:
# - Ichimoku Cloud
# - Parabolic SAR
# - Fibonacci Retracement
# - Elliott Wave
# - Heiken Ashi
# - Pivot Points
# - Woodie's Pivot Points
# - Camarilla Pivot Points
# - Demark Pivot Points
# - Fibonacci Pivot Points
# - Gann Pivot Points
# - ...
class IndicatorNormalization:
"""Normalization parameters for indicators"""
# Price normalization (using MinMaxScaler)
PRICE_SCALER_RANGE = (0, 1)
PRICE_SCALER_MIN_SAMPLES = 100
# RSI already normalized (0-100)
RSI_NORMALIZE = True
# MACD needs normalization
MACD_NORMALIZE_FACTOR = 100.0
# Bollinger Bands position (0-1)
BB_POSITION_NORMALIZE = True
# Volume normalization
VOLUME_NORMALIZE_FACTOR = 10.0
VOLUME_NORMALIZE_LOG = True
# ADX normalization (0-100 to 0-1)
ADX_NORMALIZE_FACTOR = 100.0
# ROC normalization
ROC_NORMALIZE_FACTOR = 10.0
# Williams %R normalization (-100 to 0 to 0-1)
WILLR_NORMALIZE_SHIFT = 100
WILLR_NORMALIZE_FACTOR = 100.0
# CCI normalization (use tanh)
CCI_NORMALIZE_FACTOR = 100.0
CCI_USE_TANH = True
# MFI normalization (0-100 to 0-1)
MFI_NORMALIZE_FACTOR = 100.0
# Supertrend already normalized (-1, 0, 1)
SUPERTREND_NORMALIZE = False
# ATR normalization
ATR_NORMALIZE_FACTOR = 5.0
# Stochastic normalization (0-100 to 0-1)
STOCH_NORMALIZE_FACTOR = 100.0
class AvailableIndicators:
"""List of all available indicators in pandas_ta"""
# Overlap Studies
OVERLAP = [
'sma', # Simple Moving Average
'ema', # Exponential Moving Average
'wma', # Weighted Moving Average
'dema', # Double Exponential Moving Average
'tema', # Triple Exponential Moving Average
'kama', # Kaufman's Adaptive Moving Average
'hma', # Hull Moving Average
'zlma', # Zero Lag Moving Average
'linreg', # Linear Regression
'vwma', # Volume Weighted Moving Average
'supertrend', # Supertrend
'ichimoku', # Ichimoku Cloud
'psar', # Parabolic SAR
]
# Momentum Indicators
MOMENTUM = [
'rsi', # Relative Strength Index
'stoch', # Stochastic Oscillator
'macd', # MACD
'adx', # Average Directional Index
'roc', # Rate of Change
'willr', # Williams %R
'cci', # Commodity Channel Index
'mfi', # Money Flow Index
'obv', # On Balance Volume
'atr', # Average True Range
'kst', # Know Sure Thing
'dpo', # Detrended Price Oscillator
'aroon', # Aroon Indicator
'bop', # Balance of Power
'cti', # Commodity Trend Index
'dm', # Directional Movement
'uo', # Ultimate Oscillator
'rsx', # Relative Strength Xtra
'trix', # Triple Exponential Average
'er', # Elder's Force Index
'cfo', # Chande Forecast Oscillator
'vfi', # Volume Flow Indicator
'vortex', # Vortex Indicator
]
# Volatility Indicators
VOLATILITY = [
'bbands', # Bollinger Bands
'kc', # Keltner Channels
'donchian', # Donchian Channels
'mavg', # Moving Average Channel
'hma', # Hull Moving Average
'rvi', # Relative Volatility Index
]
# Volume Indicators
VOLUME = [
'ad', # Accumulation/Distribution Line
'adosc', # Accumulation/Distribution Oscillator
'obv', # On Balance Volume
'efi', # Elder's Force Index
'emv', # Ease of Movement
'fi', # Force Index
'mfi', # Money Flow Index
'nvi', # Negative Volume Index
'pvi', # Positive Volume Index
'vpt', # Volume Price Trend
'vwap', # Volume Weighted Average Price
'pvol', # Price-Volume
]
# Pattern Recognition
PATTERNS = [
'cdl_doji', # Doji
'cdl_engulfing', # Engulfing Pattern
'cdl_harami', # Harami Pattern
'cdl_marubozu', # Marubozu
'cdl_inside', # Inside Bar
'cdl_outside', # Outside Bar
# ... many more candlestick patterns
]
# Statistics
STATISTICS = [
'entropy', # Entropy
'kurtosis', # Kurtosis
'mad', # Mean Absolute Deviation
'median', # Median
'quantile', # Quantile
'skew', # Skewness
'stdev', # Standard Deviation
'var', # Variance
'zscore', # Z-Score
]
# Cycles
CYCLES = [
'sinc', # Sine Wave
'sinwma', # Sine Weighted Moving Average
'fft', # Fast Fourier Transform
]
# Math Operations
MATH = [
'log_return', # Log Return
'pct_change', # Percent Change
'cumsum', # Cumulative Sum
'diff', # Difference
'abs', # Absolute Value
]
# Additional indicators we could implement manually:
CUSTOM_INDICATORS = [
'Fibonacci Retracement',
'Elliott Wave Counter',
'Market Profile',
'Volume Profile',
'Order Book Analysis',
'Time Segmented Volume',
'Weis Wave Volume',
'Wyckoff Method',
'Support/Resistance Levels',
'Trend Lines',
'Chart Patterns (Triangles, Flags, Pennants, etc.)',
'Gann Fans',
'Fibonacci Extensions',
'Pivot Points (various types)',
'Market Breadth Indicators',
'Sentiment Indicators',
'Economic Indicators',
'News Analysis',
'Order Flow Analysis',
'Liquidity Analysis',
]
# Feature combinations we could create:
FEATURE_COMBINATIONS = [
# Momentum combinations
'RSI + ROC',
'MACD + Signal cross',
'ADX + DI+/DI-',
# Volatility combinations
'ATR + BB width',
'KC width + BB width',
'Historical volatility + Implied volatility',
# Volume-price combinations
'OBV + Price trend',
'Volume + Range',
'Volume weighted price action',
# Multi-timeframe
'Short term + Long term indicators',
'Higher timeframe trend + Lower timeframe entry',
# Pattern-based
'Support/Resistence bounce',
'Breakout confirmation',
'Trend continuation',
]