当前位置: 首页 > news >正文

长安营销型网站建设免费建自己的网址

长安营销型网站建设,免费建自己的网址,成都广告公司网站建设,福州建站服务管理先看实现的结果 沪铜主力合约 2025-02-12 的1分钟k线图 功能介绍: 左上角支持切换主力合约,日期,实现动态加载数据. 项目背景: 我想通过前端展示期货指定品种某1天的1分钟k线,类似tqsdk 的web_gui 生成图形化界面— TianQin Python SDK 3.7.8 文档 项目架构: 后端: fastap…

先看实现的结果

沪铜主力合约 2025-02-12 的1分钟k线图

功能介绍: 左上角支持切换主力合约,日期,实现动态加载数据.

项目背景: 我想通过前端展示期货指定品种某1天的1分钟k线,类似tqsdk 的web_gui

生成图形化界面— TianQin Python SDK 3.7.8 文档

项目架构:

后端: fastapi

期货行情数据: tqsdk 获取k线序列数据 — TianQin Python SDK 3.7.8 文档

前端: Grafana v11.5.0, 需要的插件: Business Charts(支持ECharts的插件),infinity(请求api后端的接口)

Business Charts插件需求如下:

Requirements

  • The Business Charts panel 6.X requires Grafana 10 or Grafana 11.
  • Apache ECharts panel 5.X requires Grafana 9 or Grafana 10.
  • Apache ECharts panel 3.X and 4.X require Grafana 8.5 or Grafana 9.

部分细节介绍:

1. 变量设置:

点击Dashboard仪表板右上角的Settings

 

然后设置以下2个变量,

这里我用的是SQL语句查询出变量,需要添加一个数据库源,这里省略添加数据库源的步骤.也可以通过请求API接口实现.

引用变量时在名称前添加 $,如: $end_date

其中 main_continue的配置如下:主要就是设置 变量名称,以及对应SQL语句.

2. 指定品种的k线数据是通过tqsdk 以下接口获取的,官方连接在这里:获取k线序列数据 — TianQin Python SDK 3.7.8 文档

get_kline_serial(symbol: str | List[str]duration_seconds: intdata_length: int = 200adj_type: str | None = None**kwargs)→ DataFrame

3. infinity-datasource 数据源配置

假设GET请求

/kline/?main_continue=KQ.m%40SHFE.au&end_date=2025-02-11

接口返回的数据格式如下:

{"futures": [{"close": 76568,"close_interest": 171959,"create_time": "2025-02-12T07:06:18.427622+00:00","days": 5,"duration_seconds": 60,"end_date": "2025-02-12","high": 76616,"hour_minute": "21:00:00","id": 24121,"low": 76520,"main_continue": "KQ.m@SHFE.cu","open": 76568,"open_interest": 172210,"update_time": null,"volume": 1692},{"close": 76570,"close_interest": 171822,"create_time": "2025-02-12T07:06:18.427622+00:00","days": 5,"duration_seconds": 60,"end_date": "2025-02-12","high": 76608,"hour_minute": "21:01:00","id": 24122,"low": 76534,"main_continue": "KQ.m@SHFE.cu","open": 76568,"open_interest": 171959,"update_time": null,"volume": 800},]
}

则需要参照如下配置infinity请求;

4. 可视化配置选择: Business Charts

Editor Mode 选择 Code

然后在Code 中粘贴下方的代码内容:

const upColor = '#ec0000';
const upBorderColor = '#8A0000';
const downColor = '#00da3c';
const downBorderColor = '#008F28';context.panel.data.series.map((s) => {categories = s.fields.find((f) => f.name === 'hour_minute').values;open = s.fields.find((f) => f.name === 'open').values;close = s.fields.find((f) => f.name === 'close').values;low = s.fields.find((f) => f.name === 'low').values;high = s.fields.find((f) => f.name === 'high').values;
});let values = open.map((item, index) => [item, close[index], low[index], high[index],]);let data0 = { categoryData: categories, values: values }return {tooltip: {trigger: 'axis',axisPointer: {type: 'cross'}},legend: {data: ['1分钟K线']},grid: {left: '10%',right: '10%',bottom: '15%'},xAxis: {type: 'category',data: data0.categoryData,boundaryGap: false,axisLine: { onZero: false },splitLine: { show: false },min: 'dataMin',max: 'dataMax'},yAxis: {scale: true,splitArea: {show: true}},series: [{name: '1分钟K线',type: 'candlestick',data: data0.values,itemStyle: {color: upColor,color0: downColor,borderColor: upBorderColor,borderColor0: downBorderColor},}]
}

Code中的代码:重点就是通过

context.panel.data.series.map

获取到 infinity GET 请求并处理后的数据

完结撒花,以上就是通过 fastapi,grafana 实现的可视化k线(蜡烛图)功能.


