您现在的位置:程序化交易>> 期货公式>> 文华财经>> 文华财经知识>>正文内容

老师麻烦帮把tbquant改成文华 [文华财经]

  • 咨询内容:  
    Params   //此处添加参数 Numeric XVol(1000);//有效成交量 Numeric losebalance(2);//连续失衡次数(计算堆积) Numeric N(1.5);//失衡比率 Numeric X(10);//微单判断比例 Numeric Lots(1);//手数 Numeric PL(100);//止盈跳 Numeric SL(100);//止损跳 Numeric NT(1);//夜盘交易时间参数1是默认21-23时,参数2是21-02.29停止交易; Numeric TICKN(120);//默认120个TICK更新一次,即1分钟;Vars //此处添加变量 Numeric avg; Global Integer BarCountstar(0);
    Global Numeric DVol_Ask(0); Global Numeric DVol_Bid(0); Global Numeric DVol_Delta(0); Global Numeric SumVol(0); Numeric Askprice; Numeric Bidprice;
    Numeric A_Vol;  Numeric B_Vol; Numeric AH_price; Global Numeric Up_Aprice; Numeric BL_price; Global Numeric Dn_Bprice; Bool Demand; Bool Supply; Bool Max_cond; Bool Min_cond; Numeric SSprice; Global Numeric SS_vol; Numeric j; Numeric i; Global Numeric count_J; Global Numeric count_K; Numeric i_Num; Numeric up_Vol; Numeric dn_Vol; Numeric D_i(0); Numeric S_i(0); Global Integer KG; Global Integer Bar_Red_Green(0); Global Integer PG; Global Integer PN; Global Position myPos; Global Integer CloseClear(0); Global Integer PGG; Global Integer PNN; Global Numeric W_maxprice; Global Numeric M_minprice; Global Numeric ShortEntryprice(0); Global Numeric LongEntryprice(0); Global Numeric Min_price; Global Numeric Max_price; Bool PK_cond1; Bool PK_cond2; Bool PD_cond1; Bool PD_cond2; Global Integer runCoreModule(0); //poc Integer poc_SumVol; Global Numeric poc_Vol; Global Numeric poc_Ask; Global Numeric poc_Bid; Global Numeric Max_pocVol; Global Numeric poc_price; //数据录入 Global Array<Numeric> Alastprice; Global Array<Numeric> Blastprice; Global Array<Numeric> arraskvol; Global Array<Numeric> arrbidvol; Global Array<Numeric> Avol; Global Array<Numeric> Bvol; Global Array<Numeric> Aprice; Global Array<Numeric> Bprice; Global Array<Numeric> A_lastP; Global Array<Numeric> B_lastP; Global Numeric tempprice; Global Numeric tickaskP; Global Numeric tickbidP; Global Numeric tickVoL; Global Integer i_N(0); Numeric i_Max; Numeric lx; Numeric sx; Global Numeric sumA(0); Global Numeric sumB(0); //Tick Tick tickdata; Tick tickdataref; Global Numeric D_close; Global Numeric D_open; Global Numeric D_high; Global Numeric D_Low;
    Defs //插入自定义公式(自定义模块) Integer LogFile(String str) { FileAppend("D:\\orderflow_日志\\"+Symbol+"日志.tbf","["+Text(SystemDateTime())+"]"+ str); Return 0; }  Integer TradeLogFile(String str) { FileAppend("D:\\orderflow_日志\\"+Symbol+"交易日志.tbf","["+Text(SystemDateTime())+"]"+ str); Return 0; }  //数据录入 Integer loadData(ArrayRef<Integer> indexs) { GetTick(tickdata,0); GetTick(tickdataref,1); tempprice=tickdata.last; tickaskP=tickdataref.bidask1.askP; tickbidP=tickdataref.bidask1.bidP; tickVoL=tickdata.volume; Commentary("tempprice"+Text(tempprice)); Commentary("tickaskP"+Text(tickaskP)); Commentary("tickbidP"+Text(tickbidP)); i_N=i_N+1; if(tempprice==tickaskP) { Alastprice[i_N]=tempprice; arraskvol[i_N]=tickVoL; DVol_Ask=DVol_Ask+arraskvol[i_N]; } if(tempprice==tickbidP) { Blastprice[i_N]=tempprice; arrbidvol[i_N]=tickVoL; DVol_Bid=DVol_Bid+arrbidvol[i_N]; }  if(tempprice==tickaskP) { for i=1 to i_N-1 { if(tickaskP==Alastprice[i] and tempprice==Alastprice[i] and Alastprice[i]<>InvalidNumeric and Alastprice[i]>0) { SS_vol=arraskvol[i]+SS_vol; //Print("A_SS_vol"+text(SS_vol)); //Print("tickVoL"+text(tickVoL)); } } sumA=sumA+1; Aprice[sumA]=tempprice; Avol[Aprice[sumA]]=SS_vol; SS_vol=0; //Print("sumA:= "+Text(sumA)+"Aprice"+Text(Aprice[sumA])+" Avol:= "+ text(Avol[Aprice[sumA]])); }else if(tempprice==tickbidP) { for i=1 to i_N-1 { if(tickbidP==Blastprice[i] and tempprice==Blastprice[i] and Blastprice[i]<>InvalidNumeric and Blastprice[i]>0) { SS_vol=arrbidvol[i]+SS_vol; //Print("B_SS_vol"+text(SS_vol)); //Print("tickVoL"+text(tickVoL)); } } sumB=sumB+1; Bprice[sumB]=tempprice; Bvol[Bprice[sumB]]=SS_vol; SS_vol=0; //Print("sumB:= "+Text(sumB)+"Bprice"+Text(Bprice[sumB])+" Bvol:= "+text(Bvol[Bprice[sumB]])); } Events
  • 文华技术人员:  您是实盘用户,可以联系您的服务经理进行处理。
    菜单-》帮助-》登录文文通VIP服务软件。

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信号:cxh99cxh99  进行 有偿收费 编写!

怎么收费,代编流程等详情请点击阅读!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容