Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共16 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:关于CALLSTOCK

1楼
海沙 发表于:2014/8/22 10:48:52
我的策略是在指数上运行的操作对象是主力合约,限价下单。使用函数CALLSTOCK("IF00",VTCLOSE)后,没有信号了,去掉这句后策略运行正常。为什么
[此贴子已经被作者于2014/8/22 10:49:32编辑过]
2楼
jinzhe 发表于:2014/8/22 10:49:25

if00用单引号不是双引号

3楼
海沙 发表于:2014/8/22 10:51:30
换成单引号后还是不行
4楼
海沙 发表于:2014/8/22 10:55:42
换成单引号后还是不行,用SHIFT+Q查了一下,得不到最新价格。代码是这样:myenterprice:=callstock('if00',vtclose);查出来后如截图。
图片点击可在新窗口打开查看此主题相关图片如下:7.jpg
图片点击可在新窗口打开查看
5楼
jinzhe 发表于:2014/8/22 11:00:47
改完代码后保存一下,
6楼
海沙 发表于:2014/8/22 11:09:02

老大,我都保存好几次了。

这是我完整的代码

    if refcykg=1 and refc>pp and h>highestaftercross then
      begin
//        myenterprice:=max(highestaftercross,o);
        myenterprice:=callstock("if00",vtclose);
        if holding<0 then
          begin
            sellshort(1,holdingvol,limitr,myenterprice+hd*mindiff),ignorecheckprice,orderqueue;
            holdingvol:=0;
            buy(1,firstvol,limitr,myenterprice+hd*mindiff),ignorecheckprice,orderqueue;
            holdingvol:=holdingvol+firstvol;
            lastprice:=enterprice,noaxis; 
          end
      end

[此贴子已经被作者于2014/8/22 11:10:24编辑过]
7楼
海沙 发表于:2014/8/22 11:12:15

上面代码不对。

是这个

if refcykg=1 and refc>pp and h>highestaftercross then
      begin
//        myenterprice:=max(highestaftercross,o);
        myenterprice:=callstock('if00',vtclose);
        if holding<0 then
          begin
            sellshort(1,holdingvol,limitr,myenterprice+hd*mindiff),ignorecheckprice,orderqueue;
            holdingvol:=0;
            buy(1,firstvol,limitr,myenterprice+hd*mindiff),ignorecheckprice,orderqueue;
            holdingvol:=holdingvol+firstvol;
            lastprice:=enterprice,noaxis; 
          end
      end
     

8楼
jinzhe 发表于:2014/8/22 11:18:39


myenterprice:=callstock('if00',vtclose);
你直接写这句,不要加前面那些前置的判断。看看有没数据

如果有数据,那么说明你的判断条件没满足所才导致的你上面代码里面的myenterrpcie没有数据

9楼
海沙 发表于:2014/8/22 11:23:17

嘿嘿,是我没有把代码全部改过来,现在正常了。

再问一个问题,市价指令MARKET一定要等到下周期开盘吗?有没有本周期内的市价指令?意思就是说按信号出现时的市价去下单.

[此贴子已经被作者于2014/8/22 11:24:28编辑过]
10楼
jinzhe 发表于:2014/8/22 11:30:50
不是,市价的意思是:实际下单按照市价下单,在测评里面才是次周期开盘价
共16 条记录, 每页显示 10 条, 页签: [1] [2]


Powered By Dvbbs Version 8.3.0
Processed in 0.02197 s, 3 queries.