飞狐长短线赢利主图源码

根据区间高低点的连线以及涨跌幅度来研判买卖,只作为参考,指标理解就是好的!

【长短线赢利】
INPUT:n(2,0,10),CY1(0,0,5),p2(0,0,255),低L(5,1,25),df(0,0,2);
 STICKLINE(C>=O,low,high,0.5,0),colorFF;
 STICKLINE(C>=O,close,open,8,0),color102088;
 STICKLINE(C>=O,close,open,7,0),color102099;
 STICKLINE(C>=O,close,open,6,0),color1020AA;
 STICKLINE(C>=O,close,open,5,0),color1020BB;
 STICKLINE(C>=O,close,open,4,0),color1020CC;
 STICKLINE(C>=O,close,open,3,0),color1020DD;
 STICKLINE(C>=O,close,open,2,0),color1020EE;
 STICKLINE(C>=O,close,open,1,0),color1020FF;
 STICKLINE(C<=O,low,high,0.5,0),colorFF8800;
 STICKLINE(C<=O,close,open,8,0),colorFF7700;
 STICKLINE(C<=O,close,open,7,0),colorFF8800;
 STICKLINE(C<=O,close,open,6,0),colorFF9900;
 STICKLINE(C<=O,close,open,5,0),colorFFAA00;
 STICKLINE(C<=O,close,open,4,0),colorFFBB00;
 STICKLINE(C<=O,close,open,3,0),colorFFCC00;
 STICKLINE(C<=O,close,open,2,0),colorFFDD00;
 STICKLINE(C<=O,close,open,1,0),colorFFEE00;
 A1:=REF(H,N)=HHV(H,2*N+1); B1:=FILTER(A1,N);
 C1:=BACKSET(B1,N+1); D1:=FILTER(C1,N);
 A2:=REF(L,N)=LLV(L,2*N+1); B2:=FILTER(A2,N);
 C2:=BACKSET(B2,N+1); D2:=FILTER(C2,N);
 E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2;
 E2:=(H+L)/2;
 H1:=(D1 AND NOT(D2 AND E1>=E2)) OR BARSTATUS=2 OR BARSCOUNT(C)=1;
 L1:=(D2 AND NOT(D1 AND E1<E2)); H2:=D1 AND NOT(D2 AND E1>=E2);
 X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));
 G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);
 L2:=LD OR BARSTATUS=2 OR BARSCOUNT(C)=1;X2:=REF(BARSLAST(L2),1)+1;
 F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2));
 G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);
 R1:=BACKSET(BARSTATUS=2,BARSLAST(HD)+1); S1:=R1>REF(R1,1);
 T1:=BACKSET(BARSTATUS=2,BARSLAST(LD)+1); U1:=T1>REF(T1,1);
 R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2); S2:=R2>REF(R2,1);
 T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2); U2:=T2>REF(T2,1);
 T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2); U3:=T3>REF(T3,1);
 T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2); U4:=T4>REF(T4,1);
 R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2); S3:=R3>REF(R3,1);
 R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2); S4:=R4>REF(R4,1);
 DRAWLINE(S2,H,S1,H,1),Color009999;
 DRAWLINE(U2,L,U1,L,1),POINTDOT,Color009999;
 DRAWLINE(S3,H,S2,H,1),Color999900;
 DRAWLINE(U3,L,U2,L,1),POINTDOT,Color999900;
 DRAWLINE(S4,H,S3,H,1),ColorEEAAEE;
 DRAWLINE(U4,L,U3,L,1),POINTDOT,ColorEEAAEE;
 DRAWSL(SYSPARAM(1)=BARPOS,REF(L,SYSPARAM(1)=SUM(1,0)-1),0,0,1),COLORGREEN;
 DRAWSL(SYSPARAM(1)=BARPOS,REF(H,SYSPARAM(1)=SUM(1,0)-1),0,0,1),COLORRED;
 TTt:=ISLASTBAR=1;
 AS1:=((H-L)/L)*100;
 AS2:=H-L;
 MAI:=C*1.015;
 MAII:=C*1.03;
 DRAWTEXTEX(TTT,0,310,1,'▼明短线赢利[1.5%--3%:]'+'/'+NUMTOSTR(MAI[SYSPARAM(1)],2)+'--'+NUMTOSTR(MAII [SYSPARAM(1)],2)),Color00dd00;
 DRAWTEXTEX(TTt,0,176,1,'【振幅:'+NUMTOSTR(AS1[SYSPARAM(1)],2)+'% '+NUMTOSTR(AS2[SYSPARAM(1)],2)+'元 】'+''),Colordddd00;
 DRAWTEXTEX(TTT,0,1,1,'【代码:'+STKLABEL+' 名称:'+STKNAME+'】'),ColorffFFFF;DRAWTEXTEX(TTT,0,1,14,'【草根创于2010.11.9晚】'),ColorffFFFF;
 JJJ:=IF(DYNAINFO(8)>0.01,0.01*DYNAINFO(10)/DYNAINFO(8),DYNAINFO(3));
 DDD:=(DYNAINFO(5)<0.01 || DYNAINFO(6)<0.01);
 JJJT:=IF(DDD,1,(JJJ<(DYNAINFO(5)+0.01) && JJJ>(DYNAINFO(6)-0.01)));
 CYC1:IF(JJJT,0.01*EMA(AMOUNT,CY1)/EMA(VOL,5),EMA((HIGH+LOW+CLOSE)/3,CY1)),COLORFFFFFF;
 DRAWTEXT(TTT,CYC1,'5:'+NUMTOSTR(CYC1,2)),COLORffffff;
 as:=(o+h+l+c)/4;
 BL2: MA(C,p2),linethick1,Color00FFFF;
 BLT:=BARSTATUS=2;
 DRAWTEXT(BLT AND BL2>REF(BL2,1),BL2,'↑'+NUMTOSTR(p2,0)+':'+NUMTOSTR(BL2,2)),COLOR00CCCC;
 DRAWTEXT(BLT AND BL2<REF(BL2,1),BL2,'↓'+NUMTOSTR(p2,0)+':'+NUMTOSTR(BL2,2)),Color00CCCC;
 BQ:=IF((SYSPARAM(1) = (BARSSINCE((C > 0)) + 1)),1,0);
 BQ1:=(H<REF(L,1));BQ2:=(L>REF(H,1));
 BQ3:=REF(L,1)-H; BQ4:=L-REF(H,1);
 BQ5:=REF(L,1); BQ6:=H;
 BQ7:=REF(H,1); BQ8:=L;
 QZH:=IF(BQ1,BQ1,BQ2);
 QZH1:=IF(BQ1,BQ5,BQ7);
 QZH2:=IF(BQ1,BQ6,BQ8);
 QK:=IF(C>O,C,O);
 QK1:=IF(C>O,O,C);
 QKA:=IF(C>O,o+(c-o)*0.65,o+(c-o)*0.35);
 QKB:=IF(C>O,o+(c-o)*0.35,o+(c-o)*0.65);
 STICKLINE(BQ1,QKA,QK,5.5,0),colorEE0000;
 STICKLINE(BQ2,QKB,QK1,5,0),color20CEEE;
 DRAWTEXT(((BQ > 0) AND Bq1),H,'↓缺口 '+'\n '+NUMTOSTR(BQ3[SYSPARAM(1)],2)+' '+'\n '+NUMTOSTR(BQ5[SYSPARAM(1)],2)+'-'+NUMTOSTR(BQ6[SYSPARAM(1)],2)+' '),colorFFFFEE,pxdn10,ALIGN2;
 DRAWTEXT(((BQ > 0) AND Bq2),L,'↑缺口 '+'\n '+NUMTOSTR(BQ4[SYSPARAM(1)],2)+' '+'\n '+NUMTOSTR(BQ7[SYSPARAM(1)],2)+'-'+NUMTOSTR(BQ8[SYSPARAM(1)],2)+' '),color00FFEE,pxup20,ALIGN2;
 DRAWSL(SYSPARAM(1)=BARPOS AND QZH,QZH1,0,0,0),COLOR888888;//随光标显示缺口直线
