|
|||||
权证操作--飞狐公式 |
|||||
|
|||||
|
|||||
INPUT: P1(2.7,2,3.2),P2(3.13,3,3.5),P3(3.43,3,3.8),p4(3.71,3.5,3.9),n(21,3,100),n1(3,3,100),zz(1,1,2); //zz是多空显示开关。 m1:=ma(c,5); m2:ma(c,20),COLORGREEN; 均线变异:if(m1>m2,m2,m1),,Color0000FF; partline(均线变异>ref(均线变异,1) and 均线变异=m2,均线变异),linethick2,COLORred; var1:=(hhv(high,n)-close)/(hhv(high,n)-llv(low,n))*100; var3:=(close-llv(low,n))/(hhv(high,n)-llv(low,n))*100; var6:=var3-var1; z:=ma(var6,n1); stickline(z>=0 {and zz=2},O,C,6,0),colorred; stickline(z>=0 {and zz=2},H,max(O,C),0,1),colorred; stickline(z>=0 {and zz=2},min(O,C),L,0,1),COLORred; stickline(z<0 {and zz=1},O,C,6,1),COLORCYAN; stickline(z<0 {and zz=1},h,max(O,c),0,1),COLORCYAN; stickline(z<0 {and zz=1},min(O,C),l,0,1),COLORCYAN; stickline(z>=0 and m2>c,O,C,6,0),COLORBLUE; stickline(z>=0 and m2>c,H,max(O,C),0,1),COLORBLUE; stickline(z>=0 and m2>c,min(O,C),L,0,1),COLORBLUE; stickline(z<0 and m2<c,O,C,6,1),COLORYELLOW; stickline(z<0 and m2<c,h,max(O,c),0,1),COLORYELLOW; stickline(z<0 and m2<c,min(O,C),l,0,1),COLORYELLOW; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(z,0),1,0),l,'平空开多!'),COLORRED; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(0,z),1,0),h,'平多开空!'),COLORgreen; Var2:=LLV(LOW,10); Var3:=HHV(HIGH,25); 警戒线:= p1 ; 减仓线:= p2 ; 卖出线:= p3 ; 空头线:=p4; 动力线:= EMA((CLOSE-Var2)/(Var3-Var2)*4,4); DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(动力线,警戒线),1,0),c,'预警 '),ALIGN4,colorwhite; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(动力线,减仓线),1,0),c,'减磅 '),ALIGN5,COLORYELLOW; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(动力线,卖出线),1,0),c,'出局?'),ALIGN4,COLORGREEN ; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(动力线,空头线),1,0),c,'与虎谋皮 '),ALIGN3,COLORRED; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(警戒线,动力线),1,0),c,'预警确认 '),ALIGN3,COLORRED; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(减仓线,动力线),1,0),c,'减磅确认 '),ALIGN3,COLORRED; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(卖出线,动力线),1,0),c,'出局确认'),ALIGN3,COLORRED ; DRAWTEXT(IF(RANGE(BARPOS,SYSPARAM(1)-2,SYSPARAM(1)+1) AND CROSS(空头线,动力线),1,0),c,'虎皮到手'),ALIGN4,COLORRED ; {DRAWICON(CROSS(动力线,警戒线),h,1); DRAWICON(CROSS(动力线,减仓线),h,3);} DRAWICON(CROSS(动力线,卖出线),h,2); WW:=(简单移动平均(收盘价,4)+简单移动平均(收盘价,8)+简单移动平均(收盘价,16)+简单移动平均(收盘价,32))/4; 画图标(交叉函数(收盘价,WW),最低价-0.02,4); 画图标(交叉函数(WW,收盘价),最高价+0.06,5); 显示文字(交叉函数(收盘价,WW),最低价-0.02,' 开多'); 显示文字(交叉函数(WW,收盘价),最高价+0.06,' 多平'); |
|
相关文章:
中线断股 |