VAR6:=HHV(VAR4,30);
VAR7:=IF(MA(CLOSE,58),1,0);
VAR8:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618*VAR7;
VAR9:=IF(VAR8>100,100,VAR8);
吸筹:STICKLINE(VAR9>-120,0,VAR9,6,1),COLORF00FF0;
快线:(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,COLORFF937F;
慢线:SMA(快线,M1,1),COLORRED,LINETHICK2;
空:SMA(慢线,M2,1),COLOR00FF00;
牛股:IF(BARSLAST(CROSS(慢线,空))<P AND BARSLAST(CROSS(空,慢线))<P AND CROSS(慢线,空) AND 慢线<20,90,0),STICK,COLORFF937F;
STICKLINE(牛股,0,90,6,1),LINETHICK4,STICK,COLORFF937F;
BB:=IF(BARSLAST(CROSS(慢线,快线))>=3 AND CROSS(快线,慢线) AND 慢线<30,20,0);
买:STICKLINE(BB,0,20,7,1),COLORYELLOW;
AA:=IF(BARSLAST(CROSS(快线,慢线))>=4 AND CROSS(慢线,快线) AND 快线>50,20,0);
卖:STICKLINE(AA,80,100,7,1),COLOR00FF00;
金字塔公式 金字塔模型策略源码:
VAR6:=HHV(VAR4,30);
VAR7:=IF(MA(CLOSE,58),1,0);
VAR8:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618*VAR7;
VAR9:=IF(VAR8>100,100,VAR8);
吸筹:STICKLINE(VAR9>-120,0,VAR9,6,1),COLORF00FF0;
快线:(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,COLORFF937F;
慢线:SMA(快线,M1,1),COLORRED,LINETHICK2;
空:SMA(慢线,M2,1),COLOR00FF00;
牛股:IF(BARSLAST(CROSS(慢线,空))<P AND BARSLAST(CROSS(空,慢线))<P AND CROSS(慢线,空) AND 慢线<20,90,0),STICK,COLORFF937F;
STICKLINE(牛股,0,90,6,1),LINETHICK4,STICK,COLORFF937F;
BB:=IF(BARSLAST(CROSS(慢线,快线))>=3 AND CROSS(快线,慢线) AND 慢线<30,20,0);
买:STICKLINE(BB,0,20,7,1),COLORYELLOW;
AA:=IF(BARSLAST(CROSS(快线,慢线))>=4 AND CROSS(慢线,快线) AND 快线>50,20,0);
卖:STICKLINE(AA,80,100,7,1),COLOR00FF00;
复制上述代码粘贴到到公式管理器
源码解析:
VAR6赋值:30日内VAR4的最高值
VAR7赋值:如果收盘价的58日简单移动平均,返回1,否则返回0
VAR8赋值:如果最低价<=VAR5,返回(VAR4+VAR6*2)/2,否则返回0的3日指数移动平均/618*VAR7
VAR9赋值:如果VAR8>100,返回100,否则返回VAR8
输出吸筹:当满足条件VAR9>-120时,在0和VAR9位置之间画柱状线,宽度为6,1不为0则画空心柱.,COLORF00FF0
输出快线:(收盘价-N日内最低价的最低值)/(N日内最高价的最高值-N日内最低价的最低值)*100,COLORFF937F
输出慢线:快线的M1日[1日权重]移动平均,画红色,线宽为2
输出空:慢线的M2日[1日权重]移动平均,COLOR00FF00
输出牛股:如果上次慢线上穿空距今天数<PANDBARSLAST(空上穿慢线)<PANDCROSS(慢线,空)AND慢线<20,返回90,否则返回0,STICK,COLORFF937F
当满足条件牛股时,在0和90位置之间画柱状线,宽度为6,1不为0则画空心柱.,线宽为4,STICK,COLORFF937F
BB赋值:如果上次慢线上穿快线距今天数>=3ANDCROSS(快线,慢线)AND慢线<30,返回20,否则返回0
输出买:当满足条件BB时,在0和20位置之间画柱状线,宽度为7,1不为0则画空心柱.,画黄色
AA赋值:如果上次快线上穿慢线距今天数>=4ANDCROSS(慢线,快线)AND快线>50,返回20,否则返回0
输出卖:当满足条件AA时,在80和100位置之间画柱状线,宽度为7,1不为0则画空心柱.,COLOR00FF00