通达信常胜将军主图指标公式

P:=8;
XS1:=0;
说明:=1;
趋势:=zig(3,P);
↑:=TROUGHBARS(3,P,1),NODRAW;
↓:=PEAKBARS(3,P,1),NODRAW;
低:=IF(↑=0,C,IF(↓<↑,TROUGH(3,P,1),REF(TROUGH(3,P,1),1))),NODRAW;
高:=IF(↓=0,C,IF(↑<↓,PEAK(3,P,1),REF(PEAK(3,P,1),1))),NODRAW;
涨%:=IF(↑<↓,(C/低-1)*100,REF((C/低-1)*100,↓)),COLORRED,NODRAW;
跌%:=IF(↓<↑,(C/高-1)*100,REF((C/高-1)*100,↑)),COLORGREEN,NODRAW;
上:IF(趋势>REF(趋势,1),趋势,DRAWNULL),COLORRED,LINETHICK1;
下:IF(趋势<REF(趋势,1),趋势,DRAWNULL),COLORGREEN,LINETHICK1;
买入条件:=TFILTER(↑=0,↓=0,1);
卖出条件:=TFILTER(↓=0,↑=0,0);
买入价:=IF(买入条件,C,DRAWNULL);
卖出价:=IF(卖出条件,C,DRAWNULL);
DRAWICON(买入条件,L*0.98,1);
DRAWICON(卖出条件,H*1.02,2);
DRAWNUMBER(买入条件,L*0.96,买入价),COLORRED;
DRAWNUMBER(卖出条件,H*1.04,卖出价),COLORGREEN;
DRAWNUMBER(卖出条件,H*1.06,(C/REF(C,BArslAST(买入条件))-1)*100),COLORYELLOW;
成交收益:=IF(卖出条件,(C/REF(C,BARSLAST(买入条件))-1)*100*0.994,DRAWNULL);
年交易收益:=SUM(成交收益,250),NODRAW;
年成交数:=IF(ISLASTBAR,SUM(卖出条件,250),DRAWNULL),NODRAW;
平均每次收益:=年交易收益/年成交数,NODRAW;
DRAWTEXT_FIX(XS1=0,0.00,0.00,0,STRCAT('年交易次数: ',CON2STR(年成交数,0))),COLORLIRED;
DRAWTEXT_FIX(XS1=0,0.00,0.05,0,STRCAT('年交易收益: ',CON2STR(年交易收益,2))),COLORLIRED;
DRAWTEXT_FIX(XS1=0,0.00,0.10,0,STRCAT('平均每次收益: ',CON2STR(平均每次收益,2))),COLORLIRED;
DRAWTEXT_FIX(说明=1,0.00,0.15,0,'红箭头是买入信号,红数字是买入参考价'),COLORRED;
DRAWTEXT_FIX(说明=1,0.00,0.20,0,'绿箭头是卖出信号,绿数字是卖出参考价'),COLORGREEN;
DRAWTEXT_FIX(说明=1,0.00,0.25,0,'黄色数字是盈亏百分比'),COLORYELLOW;
LL:=LLV(L,250);
HH:=HHV(H,250);
A:(CONST(C)-CONST(LL))/CONST(HH)*100,NODRAW;
STICKLINE(CURRBARSCOUNT=120,LL,HH,3,-1),COLORYELLOW;
STICKLINE(CURRBARSCOUNT=120,LL,CONST(C),2,0),COLORMAGENTA;
AA:= STRCAT(STRCAT('涨幅比:',VAR2STR(A,2)),'﹪');
DRAWTEXT(CURRBARSCOUNT=145,CONST(C),AA)COLORYELLOW;




未来函数检测结果如下:
该公式包含未来函数:PEAK
该公式包含未来函数:PEAKBARS
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  股票指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股票指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股票指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图