返回列表 发布新帖

量化研究-上线强大miniqmt免费教学视频

35 0

文章声明:本内容为个人的业余研究,和任何单位,机构没有关系,文章出现的股票代码,全部只是测试例子,不做投资参考,投资有风险,代码学习使用,不做商业用途,

结合会员量化基础很多不足,我亲自给大家录视频,给大家免费的学习,目前上线录完了miniqmt量化交易的xtdata数据模块的全部内容,后面重点录一下xttrade交易模块,交易的内容比数据复杂太多了,点赞转发我更有动力继续录

fb24e27a01bee4e230ff7c4cfa6f05c9.png

mini我目前录了14内容

a0accea9c2ea89043548e2ad4476402f.png

我给了对应的源代码

afcc7f9c84a0bd7949c7ea76fdbf68b1.png

视频我上线了网页直接看就可以,点击界面的索普miniqmt量化教程课程就可以

0c5c2cb7dab2916fadce350d3d9d2c57.png

完整的视频直接看

45aa7a1a6ab4e0b631d0077afe331a0c.png

a00d0dacd2d8c11ca1b415c6de379f34.png

视频很多,我就不一个一个的贴了直接看就可以,我给一下的源代码1qmt介绍_哔哩哔哩_bilibili

7订阅单股数据

from xtquant import xtdata
from xtquant import xttrader
stock_code='600031.SH'
start_date='20250101'
end_date='20500101'
count=-1
def on_data(datas):
    print(datas)
xtdata.subscribe_quote(stock_code=stock_code,
            start_time=start_date,end_time=end_date,count=count,callback=on_data)
xtdata.run()

8多股订阅

from xtquant import xtdata
from xtquant import xttrader
stock_list=['513100.SH','000001.SZ']
start_date='20250101'
end_date='20500101'
period='1d'
count=-1
def f(datas):
    code_list=list(datas.keys())
    df=xtdata.get_market_data_ex(stock_list=code_list,start_time=start_date,end_time=end_date,
                              period=period,count=-1)
    print(df)
xtdata.subscribe_whole_quote(code_list=stock_list,callback=f)
xtdata.run()

9自动数据订阅

from xtquant import xtdata
from xtquant import xttrader
import time
import schedule
stock_list=['000001.SZ','600031.SH']
start_date='20250101'
end_date='20251205'
count=-1
period='1d'
xtdata.subscribe_whole_quote(code_list=stock_list)
for stock in stock_list:
    xtdata.subscribe_quote(stock_code=stock,start_time=start_date,end_time=end_date,count=-1,period=period)
def test():
    df=xtdata.get_market_data_ex(stock_list=stock_list,
            start_time=start_date,end_time=end_date,period=period,count=count)
    print(df)
schedule.every(3).seconds.do(test)
while True:
    schedule.run_pending()
    time.sleep(1)

10读取本地数据

from xtquant import xtdata
from xtquant import xttrader
stock_code='000001.SZ'
period='1d'
start_time='20200101'
end_time='20251205'
incrementally = None
xtdata.download_history_data(
    stock_code=stock_code,
    period=period,
    start_time=start_time,
    end_time=end_time,
    incrementally=incrementally)
df=xtdata.get_local_data(
    stock_list=[stock_code],
    period=period,
    start_time=start_time,
    end_time=end_time,
    count=-1
)
print(df)

11单线程下载历史行情数据

from xtquant import xtdata
from xtquant import xttrader
stock_list=['513100.SH','000001.SZ','600111.SH']
for stock in stock_list:
    stock_code=stock
    period='1d'
    start_time='20250101'
    end_time='20501208'
    incrementally = True
    xtdata.download_history_data(stock_code=stock_code,
                                 start_time=start_time,
                                 end_time=end_time,
                                 period=period,incrementally=incrementally)
df=xtdata.get_local_data(
    stock_list=stock_list,
    period='1d',
    start_time='20250101',
    end_time='20501208',
    count=-1
)
print(df)

12多线程下载数据

from xtquant import xtdata
from xtquant import xttrader
stock_list=['513100.SH','000001.SZ','600111.SH']
period='1d'
start_time='20250101'
end_time='20251209'
incrementally = True
def on_progress(d):
    print(d)
xtdata.download_history_data2(
    stock_list=stock_list,
    period=period,
    start_time=start_time,
    end_time=end_time,
    incrementally=incrementally,
    callback=on_progress
)
df=xtdata.get_local_data(
    stock_list=stock_list,
    start_time=start_time,
    end_time=end_time,
    period=period,
    count=-1,
    fill_data=True
)
print(df)

13下载财务数据

from xtquant import xtdata
from xtquant import xttrader
stock_list=['000001.SZ','600111.SH']
table_list=['Balance','Income']
xtdata.download_financial_data(stock_list=stock_list,table_list=table_list)
df=xtdata.get_financial_data(
    stock_list=stock_list,
    table_list=table_list,
    start_time='20240101',
    end_time='20251210'
)
print(df)

14基础数据何板块成分股

from xtquant import xtdata
from xtquant import xttrader
stock_code='000001.SZ'
#获取基础数据
info=xtdata.get_instrument_detail(stock_code=stock_code)
print(info)
#板块成分股数据
#1下载板块--2查询板块-3读取板块
#1下载板块
#xtdata.download_sector_data()
#2查询板块
df=xtdata.get_sector_list()
#print(df)
df=xtdata.get_stock_list_in_sector(sector_name='创业板')
print(df)
#获取指数权重
df=xtdata.get_index_weight(index_code='000300.SH')
print(df)

内容我全部上线了可以直接加入下载,专业的量化社区

d3d0cbc30c7a4ad9a41f6b2cad4e222e.jpg

不懂的问我就可以,源代码直接找我要合集的就可以,网页不好复制的话

a511dc29336353394c156ac559a6f580.jpg

给大家的量化福利,需要的可以找我

eccb72153cf7922c4c38a2d286064521.png

回复

您需要登录后才可以回帖 登录 | 立即注册

客服专线

400-080-8112

用思考的速度交易,用真诚的态度合作,我们是认真的!
  • 关注公众号
  • 添加微信客服
Copyright © 2001-2025 迅投QMT社区 版权所有 All Rights Reserved. 京ICP备2025122616号-3
关灯 快速发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表