DRAWSL(SYSPARAM(1)=BARPOS AND QZH,QZH2,0,0,0),COLOR888888;
 QKD:=BQ8[DATACOUNT]; QKE:=0;
 QK:=IF(BQ2,1,IF(BQ1,-1,0));
 for I=DATACOUNT-1 downto 2 do begin
 IF BQ8[I ]<QKD then QKD:=BQ8 [I ];
 IF BQ6[I ]>QKE then QKE:=BQ6 [I ];
 IF QK[I ]=1 and QKD<=BQ6[I-1] then QK [I ]:=0;
 IF QK[I ]=-1 and QKE>=BQ8[I-1] then QK [I ]:=0;
 end;
 DRAWTEXT(QK=1,BQ8,'未补'),COLOR999999,PXUP;
 DRAWTEXT(QK=-1,BQ6,'未补 '),COLOR999999,PXDN ;
 BLx:EMA(as,17),color00ffFF,linethick2;
 DRAWTEXT(BLT AND BLX>REF(BLX,1),BLX,'↑'+NUMTOSTR(BLX,2)),COLOR00CCCC;
 DRAWTEXT(BLT AND BLX<REF(BLX,1),BLX,'↓'+NUMTOSTR(BLX,2)),Color00CCCC;
 xgm:=CROSS(c,BLx);
 PARTLINE(BLX<REF(BLX,1),BLX),colorff0000,linethick2;
 DRAWTEXT((BQ>0) AND xgm,BLx,'上穿E17 '),pxDN6,COLORYELLOW,ALIGN1;
 PARTLINE(xgm,BLx),CROSSDOT,LINETHICK1,COLOR00FFfff;
