编写要求:
www.gszx.com.cn网解答:
网友求助:
请帮忙根据下列源码写个选股公式,谢谢!我开始发错地方,不晓得会不会被版主骂哦!
N:=19;
VAR1:=HHV(HIGH,N);
VAR2:=LLV(LOW,N);
阻力线:EMA((CLOSE-VAR2)/(VAR1-VAR2),21)-0.5,COLORF0F000,LINETHICK2;
操作线:EMA((CLOSE-VAR2)/(VAR1-VAR2),5)-0.5,colorred,LINETHICK2;
DRAWTEXT(CROSS(操作线,阻力线) AND 阻力线<0.1,阻力线,'突破'),coloryellow;
DRAWTEXT(CROSS(阻力线,操作线) AND 阻力线>0.25,阻力线,'破位'),colorgreen;
红绿棒:(操作线-阻力线),COLORSTICK;
解答如下:
N:=19;
VAR1:=HHV(HIGH,N);
VAR2:=LLV(LOW,N);
阻力线:=EMA((CLOSE-VAR2)/(VAR1-VAR2),21)-0.5;
操作线:=EMA((CLOSE-VAR2)/(VAR1-VAR2),5)-0.5;
突破:CROSS(操作线,阻力线) AND 阻力线<0.1;