以下是通达信上下波轨指标
通达信上下波轨指标
源码
SL:=(C+H+L)/3;
A1:=0.1587544209415*SL+0.1495585147376*REF(SL,1)+0.1403078088658*REF(SL,2)+0.1310057826698*REF(SL,3)+0.1216559154937*REF(SL,4)+0.1122616866816*REF(SL,5)+0.1028265755774*REF(SL,6)+0.0933540615253*REF(SL,7)+0.0838476238690*REF(SL,8)+0.0743107419527*REF(SL,9)+0.0647468951204*REF(SL,10)+0.0551595627160*REF(SL,11)+0.0455522240837*REF(SL,12)+0.0359283585673*REF(SL,13)+0.0262914455109*REF(SL,14)+0.0166449642584*REF(SL,15)+0.0069923941540*REF(SL,16)-0.0026627854584*REF(SL,17)-0.0123170952349*REF(SL,18)-0.0219670558313*REF(SL,26)-0.0316091879037*REF(SL,20)-0.0412400121081*REF(SL,21)-0.0508560491005*REF(SL,22)-0.0604538195368*REF(SL,23)-0.0700298440732*REF(SL,24)-0.0795806433655*REF(SL,25)+0.0165595028714*REF(SL,26)+0.0136938281656*REF(SL,27)+0.0110108190202*REF(SL,28)+0.0085104754350*REF(SL,29);
A2:=A1+0.0061927974100*REF(SL,30)+0.0040577849452*REF(SL,31)+0.0021054380407*REF(SL,32)+0.0003357566964*REF(SL,33)-0.0012512590876*REF(SL,34)-0.0026556093114*REF(SL,35)-0.0038772939750*REF(SL,36)-0.0049163130784*REF(SL,37)-0.0057726666214*REF(SL,38)-0.0064463546043*REF(SL,39)-0.0069373770270*REF(SL,40)-0.0072457338893*REF(SL,41)-0.0073714251915*REF(SL,42)-0.0073144509335*REF(SL,43)-0.0070748111151*REF(SL,44)-0.0066525057366*REF(SL,45)-0.0060475347978*REF(SL,46)-0.0052598982988*REF(SL,47)-0.0042895962396*REF(SL,48)-0.0031366286200*REF(SL,49)-0.0018009954403*REF(SL,50)-0.0002826967003*REF(SL,51)-0.0006088852008*REF(SL,52)-0.0008802740331*REF(SL,53)-0.0011003425414*REF(SL,54)-0.0012725700696*REF(SL,55)-0.0014004359618*REF(SL,56)-0.0014874195619*REF(SL,57)-0.0015370002140*REF(SL,58);
A:=A2-0.0015526572620*REF(SL,59)-0.0015378700500*REF(SL,60)-0.0014961179219*REF(SL,61)-0.0014308802219*REF(SL,62)-0.0013456362937*REF(SL,63)-0.0012438654816*REF(SL,64)-0.0011290471295*REF(SL,65)-0.0010046605813*REF(SL,66)-0.0008741851811*REF(SL,67)-0.0007411002729*REF(SL,68)-0.0006088852008*REF(SL,69)-0.0004810193086*REF(SL,70)-0.0003609819405*REF(SL,71)-0.0002522524403*REF(SL,72)-0.0001583101522*REF(SL,73)-0.0000826344201*REF(SL,74)-0.0000287045880*REF(SL,75);
X01:=IFF(CURRBARSCOUNT>1,XMA(SL,P),A);
B1:=0.1587544209415*X01+0.1495585147376*REF(X01,1)+0.1403078088658*REF(X01,2)+0.1310057826698*REF(X01,3)+0.1216559154937*REF(X01,4)+0.1122616866816*REF(X01,5)+0.1028265755774*REF(X01,6)+0.0933540615253*REF(X01,7)+0.0838476238690*REF(X01,8)+0.0743107419527*REF(X01,9)+0.0647468951204*REF(X01,10)+0.0551595627160*REF(X01,11)+0.0455522240837*REF(X01,12)+0.0359283585673*REF(X01,13)+0.0262914455109*REF(X01,14)+0.0166449642584*REF(X01,15)+0.0069923941540*REF(X01,16)-0.0026627854584*REF(X01,17)-0.0123170952349*REF(X01,18)-0.0219670558313*REF(X01,26)-0.0316091879037*REF(X01,20)-0.0412400121081*REF(X01,21)-0.0508560491005*REF(X01,22)-0.0604538195368*REF(X01,23)-0.0700298440732*REF(X01,24)-0.0795806433655*REF(X01,25)+0.0165595028714*REF(X01,26)+0.0136938281656*REF(X01,27)+0.0110108190202*REF(X01,28)+0.0085104754350*REF(X01,29);
B2:=B1+0.0061927974100*REF(X01,30)+0.0040577849452*REF(X01,31)+0.0021054380407*REF(X01,32)+0.0003357566964*REF(X01,33)-0.0012512590876*REF(X01,34)-0.0026556093114*REF(X01,35)-0.0038772939750*REF(X01,36)-0.0049163130784*REF(X01,37)-0.0057726666214*REF(X01,38)-0.0064463546043*REF(X01,39)-0.0069373770270*REF(X01,40)-0.0072457338893*REF(X01,41)-0.0073714251915*REF(X01,42)-0.0073144509335*REF(X01,43)-0.0070748111151*REF(X01,44)-0.0066525057366*REF(X01,45)-0.0060475347978*REF(X01,46)-0.0052598982988*REF(X01,47)-0.0042895962396*REF(X01,48)-0.0031366286200*REF(X01,49)-0.0018009954403*REF(X01,50)-0.0002826967003*REF(X01,51)-0.0006088852008*REF(X01,52)-0.0008802740331*REF(X01,53)-0.0011003425414*REF(X01,54)-0.0012725700696*REF(X01,55)-0.0014004359618*REF(X01,56)-0.0014874195619*REF(X01,57)-0.0015370002140*REF(X01,58);
B:=B2-0.0015526572620*REF(X01,59)-0.0015378700500*REF(X01,60)-0.0014961179219*REF(X01,61)-0.0014308802219*REF(X01,62)-0.0013456362937*REF(X01,63)-0.0012438654816*REF(X01,64)-0.0011290471295*REF(X01,65)-0.0010046605813*REF(X01,66)-0.0008741851811*REF(X01,67)-0.0007411002729*REF(X01,68)-0.0006088852008*REF(X01,69)-0.0004810193086*REF(X01,70)-0.0003609819405*REF(X01,71)-0.0002522524403*REF(X01,72)-0.0001583101522*REF(X01,73)-0.0000826344201*REF(X01,74)-0.0000287045880*REF(X01,75);
X02:=IFF(CURRBARSCOUNT>1,XMA(SL,P),B);
{WWW.GUHAI.COM.CN}
C1:=0.1587544209415*X02+0.1495585147376*REF(X02,1)+0.1403078088658*REF(X02,2)+0.1310057826698*REF(X02,3)+0.1216559154937*REF(X02,4)+0.1122616866816*REF(X02,5)+0.1028265755774*REF(X02,6)+0.0933540615253*REF(X02,7)+0.0838476238690*REF(X02,8)+0.0743107419527*REF(X02,9)+0.0647468951204*REF(X02,10)+0.0551595627160*REF(X02,11)+0.0455522240837*REF(X02,12)+0.0359283585673*REF(X02,13)+0.0262914455109*REF(X02,14)+0.0166449642584*REF(X02,15)+0.0069923941540*REF(X02,16)-0.0026627854584*REF(X02,17)-0.0123170952349*REF(X02,18)-0.0219670558313*REF(X02,26)-0.0316091879037*REF(X02,20)-0.0412400121081*REF(X02,21)-0.0508560491005*REF(X02,22)-0.0604538195368*REF(X02,23)-0.0700298440732*REF(X02,24)-0.0795806433655*REF(X02,25)+0.0165595028714*REF(X02,26)+0.0136938281656*REF(X02,27)+0.0110108190202*REF(X02,28)+0.0085104754350*REF(X02,29);
C2:=C1+0.0061927974100*REF(X02,30)+0.0040577849452*REF(X02,31)+0.0021054380407*REF(X02,32)+0.0003357566964*REF(X02,33)-0.0012512590876*REF(X02,34)-0.0026556093114*REF(X02,35)-0.0038772939750*REF(X02,36)-0.0049163130784*REF(X02,37)-0.0057726666214*REF(X02,38)-0.0064463546043*REF(X02,39)-0.0069373770270*REF(X02,40)-0.0072457338893*REF(X02,41)-0.0073714251915*REF(X02,42)-0.0073144509335*REF(X02,43)-0.0070748111151*REF(X02,44)-0.0066525057366*REF(X02,45)-0.0060475347978*REF(X02,46)-0.0052598982988*REF(X02,47)-0.0042895962396*REF(X02,48)-0.0031366286200*REF(X02,49)-0.0018009954403*REF(X02,50)-0.0002826967003*REF(X02,51)-0.0006088852008*REF(X02,52)-0.0008802740331*REF(X02,53)-0.0011003425414*REF(X02,54)-0.0012725700696*REF(X02,55)-0.0014004359618*REF(X02,56)-0.0014874195619*REF(X02,57)-0.0015370002140*REF(X02,58);
CC:=C2-0.0015526572620*REF(X02,59)-0.0015378700500*REF(X02,60)-0.0014961179219*REF(X02,61)-0.0014308802219*REF(X02,62)-0.0013456362937*REF(X02,63)-0.0012438654816*REF(X02,64)-0.0011290471295*REF(X02,65)-0.0010046605813*REF(X02,66)-0.0008741851811*REF(X02,67)-0.0007411002729*REF(X02,68)-0.0006088852008*REF(X02,69)-0.0004810193086*REF(X02,70)-0.0003609819405*REF(X02,71)-0.0002522524403*REF(X02,72)-0.0001583101522*REF(X02,73)-0.0000826344201*REF(X02,74)-0.0000287045880*REF(X02,75);
X03:=IFF(CURRBARSCOUNT>1,XMA(SL,P),CC);
D1:=0.1587544209415*X03+0.1495585147376*REF(X03,1)+0.1403078088658*REF(X03,2)+0.1310057826698*REF(X03,3)+0.1216559154937*REF(X03,4)+0.1122616866816*REF(X03,5)+0.1028265755774*REF(X03,6)+0.0933540615253*REF(X03,7)+0.0838476238690*REF(X03,8)+0.0743107419527*REF(X03,9)+0.0647468951204*REF(X03,10)+0.0551595627160*REF(X03,11)+0.0455522240837*REF(X03,12)+0.0359283585673*REF(X03,13)+0.0262914455109*REF(X03,14)+0.0166449642584*REF(X03,15)+0.0069923941540*REF(X03,16)-0.0026627854584*REF(X03,17)-0.0123170952349*REF(X03,18)-0.0219670558313*REF(X03,26)-0.0316091879037*REF(X03,20)-0.0412400121081*REF(X03,21)-0.0508560491005*REF(X03,22)-0.0604538195368*REF(X03,23)-0.0700298440732*REF(X03,24)-0.0795806433655*REF(X03,25)+0.0165595028714*REF(X03,26)+0.0136938281656*REF(X03,27)+0.0110108190202*REF(X03,28)+0.0085104754350*REF(X03,29);
D2:=D1+0.0061927974100*REF(X03,30)+0.0040577849452*REF(X03,31)+0.0021054380407*REF(X03,32)+0.0003357566964*REF(X03,33)-0.0012512590876*REF(X03,34)-0.0026556093114*REF(X03,35)-0.0038772939750*REF(X03,36)-0.0049163130784*REF(X03,37)-0.0057726666214*REF(X03,38)-0.0064463546043*REF(X03,39)-0.0069373770270*REF(X03,40)-0.0072457338893*REF(X03,41)-0.0073714251915*REF(X03,42)-0.0073144509335*REF(X03,43)-0.0070748111151*REF(X03,44)-0.0066525057366*REF(X03,45)-0.0060475347978*REF(X03,46)-0.0052598982988*REF(X03,47)-0.0042895962396*REF(X03,48)-0.0031366286200*REF(X03,49)-0.0018009954403*REF(X03,50)-0.0002826967003*REF(X03,51)-0.0006088852008*REF(X03,52)-0.0008802740331*REF(X03,53)-0.0011003425414*REF(X03,54)-0.0012725700696*REF(X03,55)-0.0014004359618*REF(X03,56)-0.0014874195619*REF(X03,57)-0.0015370002140*REF(X03,58);
D:=D2-0.0015526572620*REF(X03,59)-0.0015378700500*REF(X03,60)-0.0014961179219*REF(X03,61)-0.0014308802219*REF(X03,62)-0.0013456362937*REF(X03,63)-0.0012438654816*REF(X03,64)-0.0011290471295*REF(X03,65)-0.0010046605813*REF(X03,66)-0.0008741851811*REF(X03,67)-0.0007411002729*REF(X03,68)-0.0006088852008*REF(X03,69)-0.0004810193086*REF(X03,70)-0.0003609819405*REF(X03,71)-0.0002522524403*REF(X03,72)-0.0001583101522*REF(X03,73)-0.0000826344201*REF(X03,74)-0.0000287045880*REF(X03,75);
X04:=IFF(CURRBARSCOUNT>1,XMA(SL,P),D);
{WWW.GUHAI.COM.CN}
E1:=0.1587544209415*X04+0.1495585147376*REF(X04,1)+0.1403078088658*REF(X04,2)+0.1310057826698*REF(X04,3)+0.1216559154937*REF(X04,4)+0.1122616866816*REF(X04,5)+0.1028265755774*REF(X04,6)+0.0933540615253*REF(X04,7)+0.0838476238690*REF(X04,8)+0.0743107419527*REF(X04,9)+0.0647468951204*REF(X04,10)+0.0551595627160*REF(X04,11)+0.0455522240837*REF(X04,12)+0.0359283585673*REF(X04,13)+0.0262914455109*REF(X04,14)+0.0166449642584*REF(X04,15)+0.0069923941540*REF(X04,16)-0.0026627854584*REF(X04,17)-0.0123170952349*REF(X04,18)-0.0219670558313*REF(X04,26)-0.0316091879037*REF(X04,20)-0.0412400121081*REF(X04,21)-0.0508560491005*REF(X04,22)-0.0604538195368*REF(X04,23)-0.0700298440732*REF(X04,24)-0.0795806433655*REF(X04,25)+0.0165595028714*REF(X04,26)+0.0136938281656*REF(X04,27)+0.0110108190202*REF(X04,28)+0.0085104754350*REF(X04,29);
E2:=E1+0.0061927974100*REF(X04,30)+0.0040577849452*REF(X04,31)+0.0021054380407*REF(X04,32)+0.0003357566964*REF(X04,33)-0.0012512590876*REF(X04,34)-0.0026556093114*REF(X04,35)-0.0038772939750*REF(X04,36)-0.0049163130784*REF(X04,37)-0.0057726666214*REF(X04,38)-0.0064463546043*REF(X04,39)-0.0069373770270*REF(X04,40)-0.0072457338893*REF(X04,41)-0.0073714251915*REF(X04,42)-0.0073144509335*REF(X04,43)-0.0070748111151*REF(X04,44)-0.0066525057366*REF(X04,45)-0.0060475347978*REF(X04,46)-0.0052598982988*REF(X04,47)-0.0042895962396*REF(X04,48)-0.0031366286200*REF(X04,49)-0.0018009954403*REF(X04,50)-0.0002826967003*REF(X04,51)-0.0006088852008*REF(X04,52)-0.0008802740331*REF(X04,53)-0.0011003425414*REF(X04,54)-0.0012725700696*REF(X04,55)-0.0014004359618*REF(X04,56)-0.0014874195619*REF(X04,57)-0.0015370002140*REF(X04,58);
E:=E2-0.0015526572620*REF(X04,59)-0.0015378700500*REF(X04,60)-0.0014961179219*REF(X04,61)-0.0014308802219*REF(X04,62)-0.0013456362937*REF(X04,63)-0.0012438654816*REF(X04,64)-0.0011290471295*REF(X04,65)-0.0010046605813*REF(X04,66)-0.0008741851811*REF(X04,67)-0.0007411002729*REF(X04,68)-0.0006088852008*REF(X04,69)-0.0004810193086*REF(X04,70)-0.0003609819405*REF(X04,71)-0.0002522524403*REF(X04,72)-0.0001583101522*REF(X04,73)-0.0000826344201*REF(X04,74)-0.0000287045880*REF(X04,75);
Y396:E,LINETHICK2,COLORGREEN;
IF(Y396>REF(Y396,1),Y396,DRAWNULL),COLORRED,LINETHICK2;
风险区1:Y396*1.100,COLORLIBLUE;
风险区2:Y396*1.125,COLORLIBLUE;
风险区3:Y396*1.150,COLORLIBLUE;
良机区1:Y396*0.900,COLOR0000FF;
良机区2:Y396*0.875,COLOR0000FF;
良机区3:Y396*0.850,COLOR0000FF;