最低:=TROUGHBARS(L,低L,1);{调整之字幅度找到低位起点}
Y_1:=SUMBARS(最低=0,1)-1; Y_2:=DATACOUNT-Y_1[DATACOUNT]; Y_3:=IF(BARPOS=Y_2,最低=0,0);
 Y_4:=IF(Y_3,1,0); 控制:=BARSLAST(Y_4)+1;
低价:=REF(L,BARSLAST(最低=0));
 DRAWLINE(最低=0 and df>0,L,ISLASTBAR,低价,0),Color999999;
 DRAWLINE(最低=0 and df>0,L*1.03,ISLASTBAR,低价*1.03,0),Color999999;
 DRAWLINE(最低=0 and df>0,L*1.05,ISLASTBAR,低价*1.05,0),Color999999;
 DRAWLINE(最低=0 and df>0,L*1.08,ISLASTBAR,低价*1.08,0),Color999999;
 DRAWLINE(最低=0 and df>=2,L*1.13,ISLASTBAR,低价*1.13,0),Color999999;
 DRAWLINE(最低=0 and df>=2,L*1.18,ISLASTBAR,低价*1.18,0),Color999999;
 DRAWLINE(最低=0 and df>=2,L*1.25,ISLASTBAR,低价*1.25,0),Color999999;
 DRAWTEXT(控制=1 and df>0,低价,NUMTOSTR(低价,2)+'[ 0%]'),ALIGN2,PXUP8,COLORWHITE;
 DRAWTEXT(控制=1 and df>0,低价*1.03,'3% ['+NUMTOSTR(低价*1.03,2)+']'),ALIGN2,PXUP8,COLORWHITE;
 DRAWTEXT(控制=1 and df>0,低价*1.05,'5% ['+NUMTOSTR(低价*1.05,2)+']'),ALIGN2,PXUP8,COLORWHITE;
 DRAWTEXT(控制=1 and df>0,低价*1.08,'8% ['+NUMTOSTR(低价*1.08,2)+']'),ALIGN2,PXUP8,COLORWHITE;
 DRAWTEXT(控制=1 and df>=2,低价*1.13,'13% ['+NUMTOSTR(低价*1.13,2)+']'),ALIGN2,PXUP8,COLORWHITE;
 DRAWTEXT(控制=1 and df>=2,低价*1.18,'18% ['+NUMTOSTR(低价*1.18,2)+']'),ALIGN2,PXUP8,COLORWHITE;
 DRAWTEXT(控制=1 and df>=2,低价*1.25,'25% ['+NUMTOSTR(低价*1.25,2)+']'),ALIGN2,PXUP8,COLORWHITE;
 {添加到参数精灵里
--------手动调节任意支撑压力--------
N=2--10 Param#1调节支撑压力线;
--------手动调节5日成本均线;--------
CY1=5 Param#2 成本均线;
均线 MA Param#3 手动调节任意均线;
--------显示上涨幅度--------
低L Param#4 调节区间低点;
DF=1--2 Param#5 显示
 




未来函数检测结果如下:
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
该公式包含未来函数:BACKSET
该公式包含未来函数:DYNAINFO
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  股票指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股票指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股票指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图