欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 求诊断

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有3183人关注过本帖树形打印复制链接

主题:求诊断

帅哥哟,离线,有人找我吗?
wb5272
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:57 积分:294 威望:0 精华:0 注册:2012/3/15 15:32:30
求诊断  发帖心情 Post By:2013/6/3 9:40:29    Post IP:61.165.250.238[显示全部帖子]

我写个小程序,其中关于成交量的句子v1,我让其显示出来,但是信号和程序表达不一致,我在注释中标出,我查了很久没查出原因,请高手们帮我看一下,多谢。

VARIABLE:buy1=2,cross1=2;
T1:TIME>OPENTIME(1)+500 AND TIME<=OPENTIME(1)+2000;
T2:TIME>OPENTIME(1)+2000 and time<closetime(0)-4000-1500;

多:=(c-l)/c*1000;
空:=(h-c)/c*1000;
方向0:=多-空;
方向:ma(方向0,3);

vol2:=vol;
vol3:=ma(vol,10);
voll:=(vol2/vol3-1)*100-5;
v1:voll;
//这句的v1>100,好像不起作用?请帮我看一下;
if  v1>100 and 方向>0 and t1 then begin
 buy1:=1;
 end;
 if v1>100 and 方向>0 and t2 then begin
 buy2:=1;
 end;
 //这句的v1>100,好像不起作用?请帮我看一下;
 if v1>100 and 方向<0 and t1 then begin
 buy1:=0;
 end;
 
 if v1>100 and 方向<0 and t2 then begin
 buy2:=0;
 end;
 
// if cross(ma(c,5),ma(c,10)) then
// cross1:=1;
// if cross(ma(c,10),ma(c,5)) then
// cross1:=0;
 
 b1:buy1;
 c1:cross1;
 sell(holding>0 and time=closetime(0),0,thisclose);
 sellshort(holding<0 and time=closetime(0),0,thisclose);
 
 sell(buy2=0 and holding>0 and t2,0,thisclose);
 sellshort(buy2=1 and holding<0 and t2,0,thisclose);
 
/买1:buy(buy1 and holding=0 and t1,20%,thisclose);
 买2:buy(buy2 and holding=0 and t2,20%,thisclose);
 
 buyshort(buy1=0 and holding=0 and t1,20%,thisclose);
 buyshort(buy2=0 and holding=0 and t2,20%,thisclose);


 回到顶部
帅哥哟,离线,有人找我吗?
wb5272
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:57 积分:294 威望:0 精华:0 注册:2012/3/15 15:32:30
  发帖心情 Post By:2013/6/4 8:07:38    Post IP:61.165.250.238[显示全部帖子]

比如我加在PTA5分钟K线,虽然我设定v1>100时,buy1=1,但实际是v1<100时,buy1却可能变成1了?谢谢


 回到顶部
帅哥哟,离线,有人找我吗?
wb5272
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:57 积分:294 威望:0 精华:0 注册:2012/3/15 15:32:30
  发帖心情 Post By:2013/6/10 22:30:35    Post IP:61.165.250.238[显示全部帖子]

即/这句的v1>100,好像不起作用?请帮我看一下;
显示的v1虽然小于100,应该不符合条件不能开仓,但是仍然开仓了


 回到顶部