以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  困扰几个月的问题了,把我的代码贴出来,请大师指点  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=52762)

--  作者:证通的曹琴
--  发布时间:2013/6/3 16:59:47
--  困扰几个月的问题了,把我的代码贴出来,请大师指点

这个问题以后困扰了我好几个月了,快崩溃了!

 

我一直想用MACD 来下单的

ZH1:\'803731\';
PZ1:\'IF06\';
VARIABLE:A=0;
VARIABLE:B=0;
VARIABLE:E=0;
VARIABLE:D=0;

thisc:=CALLSTOCK(stklabel,vtclose,1,0);
MA5:=MA(thisc,5);
MA10:=MA(thisc,10);
ENTERTIME:=TIME>090000  AND TIME<151400;
MACD1:=stkindi(stklabel,\'MACD.MACD1\',0,1,0);
h1:=CALLSTOCK(stklabel,vthigh,3,-1);
l1:=CALLSTOCK(stklabel,vtlow,3,-1);
h2:=CALLSTOCK(stklabel,vthigh,2,-1);
l2:=CALLSTOCK(stklabel,vtlow,2,-1);
thish:CALLSTOCK(stklabel,vthigh,1,0);
thisl:CALLSTOCK(stklabel,vtlow,1,0);
15分钟的最低价:l1;
15分钟的最高价:h1;

//早盘15分钟突破
if Tholding=0 and thish>15分钟的最高价+m  AND thisl>MA5 AND time<095000  then begin
 Tbuy(1,1,mkt,0,0);
 end  
 if Tholding=0 and thisl<15分钟的最低价-m  AND thish<MA10  AND time<095000 then begin
   Tbuyshort(1,1,mkt,0,0);
 end
//开平反手

if Tholding>0 and Tenterbars>10 AND MACD1<0   AND ENTERTIME THEN begin
   Tsell(1,0,mkt,0,0);
   tBUYSHORT(1,2,MKT,0,0);
   end 
  if Tholding<0 and  Tenterbars>10 AND MACD1>0  AND ENTERTIME then begin
  Tsellshort(1,0,mkt,0,0);
  Tbuy(1,2,mkt,0,0);
end

 

 

我是在10笔图上跑的,引用的一分钟的数据
 
我的想法主要是通过MACD>0 或<0 开仓的

可以他总是在图表上显示的位置不开仓, 而在下一分钟上开仓。

 

哪位大师可以帮我一下,不胜感激!!!

 

[此贴子已经被作者于2013-6-3 17:01:17编辑过]

--  作者:jinzhe
--  发布时间:2013/6/3 17:09:32
--  
走完k线模式?
--  作者:证通的曹琴
--  发布时间:2013/6/3 17:15:40
--  

固定时间一秒