Documentation
¶
Index ¶
- Constants
- Variables
- type ActiveChartInfo
- type AlertsApiProbe
- type AvailableCurrency
- type AvailableUnit
- type BatchDeleteError
- type BatchDeleteResult
- type ChartApiProbe
- type ChartExportResult
- type ChartInfo
- type ChartToggles
- type Client
- func (c *Client) ActivateChart(ctx context.Context, index int) (LayoutStatus, error)
- func (c *Client) ActivateReplay(ctx context.Context, chartID string, date float64) (map[string]any, error)
- func (c *Client) ActivateReplayAuto(ctx context.Context, chartID string) (map[string]any, error)
- func (c *Client) AddIndicatorBySearch(ctx context.Context, chartID, query string, index int) (IndicatorAddResult, error)
- func (c *Client) AddPineToChart(ctx context.Context) (PineState, error)
- func (c *Client) AddStudy(ctx context.Context, chartID, name string, inputs map[string]any, ...) (Study, error)
- func (c *Client) AddWatchlistSymbols(ctx context.Context, id string, symbols []string) (WatchlistDetail, error)
- func (c *Client) AppendColoredWatchlist(ctx context.Context, color string, symbols []string) (ColoredWatchlist, error)
- func (c *Client) ApplyStudyTemplate(ctx context.Context, chartID, name string) (StudyTemplateApplyResult, error)
- func (c *Client) BrowserScreenshot(ctx context.Context, format string, quality int, fullPage bool) ([]byte, error)
- func (c *Client) BulkRemoveColoredWatchlist(ctx context.Context, symbols []string) error
- func (c *Client) ChangeAutoplayDelay(ctx context.Context, chartID string, delay float64) (float64, error)
- func (c *Client) CloneAlerts(ctx context.Context, ids []string) error
- func (c *Client) CloneDrawing(ctx context.Context, chartID, shapeID string) (string, error)
- func (c *Client) CloneLayout(ctx context.Context, name string) (LayoutActionResult, error)
- func (c *Client) Close() error
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) CreateAlert(ctx context.Context, params map[string]any) (any, error)
- func (c *Client) CreateDrawing(ctx context.Context, chartID string, point ShapePoint, options map[string]any) (string, error)
- func (c *Client) CreateMultipointDrawing(ctx context.Context, chartID string, points []ShapePoint, ...) (string, error)
- func (c *Client) CreateNote(ctx context.Context, symbolFull, description, title, snapshotUID string) (Note, error)
- func (c *Client) CreateTweetDrawing(ctx context.Context, chartID string, tweetURL string) (TweetDrawingResult, error)
- func (c *Client) CreateWatchlist(ctx context.Context, name string) (WatchlistInfo, error)
- func (c *Client) DeactivateReplay(ctx context.Context, chartID string) error
- func (c *Client) DeepHealthCheck(ctx context.Context) (DeepHealthResult, error)
- func (c *Client) DeleteAlerts(ctx context.Context, ids []string) error
- func (c *Client) DeleteAllFires(ctx context.Context) error
- func (c *Client) DeleteFires(ctx context.Context, ids []string) error
- func (c *Client) DeleteLayout(ctx context.Context, id int) (LayoutActionResult, error)
- func (c *Client) DeleteNote(ctx context.Context, noteID int) error
- func (c *Client) DeleteWatchlist(ctx context.Context, id string) error
- func (c *Client) DismissDialog(ctx context.Context) (LayoutActionResult, error)
- func (c *Client) EditNote(ctx context.Context, noteID int, description, title, snapshotUID string) (Note, error)
- func (c *Client) EnableNetworkDomain(ctx context.Context) error
- func (c *Client) ExecuteAction(ctx context.Context, chartID, actionID string) error
- func (c *Client) ExportChartData(ctx context.Context, chartID string) (ChartExportResult, error)
- func (c *Client) ExportDrawingsState(ctx context.Context, chartID string) (any, error)
- func (c *Client) FlagSymbol(ctx context.Context, id, symbol string) error
- func (c *Client) GetActiveChart(ctx context.Context) (ActiveChartInfo, error)
- func (c *Client) GetActiveStrategy(ctx context.Context, chartID string) (map[string]any, error)
- func (c *Client) GetActiveWatchlist(ctx context.Context) (WatchlistDetail, error)
- func (c *Client) GetAlerts(ctx context.Context, ids []string) (any, error)
- func (c *Client) GetAvailableCurrencies(ctx context.Context, chartID string) ([]AvailableCurrency, error)
- func (c *Client) GetAvailableUnits(ctx context.Context, chartID string) ([]AvailableUnit, error)
- func (c *Client) GetChartToggles(ctx context.Context, chartID string) (ChartToggles, error)
- func (c *Client) GetChartType(ctx context.Context, chartID string) (int, error)
- func (c *Client) GetCurrency(ctx context.Context, chartID string) (CurrencyInfo, error)
- func (c *Client) GetDrawing(ctx context.Context, chartID, shapeID string) (map[string]any, error)
- func (c *Client) GetDrawingToggles(ctx context.Context, chartID string) (DrawingToggles, error)
- func (c *Client) GetDrawingTool(ctx context.Context, chartID string) (string, error)
- func (c *Client) GetHotlistExchanges(ctx context.Context) ([]HotlistExchangeDetail, error)
- func (c *Client) GetHotlistMarkets(ctx context.Context) (any, error)
- func (c *Client) GetLayoutFavorite(ctx context.Context) (LayoutFavoriteResult, error)
- func (c *Client) GetLayoutStatus(ctx context.Context) (LayoutStatus, error)
- func (c *Client) GetOneHotlist(ctx context.Context, exchange, group string) (HotlistResult, error)
- func (c *Client) GetPaneInfo(ctx context.Context) (PanesResult, error)
- func (c *Client) GetPineConsole(ctx context.Context) ([]PineConsoleMessage, error)
- func (c *Client) GetPineSource(ctx context.Context) (PineState, error)
- func (c *Client) GetPineStatus(ctx context.Context) (PineState, error)
- func (c *Client) GetReplayStatus(ctx context.Context, chartID string) (ReplayStatus, error)
- func (c *Client) GetResolution(ctx context.Context, chartID string) (string, error)
- func (c *Client) GetStrategyDateRange(ctx context.Context, chartID string) (any, error)
- func (c *Client) GetStrategyReport(ctx context.Context, chartID string) (map[string]any, error)
- func (c *Client) GetStudyInputs(ctx context.Context, chartID, studyID string) (StudyDetail, error)
- func (c *Client) GetStudyTemplate(ctx context.Context, id int) (StudyTemplateEntry, error)
- func (c *Client) GetSymbol(ctx context.Context, chartID string) (string, error)
- func (c *Client) GetSymbolInfo(ctx context.Context, chartID string) (SymbolInfo, error)
- func (c *Client) GetUnit(ctx context.Context, chartID string) (UnitInfo, error)
- func (c *Client) GetVisibleRange(ctx context.Context, chartID string) (VisibleRange, error)
- func (c *Client) GetWatchlist(ctx context.Context, id string) (WatchlistDetail, error)
- func (c *Client) GoToDate(ctx context.Context, chartID string, timestamp int64) error
- func (c *Client) ImportDrawingsState(ctx context.Context, chartID string, state any) error
- func (c *Client) ListAlerts(ctx context.Context) (any, error)
- func (c *Client) ListCharts(ctx context.Context) ([]ChartInfo, error)
- func (c *Client) ListColoredWatchlists(ctx context.Context) ([]ColoredWatchlist, error)
- func (c *Client) ListDrawings(ctx context.Context, chartID string) ([]Shape, error)
- func (c *Client) ListFavoriteIndicators(ctx context.Context, chartID string) (IndicatorSearchResult, error)
- func (c *Client) ListFires(ctx context.Context) (any, error)
- func (c *Client) ListLayouts(ctx context.Context) ([]LayoutInfo, error)
- func (c *Client) ListNotes(ctx context.Context, symbol string) ([]Note, error)
- func (c *Client) ListStrategies(ctx context.Context, chartID string) (any, error)
- func (c *Client) ListStudies(ctx context.Context, chartID string) ([]Study, error)
- func (c *Client) ListStudyTemplates(ctx context.Context) (StudyTemplateList, error)
- func (c *Client) ListWatchlists(ctx context.Context) ([]WatchlistInfo, error)
- func (c *Client) MaximizeChart(ctx context.Context) (LayoutStatus, error)
- func (c *Client) ModifyAlert(ctx context.Context, params map[string]any) (any, error)
- func (c *Client) ModifyStudyInputs(ctx context.Context, chartID, studyID string, inputs map[string]any) (StudyDetail, error)
- func (c *Client) NextChart(ctx context.Context) (ActiveChartInfo, error)
- func (c *Client) PinWatchlist(ctx context.Context, id string) (WatchlistInfo, error)
- func (c *Client) PineCommandPalette(ctx context.Context) (PineState, error)
- func (c *Client) PineDeleteLine(ctx context.Context, count int) (PineState, error)
- func (c *Client) PineFindReplace(ctx context.Context, find, replace string) (PineState, error)
- func (c *Client) PineGoToLine(ctx context.Context, line int) (PineState, error)
- func (c *Client) PineInsertLineAbove(ctx context.Context) (PineState, error)
- func (c *Client) PineMoveLine(ctx context.Context, direction string, count int) (PineState, error)
- func (c *Client) PineNewIndicator(ctx context.Context) (PineState, error)
- func (c *Client) PineNewStrategy(ctx context.Context) (PineState, error)
- func (c *Client) PineNewTab(ctx context.Context) (PineState, error)
- func (c *Client) PineOpenScript(ctx context.Context, name string) (PineState, error)
- func (c *Client) PineRedo(ctx context.Context) (PineState, error)
- func (c *Client) PineToggleComment(ctx context.Context) (PineState, error)
- func (c *Client) PineToggleConsole(ctx context.Context) (PineState, error)
- func (c *Client) PineUndo(ctx context.Context) (PineState, error)
- func (c *Client) PrevChart(ctx context.Context) (ActiveChartInfo, error)
- func (c *Client) ProbeAlertsRestApi(ctx context.Context, chartID string) (AlertsApiProbe, error)
- func (c *Client) ProbeAlertsRestApiDeep(ctx context.Context, chartID string) (map[string]any, error)
- func (c *Client) ProbeBacktestingApi(ctx context.Context, chartID string) (StrategyApiProbe, error)
- func (c *Client) ProbeChartApi(ctx context.Context, chartID string) (ChartApiProbe, error)
- func (c *Client) ProbeChartApiDeep(ctx context.Context, chartID string) (map[string]any, error)
- func (c *Client) ProbeDataWindow(ctx context.Context, chartID string) (DataWindowProbe, error)
- func (c *Client) ProbeHotlistsManager(ctx context.Context) (HotlistsManagerProbe, error)
- func (c *Client) ProbeHotlistsManagerDeep(ctx context.Context) (map[string]any, error)
- func (c *Client) ProbeIndicatorDialogDOM(ctx context.Context) (map[string]any, error)
- func (c *Client) ProbePineDOM(ctx context.Context) (map[string]any, error)
- func (c *Client) ProbeReplayManager(ctx context.Context, chartID string) (ReplayManagerProbe, error)
- func (c *Client) ProbeReplayManagerDeep(ctx context.Context, chartID string) (map[string]any, error)
- func (c *Client) RedoChart(ctx context.Context, chartID string) error
- func (c *Client) RegisterCDPEventHandler(method string, fn func(sessionID string, params json.RawMessage)) (func(), error)
- func (c *Client) ReloadPage(ctx context.Context, chartID string, hard bool) error
- func (c *Client) RemoveAllDrawings(ctx context.Context, chartID string) error
- func (c *Client) RemoveColoredWatchlist(ctx context.Context, color string, symbols []string) (ColoredWatchlist, error)
- func (c *Client) RemoveDrawing(ctx context.Context, chartID, shapeID string, disableUndo bool) error
- func (c *Client) RemoveStudy(ctx context.Context, chartID, studyID string) error
- func (c *Client) RemoveWatchlistSymbols(ctx context.Context, id string, symbols []string) (WatchlistDetail, error)
- func (c *Client) RenameLayout(ctx context.Context, name string) (LayoutActionResult, error)
- func (c *Client) RenameWatchlist(ctx context.Context, id, name string) (WatchlistInfo, error)
- func (c *Client) ReplaceColoredWatchlist(ctx context.Context, color string, symbols []string) (ColoredWatchlist, error)
- func (c *Client) ReplayStep(ctx context.Context, chartID string, count int) error
- func (c *Client) ResetReplay(ctx context.Context, chartID string) error
- func (c *Client) ResetScales(ctx context.Context, chartID string) error
- func (c *Client) ResetView(ctx context.Context, chartID string) error
- func (c *Client) ResolveSymbol(ctx context.Context, chartID, symbol string) (ResolvedSymbolInfo, error)
- func (c *Client) RestartAlerts(ctx context.Context, ids []string) error
- func (c *Client) SaveLayout(ctx context.Context) (LayoutActionResult, error)
- func (c *Client) SavePineScript(ctx context.Context) (PineState, error)
- func (c *Client) ScanAlertsAccess(ctx context.Context, chartID string) (map[string]any, error)
- func (c *Client) ScanReplayActivation(ctx context.Context, chartID string) (map[string]any, error)
- func (c *Client) Scroll(ctx context.Context, chartID string, bars int) error
- func (c *Client) SearchIndicators(ctx context.Context, chartID, query string) (IndicatorSearchResult, error)
- func (c *Client) SetActiveStrategy(ctx context.Context, chartID, strategyID string) error
- func (c *Client) SetActiveWatchlist(ctx context.Context, id string) (WatchlistInfo, error)
- func (c *Client) SetChartType(ctx context.Context, chartID string, chartType int) (int, error)
- func (c *Client) SetCurrency(ctx context.Context, chartID, currency string) (CurrencyInfo, error)
- func (c *Client) SetDrawingTool(ctx context.Context, chartID, tool string) error
- func (c *Client) SetDrawingVisibility(ctx context.Context, chartID, shapeID string, visible bool) error
- func (c *Client) SetDrawingZOrder(ctx context.Context, chartID, shapeID, action string) error
- func (c *Client) SetHideDrawings(ctx context.Context, chartID string, val bool) error
- func (c *Client) SetLayoutGrid(ctx context.Context, template string) (LayoutStatus, error)
- func (c *Client) SetLockDrawings(ctx context.Context, chartID string, val bool) error
- func (c *Client) SetMagnet(ctx context.Context, chartID string, enabled bool, mode int) error
- func (c *Client) SetPineSource(ctx context.Context, source string) (PineState, error)
- func (c *Client) SetResolution(ctx context.Context, chartID, resolution string) (string, error)
- func (c *Client) SetStrategyInput(ctx context.Context, chartID, name string, value any) error
- func (c *Client) SetSymbol(ctx context.Context, chartID, symbol string) (string, error)
- func (c *Client) SetTimeFrame(ctx context.Context, chartID, preset, resolution string) (TimeFrameResult, error)
- func (c *Client) SetUnit(ctx context.Context, chartID, unit string) (UnitInfo, error)
- func (c *Client) SetVisibleRange(ctx context.Context, chartID string, from, to float64) (VisibleRange, error)
- func (c *Client) StartAutoplay(ctx context.Context, chartID string) error
- func (c *Client) StartReplay(ctx context.Context, chartID string, point float64) error
- func (c *Client) StopAlerts(ctx context.Context, ids []string) error
- func (c *Client) StopAutoplay(ctx context.Context, chartID string) error
- func (c *Client) StopReplay(ctx context.Context, chartID string) error
- func (c *Client) StrategyGotoDate(ctx context.Context, chartID string, timestamp float64, belowBar bool) error
- func (c *Client) SwitchLayout(ctx context.Context, id int) (LayoutActionResult, error)
- func (c *Client) SwitchTimezone(ctx context.Context, chartID, tz string) error
- func (c *Client) TakeServerSnapshot(ctx context.Context) (ServerSnapshotResult, error)
- func (c *Client) TakeSnapshot(ctx context.Context, chartID, format, quality string, hideRes bool) (SnapshotResult, error)
- func (c *Client) ToggleAutoScale(ctx context.Context, chartID string) error
- func (c *Client) ToggleExtendedHours(ctx context.Context, chartID string) error
- func (c *Client) ToggleFullscreen(ctx context.Context) (LayoutStatus, error)
- func (c *Client) ToggleIndicatorFavorite(ctx context.Context, chartID, query string, index int) (IndicatorFavoriteResult, error)
- func (c *Client) ToggleLayoutFavorite(ctx context.Context) (LayoutFavoriteResult, error)
- func (c *Client) ToggleLogScale(ctx context.Context, chartID string) error
- func (c *Client) TogglePineEditor(ctx context.Context) (PineState, error)
- func (c *Client) UndoChart(ctx context.Context, chartID string) error
- func (c *Client) Zoom(ctx context.Context, chartID, direction string) error
- type CodedError
- type ColoredWatchlist
- type CurrencyInfo
- type DataWindowProbe
- type DeepHealthResult
- type DrawingToggles
- type ExportSchemaColumn
- type HotlistExchangeDetail
- type HotlistGroupInfo
- type HotlistResult
- type HotlistSymbol
- type HotlistsManagerProbe
- type IndicatorAddResult
- type IndicatorFavoriteResult
- type IndicatorResult
- type IndicatorSearchResult
- type LayoutActionResult
- type LayoutDetail
- type LayoutFavoriteResult
- type LayoutInfo
- type LayoutStatus
- type Note
- type PaneInfo
- type PanesResult
- type PineConsoleMessage
- type PineState
- type ReloadResult
- type ReplayManagerProbe
- type ReplayStatus
- type ResolvedSymbolInfo
- type ServerSnapshotResult
- type Shape
- type ShapeGroup
- type ShapeInfo
- type ShapePoint
- type SnapshotChartInfo
- type SnapshotRawMeta
- type SnapshotResult
- type SnapshotSymbolMeta
- type StrategyApiProbe
- type Study
- type StudyDetail
- type StudyTemplateApplyResult
- type StudyTemplateEntry
- type StudyTemplateList
- type SymbolInfo
- type TimeFrameResult
- type TweetDrawingResult
- type UnitInfo
- type VisibleRange
- type WatchlistDetail
- type WatchlistInfo
Constants ¶
const ( CodeValidation = "VALIDATION" CodeChartNotFound = "CHART_NOT_FOUND" CodeEvalFailure = "EVAL_FAILURE" CodeEvalTimeout = "EVAL_TIMEOUT" CodeSnapshotNotFound = "SNAPSHOT_NOT_FOUND" CodeNoteNotFound = "NOTE_NOT_FOUND" )
Variables ¶
var ChartTypeMap = map[string]int{
"bars": 0,
"candles": 1,
"line": 2,
"area": 3,
"renko": 4,
"kagi": 5,
"point_and_figure": 6,
"line_break": 7,
"heikin_ashi": 8,
"hollow_candles": 9,
"baseline": 10,
"high_low": 12,
"columns": 13,
"line_with_markers": 14,
"step_line": 15,
"hlc_area": 16,
"volume_candles": 19,
"hlc_bars": 21,
}
ChartTypeMap maps human-readable chart type names to TradingView ChartStyle enum values.
var ChartTypeReverseMap = func() map[int]string { m := make(map[int]string, len(ChartTypeMap)) for name, id := range ChartTypeMap { m[id] = name } return m }()
ChartTypeReverseMap maps TradingView ChartStyle enum values back to human-readable names.
var KnownShapes = func() map[string]ShapeInfo { m := make(map[string]ShapeInfo) for _, g := range ShapeGroups { for _, s := range g.Shapes { m[s.Name] = s } } return m }()
KnownShapes is a flat lookup built from ShapeGroups for validation.
var ShapeGroups = []ShapeGroup{ {Category: "lines", Label: "Lines", Shapes: []ShapeInfo{ {Name: "trend_line", Label: "Trend Line", Points: 2}, {Name: "ray", Label: "Ray", Points: 2}, {Name: "info_line", Label: "Info Line", Points: 2}, {Name: "extended", Label: "Extended Line", Points: 2}, {Name: "trend_angle", Label: "Trend Angle", Points: 2}, {Name: "horizontal_line", Label: "Horizontal Line", Points: 1}, {Name: "horizontal_ray", Label: "Horizontal Ray", Points: 1}, {Name: "vertical_line", Label: "Vertical Line", Points: 1}, {Name: "cross_line", Label: "Cross Line", Points: 1}, }}, {Category: "channels", Label: "Channels", Shapes: []ShapeInfo{ {Name: "parallel_channel", Label: "Parallel Channel", Points: 3}, {Name: "regression_trend", Label: "Regression Trend", Points: 2}, {Name: "flat_bottom", Label: "Flat Top/Bottom", Points: 3}, {Name: "disjoint_angle", Label: "Disjoint Channel", Points: 3}, }}, {Category: "pitchforks", Label: "Pitchforks", Shapes: []ShapeInfo{ {Name: "pitchfork", Label: "Pitchfork", Points: 3}, {Name: "schiff_pitchfork", Label: "Schiff Pitchfork", Points: 3}, {Name: "schiff_pitchfork_modified", Label: "Modified Schiff Pitchfork", Points: 3}, {Name: "inside_pitchfork", Label: "Inside Pitchfork", Points: 3}, }}, {Category: "fibonacci", Label: "Fibonacci", Shapes: []ShapeInfo{ {Name: "fib_retracement", Label: "Fib Retracement", Points: 2}, {Name: "fib_trend_ext", Label: "Trend-Based Fib Extension", Points: 3}, {Name: "fib_channel", Label: "Fib Channel", Points: 3}, {Name: "fib_timezone", Label: "Fib Time Zone", Points: 2}, {Name: "fib_speed_resist_fan", Label: "Fib Speed Resistance Fan", Points: 2}, {Name: "fib_trend_time", Label: "Trend-Based Fib Time", Points: 3}, {Name: "fib_circles", Label: "Fib Circles", Points: 2}, {Name: "fib_spiral", Label: "Fib Spiral", Points: 2}, {Name: "fib_speed_resist_arcs", Label: "Fib Speed Resistance Arcs", Points: 2}, {Name: "fib_wedge", Label: "Fib Wedge", Points: 3}, {Name: "pitchfan", Label: "Pitchfan", Points: 3}, }}, {Category: "gann", Label: "Gann", Shapes: []ShapeInfo{ {Name: "gannbox_square", Label: "Gann Box", Points: 2}, {Name: "gannbox_fixed", Label: "Gann Square Fixed", Points: 2}, {Name: "gannbox", Label: "Gann Square", Points: 2}, {Name: "gannbox_fan", Label: "Gann Fan", Points: 2}, }}, {Category: "patterns", Label: "Patterns", Shapes: []ShapeInfo{ {Name: "xabcd_pattern", Label: "XABCD Pattern", Points: 5}, {Name: "cypher_pattern", Label: "Cypher Pattern", Points: 5}, {Name: "head_and_shoulders", Label: "Head and Shoulders", Points: 7}, {Name: "abcd_pattern", Label: "ABCD Pattern", Points: 4}, {Name: "triangle_pattern", Label: "Triangle Pattern", Points: 4}, {Name: "3divers_pattern", Label: "Three Drives Pattern", Points: 7}, }}, {Category: "elliott_waves", Label: "Elliott Waves", Shapes: []ShapeInfo{ {Name: "elliott_impulse_wave", Label: "Elliott Impulse Wave (12345)", Points: 6}, {Name: "elliott_correction", Label: "Elliott Correction Wave (ABC)", Points: 4}, {Name: "elliott_triangle_wave", Label: "Elliott Triangle Wave (ABCDE)", Points: 6}, {Name: "elliott_double_combo", Label: "Elliott Double Combo Wave (WXY)", Points: 4}, {Name: "elliott_triple_combo", Label: "Elliott Triple Combo Wave (WXYXZ)", Points: 6}, }}, {Category: "cycles", Label: "Cycles", Shapes: []ShapeInfo{ {Name: "cyclic_lines", Label: "Cyclic Lines", Points: 2}, {Name: "time_cycles", Label: "Time Cycles", Points: 2}, {Name: "sine_line", Label: "Sine Line", Points: 2}, }}, {Category: "projection", Label: "Projection", Shapes: []ShapeInfo{ {Name: "long_position", Label: "Long Position", Points: 2}, {Name: "short_position", Label: "Short Position", Points: 2}, {Name: "forecast", Label: "Forecast", Points: 2}, {Name: "bars_pattern", Label: "Bars Pattern", Points: 2}, {Name: "ghost_feed", Label: "Ghost Feed", Points: 5}, {Name: "projection", Label: "Projection", Points: 3}, }}, {Category: "volume_based", Label: "Volume Based", Shapes: []ShapeInfo{ {Name: "anchored_vwap", Label: "Anchored VWAP", Points: 1}, {Name: "fixed_range_volume_profile", Label: "Fixed Range Volume Profile", Points: 2}, {Name: "anchored_volume_profile", Label: "Anchored Volume Profile", Points: 1}, }}, {Category: "measurer", Label: "Measurer", Shapes: []ShapeInfo{ {Name: "price_range", Label: "Price Range", Points: 2}, {Name: "date_range", Label: "Date Range", Points: 2}, {Name: "date_and_price_range", Label: "Date and Price Range", Points: 2}, }}, {Category: "brushes", Label: "Brushes", Shapes: []ShapeInfo{ {Name: "brush", Label: "Brush", Points: -1}, {Name: "highlighter", Label: "Highlighter", Points: -1}, }}, {Category: "arrows", Label: "Arrows", Shapes: []ShapeInfo{ {Name: "arrow_marker", Label: "Arrow Marker", Points: 2}, {Name: "arrow", Label: "Arrow", Points: 2}, {Name: "arrow_up", Label: "Arrow Mark Up", Points: 1}, {Name: "arrow_down", Label: "Arrow Mark Down", Points: 1}, }}, {Category: "shapes", Label: "Shapes", Shapes: []ShapeInfo{ {Name: "rectangle", Label: "Rectangle", Points: 2}, {Name: "rotated_rectangle", Label: "Rotated Rectangle", Points: 3}, {Name: "path", Label: "Path", Points: -1}, {Name: "circle", Label: "Circle", Points: 2}, {Name: "ellipse", Label: "Ellipse", Points: 3}, {Name: "polyline", Label: "Polyline", Points: -1}, {Name: "triangle", Label: "Triangle", Points: 3}, {Name: "arc", Label: "Arc", Points: 3}, {Name: "curve", Label: "Curve", Points: 2}, {Name: "double_curve", Label: "Double Curve", Points: 2}, }}, {Category: "text_and_notes", Label: "Text & Notes", Shapes: []ShapeInfo{ {Name: "text", Label: "Text", Points: 1}, {Name: "anchored_text", Label: "Anchored Text", Points: 1}, {Name: "note", Label: "Note", Points: 1}, {Name: "text_note", Label: "Text Note", Points: 2}, {Name: "anchored_note", Label: "Anchored Note", Points: 1}, {Name: "price_note", Label: "Price Note", Points: 2}, {Name: "balloon", Label: "Pin", Points: 1}, {Name: "table", Label: "Table", Points: 1}, {Name: "callout", Label: "Callout", Points: 2}, {Name: "comment", Label: "Comment", Points: 1}, {Name: "price_label", Label: "Price Label", Points: 1}, {Name: "signpost", Label: "Signpost", Points: 1}, {Name: "flag", Label: "Flag Mark", Points: 1}, }}, {Category: "content", Label: "Content", Shapes: []ShapeInfo{ {Name: "image", Label: "Image", Points: 1}, {Name: "tweet", Label: "Tweet", Points: 1}, {Name: "idea", Label: "Idea", Points: 1}, }}, {Category: "icons", Label: "Icons", Shapes: []ShapeInfo{ {Name: "icon", Label: "Icon", Points: 1}, {Name: "emoji", Label: "Emoji", Points: 1}, {Name: "sticker", Label: "Sticker", Points: 1}, }}, }
ShapeGroups defines all known drawing shapes, grouped by category. Order matches the TradingView left toolbar.
Functions ¶
This section is empty.
Types ¶
type ActiveChartInfo ¶
type ActiveChartInfo struct {
ChartID string `json:"chart_id"`
TargetID string `json:"target_id"`
URL string `json:"url"`
Title string `json:"title,omitempty"`
ChartIndex int `json:"chart_index"`
ChartCount int `json:"chart_count"`
}
ActiveChartInfo describes the currently active chart.
type AlertsApiProbe ¶
type AlertsApiProbe struct {
Found bool `json:"found"`
AccessPaths []string `json:"access_paths"`
Methods []string `json:"methods"`
State map[string]any `json:"state"`
}
AlertsApiProbe describes the result of probing for the getAlertsRestApi() singleton.
type AvailableCurrency ¶
type AvailableCurrency struct {
Code string `json:"code"`
Description string `json:"description"`
ID string `json:"id"`
Kind string `json:"kind"`
}
AvailableCurrency describes a single currency available for conversion.
type AvailableUnit ¶
type AvailableUnit struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type"`
}
AvailableUnit describes a single unit available for conversion.
type BatchDeleteError ¶
BatchDeleteError describes a single layout deletion failure.
type BatchDeleteResult ¶
type BatchDeleteResult struct {
Deleted []int `json:"deleted"`
Skipped []int `json:"skipped,omitempty"`
Errors []BatchDeleteError `json:"errors,omitempty"`
}
BatchDeleteResult describes the result of a batch layout delete operation.
type ChartApiProbe ¶
type ChartApiProbe struct {
Found bool `json:"found"`
AccessPaths []string `json:"access_paths"`
Methods []string `json:"methods"`
}
ChartApiProbe describes the result of probing for the chartApi() singleton.
type ChartExportResult ¶
type ChartExportResult struct {
Symbol string `json:"symbol"`
Resolution string `json:"resolution"`
BarCount int `json:"bar_count"`
TimeColIdx int `json:"time_col_idx"`
Columns []ExportSchemaColumn `json:"schema"`
Bars [][]any `json:"bars"`
}
ChartExportResult is returned by ExportChartData. Schema describes each column; Bars is a 2-D array in schema order. Null values (study gaps, before-history) are represented as JSON null.
type ChartInfo ¶
type ChartInfo struct {
ChartID string `json:"chart_id"`
TargetID string `json:"target_id"`
URL string `json:"url"`
Title string `json:"title,omitempty"`
}
ChartInfo describes a chart tab mapped from a browser target.
type ChartToggles ¶
type ChartToggles struct {
LogScale *bool `json:"log_scale,omitempty"`
AutoScale *bool `json:"auto_scale,omitempty"`
ExtendedHours *bool `json:"extended_hours,omitempty"`
}
ChartToggles describes the state of chart toolbar toggles (log scale, auto scale, extended hours).
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ActivateChart ¶
func (*Client) ActivateReplay ¶
func (*Client) ActivateReplayAuto ¶
func (*Client) AddIndicatorBySearch ¶
func (*Client) AddPineToChart ¶
func (*Client) AddWatchlistSymbols ¶
func (*Client) AppendColoredWatchlist ¶
func (*Client) ApplyStudyTemplate ¶
func (*Client) BrowserScreenshot ¶
func (c *Client) BrowserScreenshot(ctx context.Context, format string, quality int, fullPage bool) ([]byte, error)
BrowserScreenshot captures a viewport screenshot via CDP Page.captureScreenshot. No TradingView JS is involved — this captures whatever is visible in the browser tab.
func (*Client) BulkRemoveColoredWatchlist ¶
func (*Client) ChangeAutoplayDelay ¶
func (*Client) CloneDrawing ¶
func (*Client) CloneLayout ¶
func (*Client) CreateAlert ¶
func (*Client) CreateDrawing ¶
func (*Client) CreateMultipointDrawing ¶
func (*Client) CreateNote ¶
func (*Client) CreateTweetDrawing ¶
func (*Client) CreateWatchlist ¶
func (*Client) DeactivateReplay ¶
func (*Client) DeepHealthCheck ¶
func (c *Client) DeepHealthCheck(ctx context.Context) (DeepHealthResult, error)
func (*Client) DeleteAlerts ¶
func (*Client) DeleteLayout ¶
func (*Client) DeleteWatchlist ¶
func (*Client) DismissDialog ¶
func (c *Client) DismissDialog(ctx context.Context) (LayoutActionResult, error)
func (*Client) EnableNetworkDomain ¶
EnableNetworkDomain enables the Network CDP domain on the first available chart tab session so that Network.* events are emitted.
func (*Client) ExecuteAction ¶
func (*Client) ExportChartData ¶
func (*Client) ExportDrawingsState ¶
func (*Client) FlagSymbol ¶
func (*Client) GetActiveChart ¶
func (c *Client) GetActiveChart(ctx context.Context) (ActiveChartInfo, error)
func (*Client) GetActiveStrategy ¶
func (*Client) GetActiveWatchlist ¶
func (c *Client) GetActiveWatchlist(ctx context.Context) (WatchlistDetail, error)
func (*Client) GetAvailableCurrencies ¶
func (*Client) GetAvailableUnits ¶
func (*Client) GetChartToggles ¶
func (*Client) GetChartType ¶
func (*Client) GetCurrency ¶
func (*Client) GetDrawing ¶
func (*Client) GetDrawingToggles ¶
func (*Client) GetDrawingTool ¶
func (*Client) GetHotlistExchanges ¶
func (c *Client) GetHotlistExchanges(ctx context.Context) ([]HotlistExchangeDetail, error)
func (*Client) GetHotlistMarkets ¶
func (*Client) GetLayoutFavorite ¶
func (c *Client) GetLayoutFavorite(ctx context.Context) (LayoutFavoriteResult, error)
func (*Client) GetLayoutStatus ¶
func (c *Client) GetLayoutStatus(ctx context.Context) (LayoutStatus, error)
func (*Client) GetOneHotlist ¶
func (*Client) GetPaneInfo ¶
func (c *Client) GetPaneInfo(ctx context.Context) (PanesResult, error)
func (*Client) GetPineConsole ¶
func (c *Client) GetPineConsole(ctx context.Context) ([]PineConsoleMessage, error)
func (*Client) GetPineSource ¶
func (*Client) GetPineStatus ¶
func (*Client) GetReplayStatus ¶
func (*Client) GetResolution ¶
func (*Client) GetStrategyDateRange ¶
func (*Client) GetStrategyReport ¶
func (*Client) GetStudyInputs ¶
func (*Client) GetStudyTemplate ¶
func (*Client) GetSymbolInfo ¶
func (*Client) GetVisibleRange ¶
func (*Client) GetWatchlist ¶
func (*Client) ImportDrawingsState ¶
func (*Client) ListColoredWatchlists ¶
func (c *Client) ListColoredWatchlists(ctx context.Context) ([]ColoredWatchlist, error)
func (*Client) ListDrawings ¶
func (*Client) ListFavoriteIndicators ¶
func (*Client) ListLayouts ¶
func (c *Client) ListLayouts(ctx context.Context) ([]LayoutInfo, error)
func (*Client) ListStrategies ¶
func (*Client) ListStudies ¶
func (*Client) ListStudyTemplates ¶
func (c *Client) ListStudyTemplates(ctx context.Context) (StudyTemplateList, error)
func (*Client) ListWatchlists ¶
func (c *Client) ListWatchlists(ctx context.Context) ([]WatchlistInfo, error)
func (*Client) MaximizeChart ¶
func (c *Client) MaximizeChart(ctx context.Context) (LayoutStatus, error)
func (*Client) ModifyAlert ¶
func (*Client) ModifyStudyInputs ¶
func (*Client) PinWatchlist ¶
func (*Client) PineCommandPalette ¶
func (*Client) PineDeleteLine ¶
func (*Client) PineFindReplace ¶
func (*Client) PineGoToLine ¶
func (*Client) PineInsertLineAbove ¶
func (*Client) PineMoveLine ¶
func (*Client) PineNewIndicator ¶
func (*Client) PineNewStrategy ¶
func (*Client) PineOpenScript ¶
func (*Client) PineToggleComment ¶
func (*Client) PineToggleConsole ¶
func (*Client) ProbeAlertsRestApi ¶
func (*Client) ProbeAlertsRestApiDeep ¶
func (*Client) ProbeBacktestingApi ¶
func (*Client) ProbeChartApi ¶
func (*Client) ProbeChartApiDeep ¶
func (*Client) ProbeDataWindow ¶
func (*Client) ProbeHotlistsManager ¶
func (c *Client) ProbeHotlistsManager(ctx context.Context) (HotlistsManagerProbe, error)
func (*Client) ProbeHotlistsManagerDeep ¶
func (*Client) ProbeIndicatorDialogDOM ¶
func (*Client) ProbePineDOM ¶
func (*Client) ProbeReplayManager ¶
func (*Client) ProbeReplayManagerDeep ¶
func (*Client) RegisterCDPEventHandler ¶
func (c *Client) RegisterCDPEventHandler(method string, fn func(sessionID string, params json.RawMessage)) (func(), error)
RegisterCDPEventHandler registers a handler for a CDP event method (e.g. "Network.webSocketCreated"). Returns an unregister function. The caller must have called Connect first.
func (*Client) ReloadPage ¶
ReloadPage reloads the browser tab for the given chart (or the first chart if chartID is empty). When hard is true, the browser cache is bypassed (equivalent to Shift+F5). After reload the session state is invalidated and the tab registry is refreshed so that subsequent calls use the new chart IDs.
func (*Client) RemoveAllDrawings ¶
func (*Client) RemoveColoredWatchlist ¶
func (*Client) RemoveDrawing ¶
func (*Client) RemoveStudy ¶
func (*Client) RemoveWatchlistSymbols ¶
func (*Client) RenameLayout ¶
func (*Client) RenameWatchlist ¶
func (*Client) ReplaceColoredWatchlist ¶
func (*Client) ReplayStep ¶
func (*Client) ResetReplay ¶
func (*Client) ResetScales ¶
func (*Client) ResolveSymbol ¶
func (*Client) RestartAlerts ¶
func (*Client) SaveLayout ¶
func (c *Client) SaveLayout(ctx context.Context) (LayoutActionResult, error)
func (*Client) SavePineScript ¶
func (*Client) ScanAlertsAccess ¶
func (*Client) ScanReplayActivation ¶
func (*Client) SearchIndicators ¶
func (*Client) SetActiveStrategy ¶
func (*Client) SetActiveWatchlist ¶
func (*Client) SetChartType ¶
func (*Client) SetCurrency ¶
func (*Client) SetDrawingTool ¶
func (*Client) SetDrawingVisibility ¶
func (*Client) SetDrawingZOrder ¶
func (*Client) SetHideDrawings ¶
func (*Client) SetLayoutGrid ¶
func (*Client) SetLockDrawings ¶
func (*Client) SetPineSource ¶
func (*Client) SetResolution ¶
func (*Client) SetStrategyInput ¶
func (*Client) SetTimeFrame ¶
func (*Client) SetVisibleRange ¶
func (*Client) StartAutoplay ¶
func (*Client) StartReplay ¶
func (*Client) StopAutoplay ¶
func (*Client) StrategyGotoDate ¶
func (*Client) SwitchLayout ¶
func (*Client) SwitchTimezone ¶
func (*Client) TakeServerSnapshot ¶
func (c *Client) TakeServerSnapshot(ctx context.Context) (ServerSnapshotResult, error)
func (*Client) TakeSnapshot ¶
func (*Client) ToggleAutoScale ¶
func (*Client) ToggleExtendedHours ¶
func (*Client) ToggleFullscreen ¶
func (c *Client) ToggleFullscreen(ctx context.Context) (LayoutStatus, error)
func (*Client) ToggleIndicatorFavorite ¶
func (*Client) ToggleLayoutFavorite ¶
func (c *Client) ToggleLayoutFavorite(ctx context.Context) (LayoutFavoriteResult, error)
func (*Client) ToggleLogScale ¶
func (*Client) TogglePineEditor ¶
type CodedError ¶
CodedError is a typed error used for stable API mapping.
func (*CodedError) Error ¶
func (e *CodedError) Error() string
func (*CodedError) Unwrap ¶
func (e *CodedError) Unwrap() error
type ColoredWatchlist ¶
type ColoredWatchlist struct {
ID string `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
Symbols []string `json:"symbols"`
Modified string `json:"modified,omitempty"`
}
ColoredWatchlist describes a colored watchlist (red, orange, green, purple, blue).
type CurrencyInfo ¶
type CurrencyInfo struct {
Currency string `json:"currency"`
IsConverted bool `json:"is_converted"`
NativeCurrency string `json:"native_currency"`
}
CurrencyInfo describes the current currency conversion state of a chart.
type DataWindowProbe ¶
type DataWindowProbe struct {
PanelVisible bool `json:"panel_visible"`
DOMElements []string `json:"dom_elements"`
CrosshairMethods []string `json:"crosshair_methods,omitempty"`
LegendElements []string `json:"legend_elements,omitempty"`
ChartWidgetProps []string `json:"chart_widget_props,omitempty"`
ModelProps []string `json:"model_props,omitempty"`
DataWindowState map[string]any `json:"data_window_state,omitempty"`
}
DataWindowProbe describes what's discoverable about the data window / crosshair state.
type DeepHealthResult ¶
type DeepHealthResult struct {
TradingViewAPI bool `json:"tradingview_api"`
ChartWidget bool `json:"chart_widget"`
WebpackRequire bool `json:"webpack_require"`
AlertsAPI bool `json:"alerts_api"`
WatchlistREST bool `json:"watchlist_rest"`
ReplayAPI bool `json:"replay_api"`
BacktestingAPI bool `json:"backtesting_api"`
PineEditorDOM bool `json:"pine_editor_dom"`
MonacoWebpack bool `json:"monaco_webpack"`
LoadChart bool `json:"load_chart"`
SaveChart bool `json:"save_chart"`
ChartAPI bool `json:"chart_api"`
HotlistsManager bool `json:"hotlists_manager"`
}
DeepHealthResult describes the availability of every implementation mechanism.
type DrawingToggles ¶
type DrawingToggles struct {
HideAll *bool `json:"hide_all,omitempty"`
LockAll *bool `json:"lock_all,omitempty"`
MagnetEnabled *bool `json:"magnet_enabled,omitempty"`
MagnetMode *int `json:"magnet_mode,omitempty"`
}
DrawingToggles describes the toggle states for drawing tools.
type ExportSchemaColumn ¶
type ExportSchemaColumn struct {
Type string `json:"type"`
SourceType string `json:"source_type,omitempty"`
SourceID string `json:"source_id,omitempty"`
SourceTitle string `json:"source_title,omitempty"`
PlotTitle string `json:"plot_title,omitempty"`
PlotID string `json:"plot_id,omitempty"`
}
ExportSchemaColumn describes one column in a chart export result.
type HotlistExchangeDetail ¶
type HotlistExchangeDetail struct {
Exchange string `json:"exchange"`
Name string `json:"name"`
FullName string `json:"full_name,omitempty"`
Flag string `json:"flag,omitempty"`
Groups []HotlistGroupInfo `json:"groups"`
}
HotlistExchangeDetail describes an exchange with its hotlist groups.
type HotlistGroupInfo ¶
HotlistGroupInfo describes a hotlist group within an exchange.
type HotlistResult ¶
type HotlistResult struct {
Exchange string `json:"exchange"`
Group string `json:"group"`
Symbols []HotlistSymbol `json:"symbols"`
}
HotlistResult describes the symbols returned for a specific exchange/group hotlist.
type HotlistSymbol ¶
type HotlistSymbol struct {
Symbol string `json:"symbol"`
Extra map[string]any `json:"extra,omitempty"`
}
HotlistSymbol describes a single symbol entry from a hotlist.
type HotlistsManagerProbe ¶
type HotlistsManagerProbe struct {
Found bool `json:"found"`
AccessPaths []string `json:"access_paths"`
Methods []string `json:"methods"`
State map[string]any `json:"state"`
}
HotlistsManagerProbe describes the result of probing for the hotlistsManager() singleton.
type IndicatorAddResult ¶
type IndicatorAddResult struct {
Status string `json:"status"`
Query string `json:"query"`
Index int `json:"index"`
Name string `json:"name"`
}
IndicatorAddResult describes the result of adding an indicator via search.
type IndicatorFavoriteResult ¶
type IndicatorFavoriteResult struct {
Status string `json:"status"`
Query string `json:"query"`
Name string `json:"name"`
IsFavorite bool `json:"is_favorite"`
}
IndicatorFavoriteResult describes the result of toggling an indicator's favorite status.
type IndicatorResult ¶
type IndicatorResult struct {
Name string `json:"name"`
Author string `json:"author,omitempty"`
Boosts int `json:"boosts,omitempty"`
IsFavorite bool `json:"is_favorite"`
Index int `json:"index"`
}
IndicatorResult describes a single indicator entry from the Indicators dialog.
type IndicatorSearchResult ¶
type IndicatorSearchResult struct {
Status string `json:"status"`
Query string `json:"query,omitempty"`
Category string `json:"category,omitempty"`
Results []IndicatorResult `json:"results"`
TotalCount int `json:"total_count"`
}
IndicatorSearchResult describes the result of an indicator search or category browse.
type LayoutActionResult ¶
type LayoutActionResult struct {
Status string `json:"status"`
LayoutName string `json:"layout_name,omitempty"`
LayoutID string `json:"layout_id,omitempty"`
}
LayoutActionResult describes the result of a layout action.
type LayoutDetail ¶
type LayoutDetail struct {
Info LayoutInfo `json:"layout_info"`
Status LayoutStatus `json:"status"`
Studies []Study `json:"studies"`
DrawingCount int `json:"drawing_count"`
SnapshotURL string `json:"snapshot_url,omitempty"`
PreviousID int `json:"previous_layout_id,omitempty"`
}
LayoutDetail describes a layout with its full content (studies, drawings, etc.).
type LayoutFavoriteResult ¶
type LayoutFavoriteResult struct {
LayoutID string `json:"layout_id"`
LayoutName string `json:"layout_name"`
IsFavorite bool `json:"is_favorite"`
WasFavorite bool `json:"was_favorite,omitempty"`
}
LayoutFavoriteResult describes the favorite state of a layout.
type LayoutInfo ¶
type LayoutInfo struct {
ID int `json:"id"`
URL string `json:"url"`
Name string `json:"name"`
Symbol string `json:"symbol,omitempty"`
Interval string `json:"interval,omitempty"`
Modified int64 `json:"modified,omitempty"`
Favorite bool `json:"favorite,omitempty"`
}
LayoutInfo describes a saved layout entry.
type LayoutStatus ¶
type LayoutStatus struct {
LayoutName string `json:"layout_name"`
LayoutID string `json:"layout_id"`
GridTemplate string `json:"grid_template"`
ChartCount int `json:"chart_count"`
ActiveIndex int `json:"active_index"`
IsMaximized bool `json:"is_maximized"`
IsFullscreen bool `json:"is_fullscreen"`
HasChanges bool `json:"has_changes"`
}
LayoutStatus describes the current layout state.
type Note ¶
type Note struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Created float64 `json:"created"`
Modified float64 `json:"modified"`
Symbol string `json:"symbol"`
SymbolFull string `json:"symbol_full"`
Snapshot string `json:"snapshot,omitempty"`
SnapshotPage string `json:"snapshot_page,omitempty"`
SnapshotThumb string `json:"snapshot_thumb,omitempty"`
}
Note describes a watchlist text note from TradingView's textnotes API.
type PaneInfo ¶
type PaneInfo struct {
Index int `json:"index"`
Symbol string `json:"symbol"`
Exchange string `json:"exchange,omitempty"`
Resolution string `json:"resolution,omitempty"`
}
PaneInfo describes one chart pane in a multi-pane grid layout.
type PanesResult ¶
type PanesResult struct {
GridTemplate string `json:"grid_template"`
ChartCount int `json:"chart_count"`
ActiveIndex int `json:"active_index"`
Panes []PaneInfo `json:"panes"`
}
PanesResult describes all panes in the current grid layout.
type PineConsoleMessage ¶
PineConsoleMessage describes a single Pine console output message.
type PineState ¶
type PineState struct {
Status string `json:"status"`
IsVisible bool `json:"is_visible"`
MonacoReady bool `json:"monaco_ready"`
ScriptName string `json:"script_name,omitempty"`
ScriptSource string `json:"script_source,omitempty"`
SourceLength int `json:"source_length,omitempty"`
LineCount int `json:"line_count,omitempty"`
MatchCount int `json:"match_count,omitempty"`
}
PineState describes the current state of the Pine editor panel.
type ReloadResult ¶
ReloadResult describes the result of a page reload.
type ReplayManagerProbe ¶
type ReplayManagerProbe struct {
Found bool `json:"found"`
AccessPaths []string `json:"access_paths"`
Methods []string `json:"methods"`
State map[string]any `json:"state"`
}
ReplayManagerProbe describes the result of probing for the _replayManager singleton.
type ReplayStatus ¶
type ReplayStatus struct {
IsReplayStarted bool `json:"is_replay_started"`
IsReplayFinished bool `json:"is_replay_finished"`
IsReplayConnected bool `json:"is_replay_connected"`
IsAutoplayStarted bool `json:"is_autoplay_started"`
ReplayPoint any `json:"replay_point"`
ServerTime any `json:"server_time"`
AutoplayDelay float64 `json:"autoplay_delay"`
Depth any `json:"depth"`
}
ReplayStatus describes the current state of the replay manager.
type ResolvedSymbolInfo ¶
type ResolvedSymbolInfo struct {
Symbol string `json:"symbol"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Exchange string `json:"exchange,omitempty"`
Type string `json:"type,omitempty"`
Currency string `json:"currency,omitempty"`
Timezone string `json:"timezone,omitempty"`
PriceScale int `json:"pricescale,omitempty"`
MinMov int `json:"minmov,omitempty"`
HasIntraday bool `json:"has_intraday,omitempty"`
HasDaily bool `json:"has_daily,omitempty"`
Session string `json:"session,omitempty"`
SessionHolidays string `json:"session_holidays,omitempty"`
}
ResolvedSymbolInfo describes extended metadata for any symbol resolved via chartApi().
type ServerSnapshotResult ¶
ServerSnapshotResult describes the result of uploading a chart screenshot to TradingView servers.
type ShapeGroup ¶
type ShapeGroup struct {
Category string `json:"category"` // e.g. "lines"
Label string `json:"label"` // e.g. "Lines"
Shapes []ShapeInfo `json:"shapes"`
}
ShapeGroup groups related shapes under a UI category.
type ShapeInfo ¶
type ShapeInfo struct {
Name string `json:"name"` // internal shape name (e.g. "trend_line")
Label string `json:"label"` // display name (e.g. "Trend Line")
Points int `json:"points"` // required point count (1 = single-point endpoint, 2+ = multipoint)
}
ShapeInfo describes a known drawing shape and its required point count.
type ShapePoint ¶
ShapePoint describes a point for drawing creation.
type SnapshotChartInfo ¶
type SnapshotChartInfo struct {
Meta SnapshotSymbolMeta `json:"meta"`
OHLC []string `json:"ohlc,omitempty"`
Quotes map[string]string `json:"quotes,omitempty"`
}
SnapshotChartInfo describes one chart pane inside the snapshot metadata.
type SnapshotRawMeta ¶
type SnapshotRawMeta struct {
Layout string `json:"layout,omitempty"`
Theme string `json:"theme,omitempty"`
Charts []SnapshotChartInfo `json:"charts,omitempty"`
}
SnapshotRawMeta is the metadata envelope from api._chartWidgetCollection.images().
type SnapshotResult ¶
type SnapshotResult struct {
DataURL string `json:"data_url"`
Width int `json:"width"`
Height int `json:"height"`
Metadata SnapshotRawMeta `json:"metadata"`
}
SnapshotResult is the raw result from the in-page screenshot JS eval.
type SnapshotSymbolMeta ¶
type SnapshotSymbolMeta struct {
Symbol string `json:"symbol,omitempty"`
Exchange string `json:"exchange,omitempty"`
Resolution string `json:"resolution,omitempty"`
Description string `json:"description,omitempty"`
}
SnapshotSymbolMeta describes the symbol metadata for a chart pane.
type StrategyApiProbe ¶
type StrategyApiProbe struct {
Found bool `json:"found"`
AccessPaths []string `json:"access_paths"`
Methods []string `json:"methods"`
State map[string]any `json:"state"`
}
StrategyApiProbe describes the result of probing for the _backtestingStrategyApi singleton.
type StudyDetail ¶
type StudyDetail struct {
ID string `json:"id"`
Name string `json:"name"`
Inputs map[string]any `json:"inputs"`
}
StudyDetail describes a study with its input parameters.
type StudyTemplateApplyResult ¶
type StudyTemplateApplyResult struct {
ID int `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
}
StudyTemplateApplyResult describes the result of applying a study template.
type StudyTemplateEntry ¶
type StudyTemplateEntry struct {
ID int `json:"id"`
Name string `json:"name"`
MetaInfo any `json:"meta_info"`
FavoriteDate string `json:"favorite_date,omitempty"`
}
StudyTemplateEntry describes a single study (indicator) template.
type StudyTemplateList ¶
type StudyTemplateList struct {
Custom []StudyTemplateEntry `json:"custom"`
Standard []StudyTemplateEntry `json:"standard"`
Fundamentals []StudyTemplateEntry `json:"fundamentals"`
}
StudyTemplateList describes study templates grouped by category.
type SymbolInfo ¶
type SymbolInfo struct {
Symbol string `json:"symbol"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Exchange string `json:"exchange,omitempty"`
Type string `json:"type,omitempty"`
Currency string `json:"currency,omitempty"`
Timezone string `json:"timezone,omitempty"`
PriceScale int `json:"pricescale,omitempty"`
MinMov int `json:"minmov,omitempty"`
HasIntraday bool `json:"has_intraday,omitempty"`
HasDaily bool `json:"has_daily,omitempty"`
}
SymbolInfo describes extended metadata for a symbol.
type TimeFrameResult ¶
type TimeFrameResult struct {
Preset string `json:"preset"`
Resolution string `json:"resolution"`
From float64 `json:"from"`
To float64 `json:"to"`
}
TimeFrameResult describes the result of setting a time frame preset.
type TweetDrawingResult ¶
type TweetDrawingResult struct {
ID string `json:"id"`
Status string `json:"status"`
URL string `json:"url"`
}
TweetDrawingResult describes the result of creating a tweet drawing.
type VisibleRange ¶
VisibleRange describes the visible bar range on a chart.