这是一个模型求帮助 [金字塔]
- 咨询内容:
input:n1(5,1,999,1);input:n2(10,1,999,1);input:n3(20,1,999,1);input:n4(60,1,999,1);input:n5(100,1,999,1);input:n6(300,1,999,1);input:n7(900,1,999,1);input:n8(150,1,999,1);//input:P(26,1,100,8);//input:S(12,5,40,4);//input:M(9,2,60,6);
ma5:=rounds(ma(C,n1),4),COLORWHITE;ma10:=rounds(ma(C,n2),4),COLORWHITE;ma20:=rounds(ma(C,n3),4),COLORWHITE;ma60:=rounds(ma(C,n4),4),COLORWHITE;ma100:=rounds(ma(C,n5),4),COLORWHITE;ma180:=rounds(ma(c,180),4),colorwhite;ma300:=rounds(ma(C,n6),4),COLORWHITE;ma900:=rounds(ma(C,n7),4),COLORWHITE;ma150:=rounds(ma(C,n8),4),COLORWHITE;
cond:=day<>ref(day,1);n:barslast(cond)+1,COLORWHITE,NODRAW;NN:TODAYBAR,COLORWHITE,NODRAW;jj:sum(amount,n)/sum(vol,n)/multiplier;cond1:=(hhv(h,todaybar)-jj)/jj<0.005;cond2:=(jj-llv(l,todaybar))/jj<0.005;ZD:=STKINDIEX('HG00','Formula2.ZD',0,1,-1,1000),NODRAW;ZK:=STKINDIEX('HG00','Formula2.ZK',0,1,-1,1000),NODRAW;
CYC:=barslast(date<>ref(date,1))+1;DayMa:rounds(sum(amount,CYC)/sum(vol,CYC)/multiplier,1),COLORWHITE,NODRAW;//适用日线及日线以下周期的K线,也试用所有品种//Up:=Rounds(DYNAINFO(14)*100,2),COLORWHITE,NODRAW;//DayMa:DYNAINFO(11),COLORWHITE,NODRAW;ZGJ:HHV(Ref(H,1),TODAYBAR),COLORRED;ZDJ:LLV(Ref(L,1),TODAYBAR),COLORWHITE;DRAWTEXT(h=zgj,h,'H',COLORWHITE);DRAWTEXT(l=zdj,l,'L',COLORWHITE);FlagHigh:Ref(H,ENTERBARS);FlagLow:Ref(L,ENTERBARS);Duo1: = H>ZGJ and H>ma180 and Ma5>Ma60 and Ma10>Ma60 and Ma20>Ma60 and Ma150>Ma900 ,COLORWHITE,NODRAW; //NOAXIS;//,Kong1:= L<ZDJ and L<ma180 and Ma5<Ma60 and Ma10<Ma60 and Ma20<Ma60 and Ma150<Ma900 ,COLORGREEN,NODRAW;//NOAXIS;//,
Duo2: =L<ma180 or L<FlagLow ,COLORGREEN,NODRAW;//NOAXIS;Kong2:=H>ma180 or H>FlagHigh ,colorwhite,nodraw;//NOAXIS;
VARIABLE:UpTimes=0,DnTimes=0;UPTP:H>ZGJ,NODRAW;DNTP:L<ZDJ,NODRAW;
if Duo2=1 then UpTimes:=0;if Kong2=1 then DnTimes:=0;
if UPTP=1 then begin //or Duo2=1 DnTimes:=0; if UpTimes>=0 then UpTimes:=UpTimes+1;endif DNTP=1 then begin //or Kong2=1 UpTimes:=0; if DnTimes>=0 then DnTimes:=DnTimes+1;end
Up:UpTimes,NODRAW;Dn:DnTimes,NODRAW;//DRAWTEXT(Up=1,h,'上',COLORWHITE);//DRAWTEXT(Dn=1,l,'下',COLORWHITE);
//DRAWTEXT(Duo=1,h,'d',COLORWHITE);//DRAWTEXT(Kong=1,l,'k',COLORWHITE);
KD:=Duo1=1; //开多条件PD:=Duo2=1; //平多条件KK:=Kong1=1; //开空条件PK:=Kong2=1; //平空条件
平空:SELLSHORT(PK,1,THISCLOSE); //平空信号开多:BUY(KD AND HOLDING=0,1,THISCLOSE); //开多信号平多:SELL(PD,1,THISCLOSE); //平多信号开空:BUYSHORT(KK AND HOLDING=0,1,THISCLOSE); //开空信号
Duo:if(holding=1,1,if(holding<1,-1,0)),COLORWHITE,NODRAW;Kong:if(holding=-1,1,if(holding>0,-1,0)),COLORWHITE,NODRAW;DRAWTEXTEX(1,1,0,0,STKLABEL+':'+Numtostr(Duo,0)+','+Numtostr(Kong,0));// +','+Numtostr(Duo1,0)+','+Numtostr(Kong1,0));
这是一个VBA程序的进场模型,我的目的是对进场条件DUO1,KONG1,怎么能限制在第一时间进场,比如突破,第一时间符合条件突破了,后面继续突破也是符合条件,那么我用VBA程序控制的时候不一定是第一时间进场,因为后面不断突破高点都是符合条件的,
- 金字塔客服:
VBA体现在哪里?
- 用户回复:
这是一个均线分析,VBA就是依据这里的条件进场的,能在这里面设置我说的那些功能吗,就是在第一时间进场,对第一时间符合条件的一分钟时间点进行计数,比如10点符合第一时间点进场从10点开始计数,
- 网友回复:
这里怎么上传VBA程序
- 网友回复: 上传时添加附件,
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容