您现在的位置:程序化交易>> 期货公式>> 金字塔等>> 金字塔知识>>正文内容

vba传递参数时,发现一个很奇怪的事情--参数值在传递中变了! [金字塔]

  • 咨询内容: 编一个指标:cc:=round(c);hh:=round(h);ll:=round(l);oo:=round(o);rh:ref(hh,1),NODRAW;rl:ref(ll,1),NODRAW;DEBUGFILE('e:\rd.txt','rh='&NUMTOSTR(RH,0)& ' RL=%.0f',RL);
    编一个自定义函数:Function BOTP(Formula,KY,RH,RL,SS)BOTP=0application.msgout TIME & " RH:" & RH & " RL:" & RLEnd Function
    然后将技术指标加载到C05合约上vba输出结果如下:10:39:22 RH:2397 RL:239010:39:22 RH:2394 RL:238910:39:22 RH:2394 RL:239110:39:22 RH:2395 RL:239210:39:22 RH:2396 RL:239410:39:22 RH:2395 RL:239410:39:22 RH:2395 RL:239410:39:22 RH:2394 RL:239310:39:22 RH:2395 RL:239310:39:22 RH:2395 RL:239410:39:22 RH:2395 RL:239410:39:22 RH:2395 RL:239410:39:22 RH:2395 RL:239310:39:22 RH:2394 RL:239210:39:22 RH:2397 RL:239310:39:22 RH:2401 RL:239510:39:22 RH:2404 RL:240010:39:22 RH:2405 RL:240210:39:22 RH:2411 RL:240510:39:22 RH:2414 RL:241010:39:22 RH:2412 RL:240910:39:22 RH:2412 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2412 RL:241010:39:22 RH:2412 RL:241010:39:22 RH:2412 RL:241110:39:22 RH:2413 RL:241110:39:22 RH:2412 RL:241010:39:22 RH:2412 RL:241110:39:22 RH:2413 RL:241110:39:22 RH:2414 RL:240010:39:22 RH:2412 RL:240810:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2412 RL:241010:39:22 RH:2412 RL:241110:39:22 RH:2412 RL:241110:39:22 RH:2412 RL:241110:39:22 RH:2412 RL:241110:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:240910:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240810:39:22 RH:2410 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2410 RL:240810:39:22 RH:2410 RL:240910:39:22 RH:2411 RL:240910:39:22 RH:2412 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2410 RL:240910:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:241010:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240910:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2410 RL:240810:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2411 RL:240910:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2411 RL:241010:39:22 RH:2410 RL:241010:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2409 RL:240810:39:22 RH:2408 RL:240710:39:22 RH:2407 RL:240610:39:22 RH:2408 RL:240710:39:22 RH:2409 RL:240710:39:22 RH:2410 RL:240810:39:22 RH:2410 RL:240810:39:22 RH:2411 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2408 RL:240710:39:22 RH:2407 RL:240610:39:22 RH:2408 RL:240710:39:22 RH:2408 RL:240710:39:22 RH:2408 RL:240710:39:22 RH:2409 RL:240710:39:22 RH:2409 RL:240710:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2409 RL:240810:39:22 RH:2410 RL:240810:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2409 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:22 RH:2410 RL:240910:39:23 RH:2410 RL:240910:39:29 RH:2410 RL:240910:39:30 RH:2410 RL:240910:39:33 RH:2410 RL:240910:39:39 RH:2410 RL:240910:39:40 RH:2410 RL:240910:39:46 RH:2410 RL:240910:39:47 RH:2410 RL:240910:40:03 RH:2410 RL:240910:40:08 RH:2410 RL:240910:40:09 RH:2410 RL:240910:40:18 RH:2410 RL:240910:40:19 RH:2410 RL:240910:40:23 RH:2410 RL:240910:40:26 RH:2410 RL:240910:40:28 RH:2410 RL:240910:40:37 RH:2410 RL:240910:40:38 RH:2410 RL:240910:40:41 RH:2410 RL:240910:40:43 RH:2410 RL:240910:40:49 RH:2410 RL:240910:40:51 RH:2410 RL:240910:40:52 RH:2410 RL:240910:40:56 RH:2410 RL:240910:40:58 RH:2410 RL:240910:41:05 RH:2410 RL:240910:41:19 RH:2410 RL:240910:41:29 RH:2410 RL:240910:41:35 RH:2410 RL:240910:41:36 RH:2410 RL:240910:41:37 RH:2410 RL:240910:41:38 RH:2410 RL:240910:41:40 RH:2410 RL:240910:41:49 RH:2410 RL:2409rd.txt中显示结果如下:2014-11-27 10:38:57.344    rh=2410 RL=24092014-11-27 10:39:04.442    rh=2410 RL=24092014-11-27 10:39:22.872    rh=2410 RL=24092014-11-27 10:39:23.708    rh=2410 RL=24092014-11-27 10:39:29.793    rh=2410 RL=24092014-11-27 10:39:30.807    rh=2410 RL=24092014-11-27 10:39:33.849    rh=2410 RL=24092014-11-27 10:39:39.932    rh=2410 RL=24092014-11-27 10:39:40.946    rh=2410 RL=24092014-11-27 10:39:46.017    rh=2410 RL=24092014-11-27 10:39:47.031    rh=2410 RL=24092014-11-27 10:40:03.255    rh=2410 RL=24092014-11-27 10:40:08.325    rh=2410 RL=24092014-11-27 10:40:09.350    rh=2410 RL=24092014-11-27 10:40:18.464    rh=2410 RL=24092014-11-27 10:40:19.479    rh=2410 RL=24092014-11-27 10:40:23.535    rh=2410 RL=24092014-11-27 10:40:26.577    rh=2410 RL=24092014-11-27 10:40:28.605    rh=2410 RL=24092014-11-27 10:40:37.733    rh=2410 RL=24092014-11-27 10:40:38.747    rh=2410 RL=24092014-11-27 10:40:41.788    rh=2410 RL=24092014-11-27 10:40:43.815    rh=2410 RL=24092014-11-27 10:40:49.900    rh=2410 RL=24092014-11-27 10:40:51.927    rh=2410 RL=24092014-11-27 10:40:52.941    rh=2410 RL=24092014-11-27 10:40:56.998    rh=2410 RL=24092014-11-27 10:40:58.012    rh=2410 RL=24092014-11-27 10:41:05.109    rh=2410 RL=24092014-11-27 10:41:19.306    rh=2410 RL=24092014-11-27 10:41:29.447    rh=2410 RL=24092014-11-27 10:41:35.529    rh=2410 RL=24092014-11-27 10:41:36.543    rh=2410 RL=24092014-11-27 10:41:37.558    rh=2410 RL=24092014-11-27 10:41:38.573    rh=2410 RL=24092014-11-27 10:41:40.599    rh=2410 RL=24092014-11-27 10:41:49.726    rh=2410 RL=24092014-11-27 10:42:05.950    rh=2410 RL=24092014-11-27 10:42:06.965    rh=2410 RL=24092014-11-27 10:42:08.994    rh=2410 RL=2409

     

  • 金字塔客服: C05合约的3分钟周期,盘中延时刷新设置1000毫秒

     

  • 用户回复: 技术指标上还有一句:BOTP(kccont,RH,RL,SS);
    kccont和SS参数与本问题无关
    还有个问题,为什么vba中输出的数据次数大于指标中输出的次数?

     

  • 网友回复:

    公式是逐k模式运行的,在每根k上多会运行模型。所以也就造成你msgout好多个

    你勾上仅刷最后一根k再去运行看就对了

     

  • 网友回复: 勾选了的!

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 511411198  点击这里给我发消息进行 有偿 编写!不贵!点击查看价格!


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

相关文章

    没有相关内容