以下是一些多空趋势线主图指标的公式源码,适用于不同的交易软件和平台。这些公式可以帮助你在图表上直观地看到市场的多空趋势,从而辅助你的交易决策。
通达信多空线主图指标公式
plaintextMID:=(3*CLOSE+LOW+OPEN+HIGH)/6;
DKX:=(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+
16*REF(MID,4)+15*REF(MID,5)+14*REF(MID,6)+
13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+
10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+
7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+
4*REF(MID,16)+3*REF(MID,17)+2*REF(MID,18)+REF(MID,20))/210;
MADKX:MA(DKX,10),DOTLINE;
IF((MADKX>=REF(MADKX,1)),MADKX,DRAWNULL),LINETHICK2,COLORMAGENTA;
IF((MADKX<=REF(MADKX,1)),MADKX,DRAWNULL),LINETHICK2,COLORGREEN;
这个公式计算了一条多空线(DKX),并绘制了一条10周期的移动平均线(MADKX)。当MADKX上升时,绘制紫色线;当MADKX下降时,绘制绿色线3。
东方财富期货主图多空指标公式
plaintextDKX:100-90*(HHV(HIGH,20)-(2*CLOSE+LOW)/3)/(HHV(HIGH,20)-LLV(LOW,20));
X:100-MA(100*(HHV(HIGH,6)-CLOSE)/(HHV(HIGH,6)-LLV(LOW,6)),28);
PARTLINE(DKX,DKX>X,RGB(255,0,0),DKX);
分界线:50;
这个公式基于相对强弱指数(RSI)和移动平均线(MA)的概念,计算了两条线DKX和X,并在DKX大于X时绘制红色线4。
文华财经《多空回调反弹》波段趋势主图指标公式
plaintextAMAP:=(C*3+O+H+L)/6;
AMA0:=AMA(AMAP,1/3);
AMA1:=AMA(AMA0,1/9);
AMA2:=AMA(AMA0,1/21);
AMA3:=AMA(AMA0,1/60);
DRAWBAND(AMAP,RGB(60,30,30),AMA3,RGB(20,40,40));
DRAWBAND(AMAP,RGB(90,20,20),AMA2,RGB(15,60,60));
NOTEXTA3:AMA3,COLOR3C3C4C;
NOTEXTA3K:IF(AMA3>AMAP,AMA3,DRAWNULL),COLOR3C3C2C;
NOTEXTA2:AMA2,COLOR4C4C8C;
NOTEXTA2K:IF(AMA2>AMAP,AMA2,DRAWNULL),COLOR6C6C2C;
NOTEXTA1:AMA1,COLOR4C4CFC;
NOTEXTA1K:IF(AMA1>AMAP,AMA1,DRAWNULL),COLORBCBC2C;
NOTEXTA0:AMA0,COLORC8C8C8;
这个公式计算了多个周期的AMA(自适应移动平均线),并绘制了不同颜色的带状区域,以显示市场的多空状态5。
多空趋势线指标公式分享
plaintextVarTIME:=IF(YEAR>=2050 AND MONTH>=11 AND DAY>=07,0,1);
VarDTIME:=IF(YEAR=2050 AND MONTH=11 AND DAY=06,1,0);
DRAWTEXT(VarDTIME,115,''),COLOR008000;
DRAWTEXT(VarDTIME,100,''),COLOR008000;
DRAWTEXT(VarDTIME,85,''),COLOR008000;
DRAWTEXT(VarDTIME,70,''),COLOR008000;
DRAWTEXT(VarDTIME,45,''),COLOR008000;
qw1:=(HIGH+LOW+CLOSE*2)/4*VarTIME;
qw3:=EMA(qw1,10)*VarTIME;
qw4:=STD(qw1,10)*VarTIME;
qw5:=(qw1-qw3)*100/qw4*VarTIME;
qw6:=EMA(qw5,5)*VarTIME;
rk7:=EMA(qw6,10)*VarTIME;
涨:EMA(qw6,10)+100/2-5,linethick1,colorred;
跌:EMA(涨,4),linethick1,colorFFFF34;
多线:IF(cross(涨,跌) and 跌<-10,30,0),linethick1,COLORFF00FF;
空线:IF(cross(跌,80),70,100),color0099ff,linethick1;
买1:ema(跌,4)*VarTIME,colorwhite;
买2:ema(买1,4)*VarTIME,colorgreen;
买m3:=ema(买2,4)*VarTIME,coloryellow;
买m4:=ema(买m3,4)*VarTIME,colorcc9900;
-10,pointdot,color888888,linethick2;
80,pointdot,color888888,linethick2;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),0,0 ),colorwhite;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),8,0 ),COLOR008800;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),7,0 ),COLOR009900;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),6,0 ),COLOR00AA00;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),5,0 ),COLOR00BB00;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),4,0 ),COLOR00CC00;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),3,0 ),COLOR00DD00;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),2,0 ),COLOR00EE00;
STICKLINE(涨<REF(涨,1)*VarTIME,涨,MA(涨,3),1,0 ),COLOR00FF00;
STICKLINE(涨> REF(涨,1),涨,EMA(涨,3),0,0) ,COLOR00BBFF;
这个公式计算了涨跌趋势线,并在图表上绘制了不同颜色的线条,以显示市场的多空状态6。
这些公式只是示例,你可以根据自己的需求和交易策略进行修改和优化。在使用这些公式之前,请确保你已经了解了它们的含义和工作原理,并在模拟账户上进行充分的测试。