data fixes, partial custom indicator support

This commit is contained in:
2026-04-08 21:28:31 -04:00
parent b701554996
commit a70dcd954f
81 changed files with 5438 additions and 1852 deletions

View File

@@ -1,6 +1,63 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
export interface CustomIndicatorParam {
type: 'int' | 'float' | 'bool' | 'string'
default: any
description?: string
min?: number
max?: number
}
/**
* Per-series plot configuration.
* style maps to LineStudyPlotStyle: 0=Line, 1=Histogram, 3=Dots/Cross,
* 4=Area, 5=Columns, 6=Circles, 9=StepLine.
*/
export interface PlotConfig {
style: number
color?: string
linewidth?: number
visible?: boolean
}
/** Shaded region between two plots ("plot_plot") or two bands ("hline_hline"). */
export interface FilledAreaConfig {
id: string
type: 'plot_plot' | 'hline_hline'
series1: string
series2: string
color?: string
opacity?: number
}
/** Horizontal reference line (e.g. RSI ob/os). linestyle: 0=solid, 1=dotted, 2=dashed. */
export interface BandConfig {
id: string
value: number
color?: string
linewidth?: number
linestyle?: number
visible?: boolean
}
export interface CustomIndicatorColumn {
name: string
display_name?: string
description?: string
plot?: PlotConfig
}
export interface CustomIndicatorMetadata {
display_name: string
parameters: Record<string, CustomIndicatorParam>
input_series: string[]
output_columns: CustomIndicatorColumn[]
pane: 'price' | 'separate'
filled_areas?: FilledAreaConfig[]
bands?: BandConfig[]
}
export interface IndicatorInstance {
id: string
pandas_ta_name: string
@@ -15,6 +72,8 @@ export interface IndicatorInstance {
created_at?: number
modified_at?: number
original_id?: string
/** Populated for custom_ indicators; drives TV custom study auto-construction. */
custom_metadata?: CustomIndicatorMetadata
}
export const useIndicatorStore = defineStore('indicators', () => {