百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

lightweight-charts-python

> DevOps
开源

Python 是 TradingView 轻量化图表 JavaScript 库的框架。

2.1K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Python 是 TradingView 轻量化图表 JavaScript 库的框架。

安装

PartTimeLarry: Interactive Brokers API 和 TradingView 图表在 Python 中


1. 显示来自 csv 的数据:

python
import pandas as pd
from lightweight_charts import Chart

if __name__ == '__main__':
    
    chart = Chart()
    
    # Columns: time | open | high | low | close | volume 
    df = pd.read_csv('ohlcv.csv')
    chart.set(df)
    
    chart.show(block=True)

2. 实时更新条形图:

python
import pandas as pd
from time import sleep
from lightweight_charts import Chart

if __name__ == '__main__':

    chart = Chart()

    df1 = pd.read_csv('ohlcv.csv')
    df2 = pd.read_csv('next_ohlcv.csv')

    chart.set(df1)

    chart.show()

    last_close = df1.iloc[-1]['close']
    
    for i, series in df2.iterrows():
        chart.update(series)

        if series['close'] > 20 and last_close < 20:
            chart.marker(text='The price crossed $20!')
            
        last_close = series['close']
        sleep(0.1)

3. 实时从点数据更新条形图:

python
import pandas as pd
from time import

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcharting-libraryfinancial-charting-librarylive-chartsohlc-chart

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理