优化“观望操作区”指标,去除未来函数
2020/4/20 18:49:58
公式编写说明:
BIAS1:=MA((CLOSE-MA(CLOSE,13))/MA(CLOSE,13),3)*100,COLORWHITE;BIAS3:=MA((CLOSE-MA(CLOSE,27))/MA(CLOSE,27),3)*100,COLORFF00FF,LINETHICK2;操作区:IF(BIAS3<0,BIAS3,0),COLORRED,LINETHICK2;观望区:IF(BIAS3>0,BIAS3,0),COLORGREEN,LINETHICK2;VAR1:=IF(DATE>=1990601,0,1);VAR2:=TROUGHBARS(3,15,1)<10;VAR3:=PEAKBARS(3,15,1)<10;VAR4:=IF(VAR2=1,50,0);VAR5:=IF(VAR3=1,50,0);TJ1:=观望区<REF(观望区,1) OR 观望区-REF(观望区,1)<REF(观望区,1)-REF(观望区,2);TJ2:=操作区>REF(操作区,1);顶: IF(TJ1 AND VAR5=50,15,0),STICK,LINETHICK1,COLORGREEN;底: IF(TJ2 AND VAR4=50,10,0),STICK,LINETHICK1,COLORRED;DRAWICON(TJ1 AND VAR5=50,-2,2);DRAWICON(TJ2 AND VAR4=50,11,1);这个公式中含未来函数,造成指标漂移,现请老师优化。谢谢5.31晚经同学提出,我提出我要的优化目标就是:以上的指标因为有未来函数,造成提示漂移,具体表现为出了提示(即是出了红色的上箭头)后股价上升,提示不变,但如果出提示后股价下跌,提示就会消失。如果按提示买入的话,会造成损失。对这一个我自己很无助,因自己不会更改。所以请各高手优化,出提示后,不会因股价变化而消失。谢谢
公式源码回答:
BIAS1:=MA((CLOSE-MA(CLOSE,13))/MA(CLOSE,13),3)*100,COLORWHITE;
BIAS3:=MA((CLOSE-MA(CLOSE,27))/MA(CLOSE,27),3)*100,COLORFF00FF,LINETHICK2;
操作区:IF(BIAS3<0,BIAS3,0),COLORRED,LINETHICK2;
观望区:IF(BIAS3>0,BIAS3,0),COLORGREEN,LINETHICK2;
TJ1:=观望区<REF(观望区,1) OR 观望区-REF(观望区,1)<REF(观望区,1)-REF(观望区,2);
TJ2:=操作区>REF(操作区,1);
顶: IF(TJ1,15,0),STICK,LINETHICK1,COLORGREEN;
底: IF(TJ2 ,10,0),STICK,LINETHICK1,COLORRED;
DRAWICON(TJ1 AND 观望区>10 ,-2,2);
DRAWICON(TJ2 AND 操作区<-5 ,11,1);
投股 票网 www.tou 18.cn
股市公式下载推荐