欢迎您光临花生网社区!
| |

 找回密码
 立即注册
查看: 4252|回复: 5
打印 上一主题 下一主题

求金魔方的开发人员帮忙! [复制链接]



Rank: 2

跳转到指定楼层
1#
发表于 2013-4-18 13:07:11 |只看该作者 |倒序浏览 | [分享到 腾讯微博 新浪微博]
本帖最后由 pixcn007 于 2013-4-18 16:42 编辑

下面的代码,在飞狐、大交易师都能正常运行,但是在金魔方上运行有错误,请帮忙看看是哪儿的问题?
QkUp:=c;QkDown:=c;hh:=h;ll:=l;
Sh:=h;Sl:=l;
for i=0 to DataCount-1 do begin
if Sh<Sh[i-1] then Sh:=Sh[i-1];
if SL>Sl[i-1] then Sl:=Sl[i-1];
end;
for i=0 to datacount do begin
qkup=0;qkdown=0;end;
j:=0;i:=1;
while j<2 and i<datacount do begin
if ll>hh[i+1] and hh[i+1]<sl then begin QkUp:=-1;j:=j+1;end;
if hh<ll[i+1] and ll[i+1]>sh then begin QkDown:=-1;j:=j+1;end;
i:=i+1;
end;
UpE:=backset(islastbar,barslast(Qkup=-1)+1);
DownE:=backset(islastbar,barslast(QkDown=-1)+1);
BsQk:=barssince(UpE=1);BpQk:=barssince(DownE=1)+1;
upcr:=strtonum(numtostr(ref(barpos,BsQk),0));
downcr:=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));
MaxDownL:=max(refh,hhvsh);
MaxDownH:=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;

使用道具 举报



Rank: 8Rank: 8

2#
发表于 2013-4-18 15:27:34 |只看该作者 | [分享到 腾讯微博 新浪微博]

test1.png


好像是找缺口的公式,我这里运行是这样的。正常吗?


使用道具 举报



Rank: 2

3#
发表于 2013-4-18 16:25:47 |只看该作者 | [分享到 腾讯微博 新浪微博]
John 发表于 2013-4-18 15:27
好像是找缺口的公式,我这里运行是这样的。正常吗?

你用的就是我上面的代码吗?

使用道具 举报



Rank: 8Rank: 8

4#
发表于 2013-4-19 12:34:00 |只看该作者 | [分享到 腾讯微博 新浪微博]
是的

使用道具 举报



Rank: 6Rank: 6

5#
发表于 2013-4-19 13:12:47 |只看该作者 | [分享到 腾讯微博 新浪微博]
我这里测试,飞狐不能用,在for那行说语法错误;
在金魔方里公式能正常编译通过,但不显示缺口标志;v3.29版

使用道具 举报



Rank: 2

6#
发表于 2015-3-19 11:43:59 |只看该作者 | [分享到 腾讯微博 新浪微博]
本帖最后由 PTST 于 2015-3-19 12:01 编辑

序列变量和单值变量不分
  1. //variable: QkUp(0),QkDn(0);
  2. QkUp:=C;QkDn:=C;
  3. hh:=h;ll:=l;
  4. Sh:=h;Sl:=l;
  5. for i=0 to DataCount-1 do begin
  6.         if Sh[i]<Sh[i-1] then Sh[i]:=Sh[i-1];
  7.         if SL[i]>Sl[i-1] then Sl[i]:=Sl[i-1];
  8. end;
  9. for i=0 to datacount do begin QkUp[i]=0;QkDn[i]=0;end;
  10. j:=0;i:=1;
  11. while j<2 and i<datacount do begin
  12.         if ll[i]>hh[i+1] and hh[i+1]<sl[i] then begin QkUp[i]:=1;j:=j+1;end;
  13.         if hh[i]<ll[i+1] and ll[i+1]>sh[i] then begin QkDn[i]:=1;j:=j+1;end;
  14.         i:=i+1;
  15. end;
  16. blQkUp:=BarsLast(QkUp>0.5,2)+1;
  17. blQkDn:=BarsLast(QkDn>0.5,2)+1;
  18. UpE:=backset(islastbar,blQkup);
  19. DnE:=backset(islastbar,blQkDn);
  20. BsQk:=barssince(UpE=1);
  21. BpQk:=barssince(DnE=1)+1;
  22. UpCr:=strtonum(numtostr(ref(barpos,BsQk),0));
  23. DnCr:=strtonum(numtostr(ref(barpos,BpQk),0));
  24. RefL:=strtonum(numtostr(ref(l,BpQk),2));
  25. Refh:=strtonum(numtostr(ref(h,bpqk-1),2));
  26. hhvsh:=strtonum(numtostr(hhv(sh,BpQk),2));
  27. MaxDnL:=max(Refh,hhvsh);
  28. MaxDnH:=StrToNum(numtostr(ref(l,BpQk),2));
  29. UpRefL:=StrToNum(NumToStr(ref(l,BsQk),2));
  30. UpRefh:=StrToNum(NumToStr(ref(h,BsQk+1),2));
  31. LlvSL:=StrToNum(NumToStr(LLV(sl,BsQk),2));
  32. MinUpH:=min(UpRefL,LlvSL);
  33. MinUpL:=UpRefh;
  34. FILLRGN(barpos>UpCr and MinUpH>MinUpL and MinUpH<=SYSPARAM(4) and MinUpL>=SYSPARAM(5),MinUpH,MinUpL),ColorGray;
  35. FILLRGN(barpos>DnCr and MaxDnL<MaxDnH and MaxDnH<=SYSPARAM(4) and MaxDnL>=SYSPARAM(5),MaxDnH,MaxDnL),ColorGray;
复制代码运行代码



使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册


bottom

Archiver|www.hs633.com ( 粤ICP备11107430号 )

GMT+8, 2024-5-5 05:11 , Processed in 0.101562 second(s), 11 queries .

花生网 Copyright©2012-2014

回顶部