根據(jù)價格運動效率自適應(yīng)調(diào)節(jié)加權(quán)系數(shù), 比固定周期的均線更適合于趨勢跟蹤.
input:n1(8); n:=if(barpos<=n1,barpos-1,n1); direction:=c-ref(c,n); volatility:=sum(abs(c-ref(c,1)),n); ER:=direction/volatility; smooth:=if(barpos=1,1,ER*0.6022+0.0645); cc:=smooth*smooth; ama:dma(c,cc); 發(fā)現(xiàn)設(shè)置2條考夫曼自適應(yīng)均線時,改變其中一條均線的參數(shù)時,另外的一條均線也會跟著改變的(這條的參數(shù)沒有變動過)
不知是怎樣回事,會影響其它均線的值? input:n1(8); n:=if(barpos<=n1,barpos-1,n1); direction:=c-ref(c,n); volatility:=sum(abs(c-ref(c,1)),n); ER:=direction/volatility; smooth:=if(barpos=1,1,ER*0.6022+0.0645); cc:=smooth*smooth; ama:dma(c,cc),LINETHICK0; PARTLINE(ama>=ref(ama,1),ama),COLORRED,LINETHICK2; PARTLINE(ama<ref(ama,1),ama),COLORWHITE,LINETHICK2; input:n2(30);{改變其值時,上面的AMA均線值也會變} nn:=if(barpos<=n2,barpos-1,n2); direction1:=c-ref(c,nn); volatility1:=sum(abs(c-ref(c,1)),n); ER1:=direction1/volatility1; smooth1:=if(barpos=1,1,ER1*0.6022+0.0645); cc1:=smooth1*smooth1; ama1:dma(c,cc1),LINETHICK0; PARTLINE(ama1>=ref(ama1,1),ama1),COLORMAGENTA,LINETHICK2; PARTLINE(ama1<ref(ama1,1),ama1),COLORBLUE,LINETHICK2; |
|
來自: yzy666 > 《股票技術(shù)》