- 注册时间
- 2014-9-18
- 最后登录
- 2016-4-25
- 阅读权限
- 20
- 积分
- 127
- 精华
- 0
- 帖子
- 38
|
本帖最后由 PTST 于 2015-3-19 12:01 编辑
序列变量和单值变量不分- //variable: QkUp(0),QkDn(0);
- QkUp:=C;QkDn:=C;
- hh:=h;ll:=l;
- Sh:=h;Sl:=l;
- for i=0 to DataCount-1 do begin
- if Sh[i]<Sh[i-1] then Sh[i]:=Sh[i-1];
- if SL[i]>Sl[i-1] then Sl[i]:=Sl[i-1];
- end;
- for i=0 to datacount do begin QkUp[i]=0;QkDn[i]=0;end;
- j:=0;i:=1;
- while j<2 and i<datacount do begin
- if ll[i]>hh[i+1] and hh[i+1]<sl[i] then begin QkUp[i]:=1;j:=j+1;end;
- if hh[i]<ll[i+1] and ll[i+1]>sh[i] then begin QkDn[i]:=1;j:=j+1;end;
- i:=i+1;
- end;
- blQkUp:=BarsLast(QkUp>0.5,2)+1;
- blQkDn:=BarsLast(QkDn>0.5,2)+1;
- UpE:=backset(islastbar,blQkup);
- DnE:=backset(islastbar,blQkDn);
- BsQk:=barssince(UpE=1);
- BpQk:=barssince(DnE=1)+1;
- UpCr:=strtonum(numtostr(ref(barpos,BsQk),0));
- DnCr:=strtonum(numtostr(ref(barpos,BpQk),0));
- RefL:=strtonum(numtostr(ref(l,BpQk),2));
- Refh:=strtonum(numtostr(ref(h,bpqk-1),2));
- hhvsh:=strtonum(numtostr(hhv(sh,BpQk),2));
- MaxDnL:=max(Refh,hhvsh);
- MaxDnH:=StrToNum(numtostr(ref(l,BpQk),2));
- UpRefL:=StrToNum(NumToStr(ref(l,BsQk),2));
- UpRefh:=StrToNum(NumToStr(ref(h,BsQk+1),2));
- LlvSL:=StrToNum(NumToStr(LLV(sl,BsQk),2));
- MinUpH:=min(UpRefL,LlvSL);
- MinUpL:=UpRefh;
- FILLRGN(barpos>UpCr and MinUpH>MinUpL and MinUpH<=SYSPARAM(4) and MinUpL>=SYSPARAM(5),MinUpH,MinUpL),ColorGray;
- FILLRGN(barpos>DnCr and MaxDnL<MaxDnH and MaxDnH<=SYSPARAM(4) and MaxDnL>=SYSPARAM(5),MaxDnH,MaxDnL),ColorGray;
复制代码运行代码
|
|