TCPDashboard/config/indicators/templates/bollinger_bands_template.json
Vasily.onl b49e39dcb4 Implement multi-timeframe support for indicators
- Enhanced the `UserIndicator` class to include an optional `timeframe` attribute for custom indicator timeframes.
- Updated the `get_indicator_data` method in `MarketDataIntegrator` to fetch and calculate indicators based on the specified timeframe, ensuring proper data alignment and handling.
- Modified the `ChartBuilder` to pass the correct DataFrame for plotting indicators with different timeframes.
- Added UI elements in the indicator modal for selecting timeframes, improving user experience.
- Updated relevant JSON templates to include the new `timeframe` field for all indicators.
- Refactored the `prepare_chart_data` function to ensure it returns a DataFrame with a `DatetimeIndex` for consistent calculations.

This commit enhances the flexibility and usability of the indicator system, allowing users to analyze data across various timeframes.
2025-06-06 15:06:17 +08:00

36 lines
815 B
JSON

{
"name": "Bollinger Bands",
"description": "Bollinger Bands volatility indicator",
"type": "bollinger_bands",
"display_type": "overlay",
"timeframe": null,
"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 for Bollinger Bands"
},
"timeframe": {
"type": "string",
"default": null,
"description": "Indicator timeframe (e.g., '1h', '4h'). Null for chart timeframe."
}
},
"default_styling": {
"color": "#6f42c1",
"line_width": 1
}
}