编写要求:
以下是休版的大智慧源码,希望老师能改成飞狐可用的,谢谢
{平均线引用}{要跟系统自带的MA公式中的系数一致,自己去调整,没有7条平均线的,自己可以加到7条线}
WM1:="ma.ma1#day"(5);
WM2:="ma.ma2#day"(10);
WM3:="ma.ma3#day"(20);
WM4:="ma.ma4#day"(30);
WM5:="ma.ma5#day"(60);
WM6:="ma.ma6#day"(120);
WM7:="ma.ma6#day"(250);
{各个平均线与昨天收盘价百分比}
ZF1:=(WM1-DYNAINFO(3))/DYNAINFO(3)*100;
ZF2:=(WM2-DYNAINFO(3))/DYNAINFO(3)*100;
ZF3:=(WM3-DYNAINFO(3))/DYNAINFO(3)*100;
ZF4:=(WM4-DYNAINFO(3))/DYNAINFO(3)*100;
ZF5:=(WM5-DYNAINFO(3))/DYNAINFO(3)*100;
ZF6:=(WM6-DYNAINFO(3))/DYNAINFO(3)*100;
ZF7:=(WM7-DYNAINFO(3))/DYNAINFO(3)*100;
{限制平均线显示范围 可以改10为10以下的数,缩小平均线显示范围}
if abs(ZF1)<10 then begin YR1:=WM1;end;
if abs(ZF2)<10 then begin YR2:=WM2;end;
if abs(ZF3)<10 then begin YR3:=WM3;end;
if abs(ZF4)<10 then begin YR4:=WM4;end;
if abs(ZF5)<10 then begin YR5:=WM5;end;
if abs(ZF6)<10 then begin YR6:=WM6;end;
if abs(ZF7)<10 then begin YR7:=WM7;end;
{平均线,价格,百分比显示}
MA1:YR1,DOTLINE; DRAWTEXT(BARSTATUS=2,MA1,'5日线:'+NUMTOSTRN( MA1,2)+'('+NUMTOSTRN( ZF1,2)+'%)'),ALIGN2,VALIGN2,coloraaddaa;
MA2:YR2,DOTLINE; DRAWTEXT(BARSTATUS=2,MA2,'10日线:'+NUMTOSTRN( MA2,2)+'('+NUMTOSTRN( ZF2,2)+'%)'),ALIGN2,VALIGN2,coloraaddaa;
MA3:YR3,DOTLINE; DRAWTEXT(BARSTATUS=2,MA3,'20日线:'+NUMTOSTRN( MA3,2)+'('+NUMTOSTRN( ZF3,2)+'%)'),ALIGN2,VALIGN2,coloraaddaa;
MA4:YR4,DOTLINE; DRAWTEXT(BARSTATUS=2,MA4,'30日线:'+NUMTOSTRN( MA4,2)+'('+NUMTOSTRN( ZF4,2)+'%)'),ALIGN2,VALIGN2,coloraaddaa;
MA5:YR5,DOTLINE; DRAWTEXT(BARSTATUS=2,MA5,'60日线:'+NUMTOSTRN( MA5,2)+'('+NUMTOSTRN( ZF5,2)+'%)'),ALIGN2,VALIGN2,coloraaddaa;
MA6:YR6,DOTLINE; DRAWTEXT(BARSTATUS=2,MA6,'120日线:'+NUMTOSTRN( MA6,2)+'('+NUMTOSTRN( ZF6,2)+'%)'),ALIGN2,VALIGN2,coloraaddaa;
MA7:YR7,DOTLINE; DRAWTEXT(BARSTATUS=2,MA7,'250日线:'+NUMTOSTRN( MA7,2)+'('+NUMTOSTRN( ZF7,2)+'%)'),ALIGN2,VALIGN2,coloraaddaa;
{信号与提示 不要可以删去}
DRAWICON(cross(c>MA1,0.5) or cross(c>MA2,0.5) or cross(c>MA3,0.5) or cross(c>MA4,0.5) or cross(c>MA5,0.5) or cross(c>MA6,0.5) or cross(c>MA7,0.5),c,7);
DRAWTEXT(cross(c>MA1,0.5) or cross(c>MA2,0.5) or cross(c>MA3,0.5) or cross(c>MA4,0.5) or cross(c>MA5,0.5) or cross(c>MA6,0.5) or cross(c>MA7,0.5),c,' 上突'),color00ffff;
DRAWICON(cross(c 解答: ?
Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号
免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!