Implement modular chart layers and error handling for Crypto Trading Bot Dashboard - Introduced a comprehensive chart layer system in `components/charts/layers/` to support various technical indicators and subplots. - Added base layer components including `BaseLayer`, `CandlestickLayer`, and `VolumeLayer` for flexible chart rendering. - Implemented overlay indicators such as `SMALayer`, `EMALayer`, and `BollingerBandsLayer` with robust error handling. - Created subplot layers for indicators like `RSILayer` and `MACDLayer`, enhancing visualization capabilities. - Developed a `MarketDataIntegrator` for seamless data fetching and validation, improving data quality assurance. - Enhanced error handling utilities in `components/charts/error_handling.py` to manage insufficient data scenarios effectively. - Updated documentation to reflect the new chart layer architecture and usage guidelines. - Added unit tests for all chart layer components to ensure functionality and reliability.
100 lines
2.3 KiB
Python
100 lines
2.3 KiB
Python
"""
|
|
Chart Layers Package
|
|
|
|
This package contains the modular layer system for building complex charts
|
|
with multiple indicators, signals, and subplots.
|
|
|
|
Components:
|
|
- BaseChartLayer: Abstract base class for all layers
|
|
- CandlestickLayer: OHLC price chart layer
|
|
- VolumeLayer: Volume subplot layer
|
|
- LayerManager: Orchestrates multiple layers
|
|
- SMALayer: Simple Moving Average indicator overlay
|
|
- EMALayer: Exponential Moving Average indicator overlay
|
|
- BollingerBandsLayer: Bollinger Bands overlay with fill area
|
|
- RSILayer: RSI oscillator subplot
|
|
- MACDLayer: MACD lines and histogram subplot
|
|
"""
|
|
|
|
from .base import (
|
|
BaseChartLayer,
|
|
CandlestickLayer,
|
|
VolumeLayer,
|
|
LayerManager,
|
|
LayerConfig
|
|
)
|
|
|
|
from .indicators import (
|
|
BaseIndicatorLayer,
|
|
IndicatorLayerConfig,
|
|
SMALayer,
|
|
EMALayer,
|
|
BollingerBandsLayer,
|
|
create_sma_layer,
|
|
create_ema_layer,
|
|
create_bollinger_bands_layer,
|
|
create_common_ma_layers,
|
|
create_common_overlay_indicators
|
|
)
|
|
|
|
from .subplots import (
|
|
BaseSubplotLayer,
|
|
SubplotLayerConfig,
|
|
RSILayer,
|
|
MACDLayer,
|
|
create_rsi_layer,
|
|
create_macd_layer,
|
|
create_common_subplot_indicators
|
|
)
|
|
|
|
__all__ = [
|
|
# Base layers
|
|
'BaseChartLayer',
|
|
'CandlestickLayer',
|
|
'VolumeLayer',
|
|
'LayerManager',
|
|
'LayerConfig',
|
|
|
|
# Indicator layers (overlays)
|
|
'BaseIndicatorLayer',
|
|
'IndicatorLayerConfig',
|
|
'SMALayer',
|
|
'EMALayer',
|
|
'BollingerBandsLayer',
|
|
|
|
# Subplot layers
|
|
'BaseSubplotLayer',
|
|
'SubplotLayerConfig',
|
|
'RSILayer',
|
|
'MACDLayer',
|
|
|
|
# Convenience functions
|
|
'create_sma_layer',
|
|
'create_ema_layer',
|
|
'create_bollinger_bands_layer',
|
|
'create_common_ma_layers',
|
|
'create_common_overlay_indicators',
|
|
'create_rsi_layer',
|
|
'create_macd_layer',
|
|
'create_common_subplot_indicators'
|
|
]
|
|
|
|
__version__ = "0.1.0"
|
|
|
|
# Package metadata
|
|
# __version__ = "0.1.0"
|
|
# __package_name__ = "layers"
|
|
|
|
# Layers will be imported once they are created
|
|
# from .base import BaseCandlestickLayer
|
|
# from .indicators import IndicatorLayer
|
|
# from .subplots import SubplotManager
|
|
# from .signals import SignalLayer
|
|
|
|
# Public exports (will be populated as layers are implemented)
|
|
# __all__ = [
|
|
# # "BaseCandlestickLayer",
|
|
# # "IndicatorLayer",
|
|
# # "SubplotManager",
|
|
# # "SignalLayer"
|
|
# ] |