Redesign indicators panel: dynamic catalog, multi-instance, chart legend
- Build indicator list dynamically from class getMetadata() instead of hardcoded array - Remove checkboxes; single-click previews config, double-click adds to chart - Support multiple instances of same indicator type (unique IDs) - Add TradingView-style column legend overlay on chart (top-left) - Recalculate indicators when historical data is prefetched on scroll - Make indicator list and config panels scrollable (hidden scrollbars) - Remove AVAILABLE_INDICATORS from strategies/config.js
This commit is contained in:
@ -25,3 +25,19 @@ export const IndicatorRegistry = {
|
||||
stoch: StochasticIndicator,
|
||||
atr: ATRIndicator
|
||||
};
|
||||
|
||||
/**
|
||||
* Dynamically build the available indicators list from the registry.
|
||||
* Each indicator class provides its own name and description via getMetadata().
|
||||
*/
|
||||
export function getAvailableIndicators() {
|
||||
return Object.entries(IndicatorRegistry).map(([type, IndicatorClass]) => {
|
||||
const instance = new IndicatorClass({ type, params: {}, name: '' });
|
||||
const meta = instance.getMetadata();
|
||||
return {
|
||||
type,
|
||||
name: meta.name || type.toUpperCase(),
|
||||
description: meta.description || ''
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user