The Magic Of EMA 20 |
//www.aflcode.com Plot ( C , "" , 1 , 64 ) ; p = Param ( "p" , 10 , 5 , 50 , 5 ) ; B = Cum ( 1 ) ; LB = LastValue ( B ) ; x = EMA ( C , 2 * p ) ; Plot ( x , "EMA(" + WriteVal ( 2 * p , 1.0 ) + ")" , colorRed , 1 ) ; n = 250 ; j0 = 0 ; Y0 = 0 ; PlotShapes ( shapeCircle * ( B == LB - N ) , colorBlue ) ; d0 = LastValue ( Sum ( x , n ) ) ; for ( j = p ; j < 10 * p ; j = j + 1 ) { y = DEMA ( C , j ) ; d = LastValue ( Sum ( abs ( y - x ) , n ) ) ; if ( d < d0 ) { d0 = d ; j0 = j ; Y0 = Y ; } } Plot ( Y0 , "DEMA(" + WriteVal ( J0 , 1.0 ) + ")" , colorWhite , 8 ) ;
Sign up here with your email
ConversionConversion EmoticonEmoticon