### Install tdx2db using Binary Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Download the pre-compiled binary for your platform and move it to your PATH. Ensure the binary is executable. ```bash sudo mv tdx2db /usr/local/bin/ && tdx2db -h ``` -------------------------------- ### Database Abstraction Interface (DataRepository) Source: https://context7.com/jing2uo/tdx2db/llms.txt Demonstrates the usage of the `DataRepository` interface for interacting with databases. It supports DuckDB and ClickHouse, automatically selecting the driver based on the URI scheme. The example shows connecting, initializing the schema, querying daily klines, getting stock symbols, and retrieving the latest data date. ```go package main import ( "fmt" "time" "github.com/jing2uo/tdx2db/database" ) func main() { // 创建 DuckDB 连接 db, err := database.NewDB("duckdb://./tdx.db") if err != nil { panic(err) } // 创建 ClickHouse 连接 // db, err := database.NewDB("clickhouse://localhost/mydb") if err := db.Connect(); err != nil { panic(err) } defer db.Close() // 初始化数据库 schema(创建表) if err := db.InitSchema(); err != nil { panic(err) } // 查询日线数据 startDate := time.Date(2024, 1, 1, 0, 0, 0, 0, time.Local) endDate := time.Date(2024, 12, 31, 0, 0, 0, 0, time.Local) klines, err := db.QueryKlineDaily("sz000001", &startDate, &endDate) if err != nil { panic(err) } for _, k := range klines { fmt.Printf("%s: O=%.2f H=%.2f L=%.2f C=%.2f V=%d\n", k.Date.Format("2006-01-02"), k.Open, k.High, k.Low, k.Close, k.Volume) } // 获取股票分类 stocks, _ := db.GetSymbolsByClass("stock") fmt.Printf("股票数量: %d\n", len(stocks)) // 获取最新日期 latestDate, _ := db.GetLatestDate("raw_kline_daily", "date") fmt.Printf("最新数据日期: %s\n", latestDate.Format("2006-01-02")) } ``` -------------------------------- ### Install tdx2db using Docker Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Run the tdx2db Docker image to access its functionality. This command pulls the latest image and displays help information. ```bash docker run --rm --platform=linux/amd64 ghcr.io/jing2uo/tdx2db:latest -h ``` -------------------------------- ### Initialize Full Historical Data Import (init) Source: https://context7.com/jing2uo/tdx2db/llms.txt Use the `init` command for the initial full import of historical daily data from Tongdaxin. Specify the directory containing TDX .day files and the database connection URI. Supports both DuckDB and ClickHouse, with examples for various connection string configurations and Docker usage. ```bash # 下载通达信沪深京日线数据完整包 mkdir -p vipdoc wget https://data.tdx.com.cn/vipdoc/hsjday.zip && unzip -q hsjday.zip -d vipdoc # 导入到 DuckDB(path 支持相对路径) tdx2db init --dburi 'duckdb://./tdx.db' --dayfiledir ./vipdoc # 导入到 ClickHouse(默认值: user=default, password="", port=9000) tdx2db init --dburi 'clickhouse://localhost' --dayfiledir ./vipdoc # ClickHouse 完整连接字符串 tdx2db init --dburi 'clickhouse://default:123456@localhost:9000/mydb?http_port=8123' --dayfiledir ./vipdoc # 使用 Docker 运行 docker run --rm --platform=linux/amd64 -v "$(pwd)":/data \ ghcr.io/jing2uo/tdx2db:latest \ init --dayfiledir /data/vipdoc --dburi 'duckdb:///data/tdx.db' ``` -------------------------------- ### SQL Queries for Tongdaxin Data Source: https://context7.com/jing2uo/tdx2db/llms.txt Examples of SQL queries to retrieve various market data including daily, minute, and adjusted prices. Supports different views for non-adjusted, forward-adjusted, and backward-adjusted data. ```sql -- 查询不复权日线数据(包含基础行情指标) SELECT * FROM v_bfq_daily WHERE symbol='sz000001' ORDER BY date; ``` ```sql -- 查询前复权日线数据 SELECT * FROM v_qfq_daily WHERE symbol='sz000001' ORDER BY date; ``` ```sql -- 查询后复权日线数据 SELECT * FROM v_hfq_daily WHERE symbol='sz000001' ORDER BY date; ``` ```sql -- 查询原始日线数据 SELECT symbol, date, open, high, low, close, volume, amount FROM raw_kline_daily WHERE symbol='sz000001' AND date >= '2024-01-01' ORDER BY date; ``` ```sql -- 查询1分钟分时数据 SELECT symbol, datetime, open, high, low, close, volume FROM raw_kline_1min WHERE symbol='sz000001' AND datetime >= '2024-01-02 09:30:00' ORDER BY datetime; ``` ```sql -- 查询股票基础行情(前收盘价、换手率、市值) SELECT date, symbol, close, preclose, change_pct, turnover, floatmv, totalmv FROM raw_stocks_basic WHERE symbol='sz000001' ORDER BY date; ``` ```sql -- 查询复权因子 SELECT symbol, date, hfq_factor FROM raw_adjust_factor WHERE symbol='sz000001' ORDER BY date; ``` ```sql -- 查询股本变迁数据 SELECT * FROM raw_gbbq WHERE symbol='sz000001' ORDER BY date; ``` ```sql -- 按品种分类查询 SELECT class, COUNT(*) as cnt FROM raw_symbol_class GROUP BY class; -- 结果: stock(股票), index(指数), etf(ETF), block(板块), unknown(其他) ``` ```sql -- 获取所有股票代码 SELECT symbol FROM raw_symbol_class WHERE class='stock'; ``` ```sql -- 手动计算前复权价格 SELECT k.symbol, k.date, k.close, k.close * f.hfq_factor / LAST_VALUE(f.hfq_factor) OVER ( PARTITION BY k.symbol ORDER BY k.date ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS qfq_close FROM raw_kline_daily k JOIN raw_adjust_factor f ON k.symbol = f.symbol AND k.date = f.date WHERE k.symbol = 'sz000001'; ``` -------------------------------- ### Incremental Data Update (cron) Source: https://context7.com/jing2uo/tdx2db/llms.txt The `cron` command is used for daily incremental updates of stock data, equity changes, and recalculating previous closing prices and复权 (re-adjusted) factors. It can optionally import intraday data. Run `cron` once after `init` for initial setup. ```bash # 基础增量更新(日线 + 股本变迁 + 复权因子) tdx2db cron --dburi 'duckdb://tdx.db' # 同时导入1分钟分时数据 tdx2db cron --dburi 'duckdb://tdx.db' --minline 1 # 同时导入5分钟分时数据 tdx2db cron --dburi 'duckdb://tdx.db' --minline 5 # 同时导入1分钟和5分钟分时数据 tdx2db cron --dburi 'duckdb://tdx.db' --minline 1,5 # ClickHouse 增量更新 tdx2db cron --dburi 'clickhouse://localhost' --minline 1,5 ``` -------------------------------- ### Initialize Database using Docker Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Initialize the database using the tdx2db Docker image. Mount the current directory to /data to access local files and specify the database URI. ```bash # linux、mac docker docker run --rm --platform=linux/amd64 -v "$(pwd)":/data \ ghcr.io/jing2uo/tdx2db:latest \ init --dayfiledir /data/vipdoc --dburi 'duckdb:///data/tdx.db' # windows docker docker run --rm --platform=linux/amd64 -v "${PWD}":/data \ ghcr.io/jing2uo/tdx2db:latest \ init --dayfiledir /data/vipdoc --dburi 'duckdb:///data/tdx.db' # 后续不再提示 docker 用法, 根据二进制示例修改第三行命令即可 ``` -------------------------------- ### Initialize ClickHouse Database Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Initialize the ClickHouse database with Tdx daily data. Provide the full ClickHouse connection URI, including host, port, user, password, and database. ```bash # 导入 ClickHouse, dburi 格式: clickhouse:[user[:password]@]host[:port][/database][?http_port=value1¶m2=value2&...] tdx2db init --dburi 'clickhouse://default:123456@localhost:9000/mydb?http_port=8123' --dayfiledir ./vipdoc # ClickHouse 有以下默认值: user=default, password="", port=9000, http_port=8123, database=default,可以根据情况简写 tdx2db init --dburi 'clickhouse://localhost' --dayfiledir ./vipdoc ``` -------------------------------- ### Download and Unzip Tdx Daily Data (Linux/macOS) Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Download the Tdx daily data zip file and unzip it into the vipdoc directory. This is a prerequisite for initializing the database. ```bash # linux mac mkdir -p vipdoc wget https://data.tdx.com.cn/vipdoc/hsjday.zip && unzip -q hsjday.zip -d vipdoc # 若 unzip 解压后文件名如 sh\lday\sh000001.day,可以批量重命名 # cd vipdoc # for f in *.day; do mv "$f" "${f##*\}"; done ``` -------------------------------- ### Initialize DuckDB Database Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Initialize the DuckDB database with Tdx daily data. Specify the database URI and the directory containing the .day files. ```bash # 导入 DuckDB, dburi 格式: duckdb://[path],path 支持相对路径 tdx2db init --dburi 'duckdb://./tdx.db' --dayfiledir ./vipdoc ``` -------------------------------- ### Import Intraday Data (1min and 5min) Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Use the cron command to import 1-minute and 5-minute intraday data. The --minline option specifies which data to process. ```bash # --minline 可选 1、5、1,5 ,分别表示只处理1分钟、只处理5分钟、两种都处理 tdx2db cron --dburi 'duckdb://tdx.db' --minline 1,5 ``` -------------------------------- ### tdx2db CLI - init command Source: https://context7.com/jing2uo/tdx2db/llms.txt The `init` command is used for the initial full import of historical daily line data from TDX to the database. It requires the directory of TDX .day files and database connection information. ```APIDOC ## POST /api/users ### Description This endpoint allows for the creation of new user accounts. ### Method POST ### Endpoint /api/users ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **username** (string) - Required - The desired username for the new account. - **email** (string) - Required - The email address for the new account. - **password** (string) - Required - The password for the new account. ### Request Example ```json { "username": "johndoe", "email": "john.doe@example.com", "password": "securepassword123" } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the newly created user. - **username** (string) - The username of the created user. - **email** (string) - The email address of the created user. #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "username": "johndoe", "email": "john.doe@example.com" } ``` ``` -------------------------------- ### Perform Incremental Update Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Run the cron command to update stock data, equity changes, and calculate adjusted prices. Execute this immediately after initialization. ```bash tdx2db cron --dburi 'duckdb://tdx.db' # ClickHouse schema 参考 init 部分 ``` -------------------------------- ### tdx2db CLI - cron command Source: https://context7.com/jing2uo/tdx2db/llms.txt The `cron` command is used for daily incremental updates of stock data, share capital changes, and recalculation of previous closing prices and复权 (ex-right) factors. It supports optional intraday data import. It is recommended to run `cron` immediately after `init` for the first use. ```APIDOC ## GET /api/users/{id} ### Description Retrieves the details of a specific user by their unique identifier. ### Method GET ### Endpoint /api/users/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the user to retrieve. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **id** (string) - The unique identifier for the user. - **username** (string) - The username of the user. - **email** (string) - The email address of the user. - **createdAt** (string) - The timestamp when the user account was created (ISO 8601 format). #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "username": "johndoe", "email": "john.doe@example.com", "createdAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Download and Unzip Tdx Daily Data (Windows PowerShell) Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Use PowerShell to download and extract Tdx daily data. This prepares the data files for database import. ```powershell # windows powershell Invoke-WebRequest -Uri "https://data.tdx.com.cn/vipdoc/hsjday.zip" -OutFile "hsjday.zip" Expand-Archive -Path "hsjday.zip" -DestinationPath "vipdoc" -Force ``` -------------------------------- ### Go Constants for Data Table References Source: https://context7.com/jing2uo/tdx2db/llms.txt Import and use constants from the 'model' package to reference available data tables and views. This provides a structured way to interact with the database schema. ```go // 数据表常量引用 import "github.com/jing2uo/tdx2db/model" // 可用表: model.TableKlineDaily // raw_kline_daily - 日线数据 model.TableKline1Min // raw_kline_1min - 1分钟K线 model.TableKline5Min // raw_kline_5min - 5分钟K线 model.TableAdjustFactor // raw_adjust_factor - 复权因子 model.TableGbbq // raw_gbbq - 股本变迁 model.TableBasic // raw_stocks_basic - 基础行情 model.TableSymbolClass // raw_symbol_class - 品种分类 model.TableHoliday // raw_holidays - 节假日 model.MetaTable // _meta - 元信息(schema版本) // 可用视图: model.ViewDailyBFQ // v_bfq_daily - 不复权日线 model.ViewDailyQFQ // v_qfq_daily - 前复权日线 model.ViewDailyHFQ // v_hfq_daily - 后复权日线 ``` -------------------------------- ### Database Interface - DataRepository Source: https://context7.com/jing2uo/tdx2db/llms.txt The `DataRepository` interface defines a unified abstraction for database operations, supporting both DuckDB and ClickHouse backends. The appropriate driver is automatically selected based on the URI scheme via the `NewDB` factory function. ```APIDOC ## DELETE /api/users/{id} ### Description Deletes a user account by their unique identifier. ### Method DELETE ### Endpoint /api/users/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the user to delete. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (204) No content is returned upon successful deletion. #### Response Example None ``` -------------------------------- ### Convert Tongdaxin Files to CSV in Go Source: https://context7.com/jing2uo/tdx2db/llms.txt Use ConvertFilesToCSV to parse Tongdaxin binary files (.day, .01, .5) and convert them to CSV format. Supports concurrent processing with context cancellation. ```go package main import ( "context" "fmt" "github.com/jing2uo/tdx2db/tdx" ) func main() { ctx := context.Background() // 转换日线文件(.day)到 CSV outputFile, err := tdx.ConvertFilesToCSV(ctx, "./vipdoc/", "/tmp/daily.csv", ".day") if err != nil { panic(err) } fmt.Printf("日线数据已导出: %s\n", outputFile) // 转换1分钟分时文件(.01) _, err = tdx.ConvertFilesToCSV(ctx, "./vipdoc/", "/tmp/1min.csv", ".01") if err != nil { panic(err) } // 转换5分钟分时文件(.5) _, err = tdx.ConvertFilesToCSV(ctx, "./vipdoc/", "/tmp/5min.csv", ".5") if err != nil { panic(err) } // 支持取消 ctx, cancel := context.WithCancel(context.Background()) go func() { // 模拟取消 cancel() }() _, err = tdx.ConvertFilesToCSV(ctx, "./vipdoc/", "/tmp/daily.csv", ".day") if err == context.Canceled { fmt.Println("转换已取消") } } ``` -------------------------------- ### Export Stock Adjustment Factors to CSV Source: https://context7.com/jing2uo/tdx2db/llms.txt Calculates and exports post-split adjustment factors (HFQ Factor) using the QUANTAXIS algorithm. These factors are essential for adjusting daily and intraday stock prices. ```go package main import ( "context" "fmt" "github.com/jing2uo/tdx2db/calc" "github.com/jing2uo/tdx2db/database" ) func main() { db, _ := database.NewDB("duckdb://./tdx.db") db.Connect() defer db.Close() ctx := context.Background() // 计算所有股票的复权因子并导出到 CSV rowCount, err := calc.ExportFactorsToCSV(ctx, db, "/tmp/factors.csv") if err != nil { panic(err) } fmt.Printf("导出 %d 条复权因子记录\n", rowCount) // 复权因子使用示例(后复权价格 = 原价 × hfq_factor) // SELECT // k.symbol, k.date, // k.close * f.hfq_factor AS hfq_close // FROM raw_kline_daily k // JOIN raw_adjust_factor f ON k.symbol = f.symbol AND k.date = f.date } ``` -------------------------------- ### Data Format Conversion (convert) Source: https://context7.com/jing2uo/tdx2db/llms.txt The `convert` command transforms Tongdaxin daily and intraday data files, as well as 4th generation market data zip archives, into CSV format for easier processing by other applications. Specify the type (`-t`), input directory/file (`-i`), and output directory (`-o`). ```bash # 转换 .day 日线文件 tdx2db convert -t day -i ./vipdoc/ -o ./output/ # 转换 1 分钟分时数据(.1 文件) tdx2db convert -t 1min -i ./vipdoc/ -o ./output/ # 转换 5 分钟分时数据(.05 文件) tdx2db convert -t 5min -i ./vipdoc/ -o ./output/ # 转换四代日线压缩包 tdx2db convert -t day4 -i /path/to/20251212.zip -o ./output/ # 转换四代 TIC 分笔压缩包 tdx2db convert -t tic4 -i /path/to/20251212tic.zip -o ./output/ ``` -------------------------------- ### tdx2db CLI - convert command Source: https://context7.com/jing2uo/tdx2db/llms.txt The `convert` command supports converting TDX daily line, intraday files, and 4th generation market data compressed packages into CSV format for easier processing by other programs. ```APIDOC ## PUT /api/users/{id} ### Description Updates an existing user's information. ### Method PUT ### Endpoint /api/users/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the user to update. #### Query Parameters None #### Request Body - **email** (string) - Optional - The new email address for the user. - **password** (string) - Optional - The new password for the user. ### Request Example ```json { "email": "john.doe.updated@example.com" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the updated user. - **username** (string) - The username of the updated user. - **email** (string) - The updated email address of the user. - **createdAt** (string) - The timestamp when the user account was created (ISO 8601 format). #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "username": "johndoe", "email": "john.doe.updated@example.com", "createdAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### Convert Tdx Daily Data to CSV Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Use the convert command to transform Tdx daily .day files into CSV format. Specify the input directory and output directory. ```bash tdx2db convert -t day -i ./vipdoc/ -o ./ # 转换 .day 日线文件 tdx2db convert -h # 其他类型查看 help ``` -------------------------------- ### TaskExecutor for DAG-based Workflows Source: https://context7.com/jing2uo/tdx2db/llms.txt Manages task execution based on a Directed Acyclic Graph (DAG), handling dependency resolution and parallel execution via topological sorting. Supports task skipping, error handling modes, and graceful cancellation. ```go package main import ( "context" "fmt" "github.com/jing2uo/tdx2db/database" "github.com/jing2uo/tdx2db/workflow" ) func main() { db, _ := database.NewDB("duckdb://./tdx.db") db.Connect() defer db.Close() // 获取所有已注册的任务 tasks := workflow.GetRegisteredTasks() // 可用任务: update_daily, init_daily, update_gbbq, calc_basic, // calc_factor, update_1min, update_5min, update_holidays // 创建任务执行器 executor := workflow.NewTaskExecutor(db, tasks) // 准备任务参数 args := &workflow.TaskArgs{ TempDir: "/tmp/tdx2db-temp", VipdocDir: "/tmp/vipdoc", Minline: "1,5", // 导入1分钟和5分钟数据 } // 执行更新任务链(自动解析依赖) // update_daily → update_gbbq → calc_basic → calc_factor taskNames := workflow.GetUpdateTaskNames() ctx := context.Background() if err := executor.Run(ctx, taskNames, args); err != nil { panic(err) } fmt.Println("所有任务执行完成") } // 自定义任务示例 func customTask() { myTask := &workflow.Task{ Name: "my_custom_task", DependsOn: []string{"update_daily", "update_gbbq"}, // 依赖其他任务 Executor: func(ctx context.Context, db database.DataRepository, args *workflow.TaskArgs) (*workflow.TaskResult, error) { // 自定义逻辑 fmt.Println("执行自定义任务") return &workflow.TaskResult{ State: workflow.StateCompleted, Rows: 100, Message: "custom task done", }, nil }, SkipIf: func(ctx context.Context, db database.DataRepository, args *workflow.TaskArgs) bool { return false // 返回 true 则跳过此任务 }, OnError: workflow.ErrorModeStop, // 出错时停止,或 ErrorModeSkip 继续 } _ = myTask } ``` -------------------------------- ### Query Unadjusted Daily Data Source: https://github.com/jing2uo/tdx2db/blob/main/README.md Select data from the `v_bfq_daily` view to retrieve unadjusted daily stock prices, including basic stock information. ```sql # 前复权 select * from v_qfq_daily where symbol='sz000001' order by date; # 后复权 select * from v_hfq_daily where symbol='sz000001' order by date; ``` -------------------------------- ### Calculate Stock Basic Indicators Source: https://context7.com/jing2uo/tdx2db/llms.txt Calculates basic stock indicators like previous close, change percentage, amplitude, turnover rate, and market capitalization. Handles complex corporate actions such as ex-rights, ex-dividends, and stock changes. ```go package main import ( "fmt" "time" "github.com/jing2uo/tdx2db/calc" "github.com/jing2uo/tdx2db/model" ) func main() { // 准备日线数据 klines := []model.KlineDay{ {Symbol: "sz000001", Date: parseDate("2024-01-02"), Open: 10.0, High: 10.5, Low: 9.8, Close: 10.2, Volume: 1000000}, {Symbol: "sz000001", Date: parseDate("2024-01-03"), Open: 10.2, High: 10.8, Low: 10.0, Close: 10.5, Volume: 1200000}, {Symbol: "sz000001", Date: parseDate("2024-01-04"), Open: 10.5, High: 11.0, Low: 10.3, Close: 10.8, Volume: 1500000}, } // 准备股本变迁数据(GBBQ) // Category=1: 除权除息, C1=分红, C2=配股, C3=送转股, C4=配股价 // Category=2/3/5/7/8/9/10: 股本变动, C1/C2=变动前流通/总股本, C3/C4=变动后流通/总股本 gbbqData := []model.GbbqData{ {Symbol: "sz000001", Date: parseDate("2023-01-01"), Category: 2, C1: 0, C2: 0, C3: 1000, C4: 2000}, // 流通1000万股,总股本2000万股 } // 计算基础行情 basics, err := calc.CalculateStockBasic(klines, gbbqData) if err != nil { panic(err) } for _, b := range basics { fmt.Printf("%s: 收盘=%.2f 前收=%.2f 涨跌幅=%.2f%% 振幅=%.2f%% 换手率=%.6f 流通市值=%.2f\n", b.Date.Format("2006-01-02"), b.Close, b.PreClose, b.ChangePercent, b.Amplitude, b.Turnover, b.FloatMV) } // 输出: // 2024-01-02: 收盘=10.20 前收=10.20 涨跌幅=0.00% 振幅=6.86% 换手率=0.000100 流通市值=102000000.00 // 2024-01-03: 收盘=10.50 前收=10.20 涨跌幅=2.94% 振幅=7.84% 换手率=0.000120 流通市值=105000000.00 // 2024-01-04: 收盘=10.80 前收=10.50 涨跌幅=2.86% 振幅=6.67% 换手率=0.000150 流通市值=108000000.00 } func parseDate(s string) time.Time { t, _ := time.Parse("2006-01-02", s) return t } ``` -------------------------------- ### Go Data Model Structures Source: https://context7.com/jing2uo/tdx2db/llms.txt Defines the Go struct types for various data models, including KlineDay, StockBasic, and Factor. These structs use `col` and `type` tags for database column mapping and type information. ```go // 数据模型结构 type KlineDay struct { Symbol string `col:"symbol" Open float64 `col:"open" High float64 `col:"high" Low float64 `col:"low" Close float64 `col:"close" Amount float64 `col:"amount" Volume int64 `col:"volume" Date time.Time `col:"date" type:"date" } type StockBasic struct { Date time.Time `col:"date" type:"date" Symbol string `col:"symbol" Close float64 `col:"close" PreClose float64 `col:"preclose" ChangePercent float64 `col:"change_pct" Amplitude float64 `col:"amplitude" Turnover float64 `col:"turnover" FloatMV float64 `col:"floatmv" TotalMV float64 `col:"totalmv" } type Factor struct { Symbol string `col:"symbol" Date time.Time `col:"date" type:"date" HfqFactor float64 `col:"hfq_factor" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.