同花顺红娘子顶与底公式
源码
CS:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;
红先锋:(EMA(CS,3)-50)*2;
STICKLINE(红先锋<REF(红先锋,1)AND 红先锋>0,0,红先锋,4,0),COLOR00AAFF;
STICKLINE(红先锋<REF(红先锋,1)AND 红先锋>0,0,红先锋,4.4,0),COLOR00CCFF;
STICKLINE(红先锋>=REF(红先锋,1)AND 红先锋>0,0,红先锋,4,0),COLOR0000AA;
STICKLINE(红先锋>=REF(红先锋,1)AND 红先锋>0,0,红先锋,4.4,0),COLOr0022CC;
STICKLINE(红先锋>REF(红先锋,1)AND 红先锋<0,0,红先锋,4,0),COLORAA00BB;
STICKLINE(红先锋>REF(红先锋,1)AND 红先锋<0,0,红先锋,4.4,0),COLORCC22BB;
STICKLINE(红先锋<=REF(红先锋,1)AND 红先锋<0,0,红先锋,4,0),COLORFF7700;
STICKLINE(红先锋<=REF(红先锋,1)AND 红先锋<0,0,红先锋,4.4,0),COLORFFAA22;
VAR18:=(HIGH+LOW+CLOSE)/3;
VAR19:=(VAR18-MA(VAR18,14))/(0.015*AVEDEV(VAR18,14));
VAR1A:=(VAR18-MA(VAR18,70))/(0.015*AVEDEV(VAR18,70));
VAR1B:=IF(VAR19>=150 AND VAR19<200 AND VAR1A>=150 AND VAR1A<200,-10,0);
VAR1C:=IF(VAR19<=-150 AND VAR19>-200 AND VAR1A<=-150 AND VAR1A>-200,10,0);
VAR1D:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;
VAR1E:=100-ABS(VAR1D);
顶:IF(BARSCOUNT(CLOSE)<70,80,IF(VAR1A>=200 AND VAR19>=150,-15,VAR1B)+80),LINETHICK2,colorgreen;
底:IF(BARSCOUNT(CLOSE)<70,-80,IF(VAR1A<=-200 AND VAR19<=-150,15,VAR1C)-80),colorred,LINETHICK2;