grace package
本机 tradingview 查看器
示例:
import ipad
import polars
import grace
df = ipad.read(
schema="stock",
query="select * from stock_in_day where candle_end_time between '1970-01-01' and '2003-10-02'",
types=ipad.stock.stock_in_day,
)
df = df.select( # 提取并转换所需字段
polars.col("open", "high", "low", "close", "volume"),
code=polars.col("stock_code"),
timestamp=polars.col("candle_end_time").dt.timestamp("ms"),
)
grace.run_once(df, "1D")
df 中可包含多种 code,将自动分组以在 tradingview 中搜索查看。
传入元组参数来同时显示多时间尺度数据:
grace.run_once((df0, "1D"), (df1, "1W"), (df2, "1M"))