欢迎光临散文网 会员登陆 & 注册

量化合约开发(正式版),合约系统开发(方案及逻辑开发)

2023-02-23 20:28 作者:bili_88076104257  | 我要投稿

量化交易如何运作? 量化交易使用基于数据的模型来确定特定结果发生的可能性。与其他形式的交易不同,它完全依赖统计方法和编程来完成此操作。 量化交易与算法交易 算法交易者使用自动系统来分析图表模式,然后代表他们开立和关闭头寸。量化交易者使用统计方法来识别但不一定执行机会。尽管它们彼此重叠,但是这是两种不应该混淆的独立技术。 #plot实例 def test_plot(): #绘制曲线 案例源码I35模式7O98设计O7I8  x=np.linspace(2,21,20)#取闭区间[2,21]之间的等差数列,列表长度20 y=np.log10(x)+0.5 plt.figure()#添加一个窗口。如果只显示一个窗口,可以省略该句。 plt.plot(x,y)#plot在一个figure窗口中添加一个图,绘制曲线,默认颜色 #绘制离散点 plt.plot(x,y,'.y')#绘制黄色的点,为了和曲线颜色不一样 x0,y0=15,np.log10(15)+0.5 plt.annotate('Interpolation point',xy=(x0,y0),xytext=(x0,y0-1),arrowprops=dict(arrowstyle='->'))#添加注释 for x0,y0 in zip(x,y):开发功能:MrsFu123 plt.quiver(x0,y0-0.3,0,1,color='g',width=0.005)#绘制箭头 x=range(2,21,5) y=np.log10(x)+0.5 plt.plot(x,y,'om')#绘制紫红色的圆形的点 x0,y0=7,np.log10(7)+0.5 plt.annotate('Original point',xy=(x0,y0),xytext=(x0,y0-1),arrowprops=dict(arrowstyle='->')) for x0,y0 in zip(x,y): plt.quiver(x0,y0+0.3,0,-1,color='g',width=0.005)#绘制箭头 #设置坐标范围 plt.xlim(2,21)#设置x轴范围 plt.xticks(range(0,23,2))#设置X轴坐标点的值,为[0,22]之间的以2为差值的等差数组 plt.ylim(0,3)#设置y轴范围 #显示图形 plt.show()#显示绘制出的图 #获取所有资金 def get_all_money(codes,names): pro=ts.pro_api('ee5c0e991e17949cdafbcf8ec42321ef4bac94e9ca3474e4d62313a3') path='./All资金流向/' dir=Path(path) if not dir.exists(): os.mkdir(dir) for code,name in zip(codes,names): name=str.replace(name,'*','') file=path+code+name+'.csv' if os.path.exists(file): df=pd.read_csv(file) else: try: df=pro.moneyflow(ts_code=code) df.to_csv(file,encoding='utf_8_sig') except Exception: continue def get_perdata(trade_date,ts_code): pro=ts.pro_api('ee5c0e991e17949cdafbcf8ec42321ef4bac94e9ca3474e4d62313a3') path='./资金流向/' dir=Path(path) if not dir.exists(): os.mkdir(dir) file=path+trade_date+'.csv' if os.path.exists(file): df=pd.read_csv(file) else: df=pro.moneyflow(trade_date=trade_date)

量化合约开发(正式版),合约系统开发(方案及逻辑开发)的评论 (共 条)

分享到微博请遵守国家法律