3.4 Implement user-defined indicator management system and enhance chart capabilities
- Introduced a comprehensive user indicator management system in `components/charts/indicator_manager.py`, allowing users to create, edit, and manage custom indicators with JSON persistence. - Added new default indicators in `components/charts/indicator_defaults.py` to provide users with immediate options for technical analysis. - Enhanced the chart rendering capabilities by implementing the `create_chart_with_indicators` function in `components/charts/builder.py`, supporting both overlay and subplot indicators. - Updated the main application layout in `app.py` to include a modal for adding and editing indicators, improving user interaction. - Enhanced documentation to cover the new indicator system, including a quick guide for adding new indicators and detailed usage examples. - Added unit tests to ensure the reliability and functionality of the new indicator management features.
This commit is contained in:
30
config/indicators/templates/bollinger_bands_template.json
Normal file
30
config/indicators/templates/bollinger_bands_template.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "Bollinger Bands",
|
||||
"description": "Bollinger Bands volatility indicator",
|
||||
"type": "bollinger_bands",
|
||||
"display_type": "overlay",
|
||||
"default_parameters": {
|
||||
"period": 20,
|
||||
"std_dev": 2.0
|
||||
},
|
||||
"parameter_schema": {
|
||||
"period": {
|
||||
"type": "int",
|
||||
"min": 5,
|
||||
"max": 100,
|
||||
"default": 20,
|
||||
"description": "Period for middle line (SMA)"
|
||||
},
|
||||
"std_dev": {
|
||||
"type": "float",
|
||||
"min": 0.5,
|
||||
"max": 5.0,
|
||||
"default": 2.0,
|
||||
"description": "Standard deviation multiplier"
|
||||
}
|
||||
},
|
||||
"default_styling": {
|
||||
"color": "#6f42c1",
|
||||
"line_width": 1
|
||||
}
|
||||
}
|
||||
22
config/indicators/templates/ema_template.json
Normal file
22
config/indicators/templates/ema_template.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "Exponential Moving Average",
|
||||
"description": "Exponential Moving Average indicator",
|
||||
"type": "ema",
|
||||
"display_type": "overlay",
|
||||
"default_parameters": {
|
||||
"period": 12
|
||||
},
|
||||
"parameter_schema": {
|
||||
"period": {
|
||||
"type": "int",
|
||||
"min": 1,
|
||||
"max": 200,
|
||||
"default": 12,
|
||||
"description": "Period for EMA calculation"
|
||||
}
|
||||
},
|
||||
"default_styling": {
|
||||
"color": "#ff6b35",
|
||||
"line_width": 2
|
||||
}
|
||||
}
|
||||
38
config/indicators/templates/macd_template.json
Normal file
38
config/indicators/templates/macd_template.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "MACD",
|
||||
"description": "Moving Average Convergence Divergence",
|
||||
"type": "macd",
|
||||
"display_type": "subplot",
|
||||
"default_parameters": {
|
||||
"fast_period": 12,
|
||||
"slow_period": 26,
|
||||
"signal_period": 9
|
||||
},
|
||||
"parameter_schema": {
|
||||
"fast_period": {
|
||||
"type": "int",
|
||||
"min": 2,
|
||||
"max": 50,
|
||||
"default": 12,
|
||||
"description": "Fast EMA period"
|
||||
},
|
||||
"slow_period": {
|
||||
"type": "int",
|
||||
"min": 5,
|
||||
"max": 100,
|
||||
"default": 26,
|
||||
"description": "Slow EMA period"
|
||||
},
|
||||
"signal_period": {
|
||||
"type": "int",
|
||||
"min": 2,
|
||||
"max": 30,
|
||||
"default": 9,
|
||||
"description": "Signal line period"
|
||||
}
|
||||
},
|
||||
"default_styling": {
|
||||
"color": "#fd7e14",
|
||||
"line_width": 2
|
||||
}
|
||||
}
|
||||
22
config/indicators/templates/rsi_template.json
Normal file
22
config/indicators/templates/rsi_template.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "Relative Strength Index",
|
||||
"description": "RSI oscillator indicator",
|
||||
"type": "rsi",
|
||||
"display_type": "subplot",
|
||||
"default_parameters": {
|
||||
"period": 14
|
||||
},
|
||||
"parameter_schema": {
|
||||
"period": {
|
||||
"type": "int",
|
||||
"min": 2,
|
||||
"max": 50,
|
||||
"default": 14,
|
||||
"description": "Period for RSI calculation"
|
||||
}
|
||||
},
|
||||
"default_styling": {
|
||||
"color": "#20c997",
|
||||
"line_width": 2
|
||||
}
|
||||
}
|
||||
22
config/indicators/templates/sma_template.json
Normal file
22
config/indicators/templates/sma_template.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "Simple Moving Average",
|
||||
"description": "Simple Moving Average indicator",
|
||||
"type": "sma",
|
||||
"display_type": "overlay",
|
||||
"default_parameters": {
|
||||
"period": 20
|
||||
},
|
||||
"parameter_schema": {
|
||||
"period": {
|
||||
"type": "int",
|
||||
"min": 1,
|
||||
"max": 200,
|
||||
"default": 20,
|
||||
"description": "Period for SMA calculation"
|
||||
}
|
||||
},
|
||||
"default_styling": {
|
||||
"color": "#007bff",
|
||||
"line_width": 2
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user