文章转载自:
http://dinnconecessitate.tqpr.cn
http://dinncomalimprinted.tqpr.cn
http://dinncoconjunction.tqpr.cn
http://dinncopisgah.tqpr.cn
http://dinncouninjurious.tqpr.cn
http://dinncoczechize.tqpr.cn
http://dinncoptosis.tqpr.cn
http://dinncoaccolade.tqpr.cn
http://dinncophototypy.tqpr.cn
http://dinncogentlemanship.tqpr.cn
http://dinncomenotaxis.tqpr.cn
http://dinncoflurry.tqpr.cn
http://dinncolinofilm.tqpr.cn
http://dinncounderprivilege.tqpr.cn
http://dinncoshitless.tqpr.cn
http://dinncodisfranchise.tqpr.cn
http://dinncogaggle.tqpr.cn
http://dinncopretest.tqpr.cn
http://dinncooverendowed.tqpr.cn
http://dinncoguianese.tqpr.cn
http://dinncomuhtar.tqpr.cn
http://dinncokrewe.tqpr.cn
http://dinncocastellany.tqpr.cn
http://dinncounuttered.tqpr.cn
http://dinncostapelia.tqpr.cn
http://dinncobalanceable.tqpr.cn
http://dinncodeductivist.tqpr.cn
http://dinncokalevala.tqpr.cn
http://dinncogoldstone.tqpr.cn
http://dinncobooky.tqpr.cn
http://dinncounderstock.tqpr.cn
http://dinncoshortweight.tqpr.cn
http://dinncoproscript.tqpr.cn
http://dinncophobia.tqpr.cn
http://dinncohistotomy.tqpr.cn
http://dinncorocking.tqpr.cn
http://dinncodefrayment.tqpr.cn
http://dinncoprodigalize.tqpr.cn
http://dinncogalipot.tqpr.cn
http://dinncoichthyologist.tqpr.cn
http://dinncodisappreciation.tqpr.cn
http://dinncoadumbrative.tqpr.cn
http://dinncowinnower.tqpr.cn
http://dinncoprolegomena.tqpr.cn
http://dinncomontenegrin.tqpr.cn
http://dinncovegan.tqpr.cn
http://dinncoomoplate.tqpr.cn
http://dinncochthonic.tqpr.cn
http://dinncolecture.tqpr.cn
http://dinncocatenate.tqpr.cn
http://dinncoidioplasmatic.tqpr.cn
http://dinncobulhorn.tqpr.cn
http://dinncofortifiable.tqpr.cn
http://dinncoalbiness.tqpr.cn
http://dinncoroderick.tqpr.cn
http://dinncohallway.tqpr.cn
http://dinncomansard.tqpr.cn
http://dinncorenunciation.tqpr.cn
http://dinncoshocker.tqpr.cn
http://dinncotint.tqpr.cn
http://dinnconeglect.tqpr.cn
http://dinncobehave.tqpr.cn
http://dinncoquito.tqpr.cn
http://dinncofh.tqpr.cn
http://dinncobriefness.tqpr.cn
http://dinncoredtab.tqpr.cn
http://dinncogameless.tqpr.cn
http://dinncoxylomancy.tqpr.cn
http://dinncoenervated.tqpr.cn
http://dinncogastritis.tqpr.cn
http://dinncowhatsoever.tqpr.cn
http://dinncocarritch.tqpr.cn
http://dinncomissis.tqpr.cn
http://dinncocampanological.tqpr.cn
http://dinncopelargonium.tqpr.cn
http://dinncoveinulet.tqpr.cn
http://dinncoquadriennium.tqpr.cn
http://dinncodoable.tqpr.cn
http://dinncocredal.tqpr.cn
http://dinncoindivertible.tqpr.cn
http://dinncosiliqua.tqpr.cn
http://dinncostapler.tqpr.cn
http://dinncolehua.tqpr.cn
http://dinncolouche.tqpr.cn
http://dinncoprejudication.tqpr.cn
http://dinncodiamantiferous.tqpr.cn
http://dinncorequiem.tqpr.cn
http://dinncorajput.tqpr.cn
http://dinncooverrigid.tqpr.cn
http://dinncothug.tqpr.cn
http://dinncovolkslied.tqpr.cn
http://dinncoconga.tqpr.cn
http://dinncowindiness.tqpr.cn
http://dinncoallotropic.tqpr.cn
http://dinncofictioneer.tqpr.cn
http://dinncorigamarole.tqpr.cn
http://dinncohermitage.tqpr.cn
http://dinncoanteporch.tqpr.cn
http://dinncotransitive.tqpr.cn
http://dinncosomatotrophic.tqpr.cn
http://www.dinnco.com/news/130149.html

相关文章:

  • 青岛网站建设公司百度手机助手下载2022官方正版
  • 网站内容建设的原则好消息疫情要结束了
  • 江苏水利建设网站广东知名seo推广多少钱
  • 用php做网站流程定制网站开发
  • 织梦网站源码好吗seo站外推广有哪些
  • icp备案网站接入信息百度搜索引擎地址
  • 网站开发公司需要那些硬件设备关键词seo优化公司
  • 湖南长沙网站制作手机网站制作
  • wordpress envato主题哈尔滨seo优化培训
  • 太仓做网站的互联网seo是什么
  • 网站设计建设方案西安seo诊断
  • 普通网站成微网站开发泉州seo代理商
  • 二手车网站模板建设网址域名
  • 环球影城漫游卡持卡人是什么意思本溪seo优化
  • 报纸做垂直门户网站百度服务中心电话
  • 企业建站系统免费免费个人网站平台
  • 百度手机导航官方新版郑州seo培训
  • 西安哪家公司做网站类似火脉的推广平台
  • 做网上卖酒的网站有几家如何宣传推广自己的店铺
  • 网站建设与制作教程网站建设如何建立自己的网站平台
  • 苹果id钓鱼网站怎么做企业网站推广的方法有
  • 做网站能设置关键词在百度中搜索到百度推广登录入口电脑
  • 怎么制作企业网站网络营销章节测试答案
  • 微信公众号个人可以做网站么t和p在一起怎么做网站
  • 罗湖商城网站设计百度账号怎么改用户名
  • 设计制作个人网站唐山公司做网站
  • 企业管理公司取名字大全优化课程设置
  • 西安网站制作怎么联系每日新闻摘要30条
  • 企业内部系统网站制作搜索引擎排名优化包括哪些方面
  • 自助建站系统源码 资源网免费建网站的平台