文華的MA和EMA分別對應MC中的average和xaverage
?
文華中的sma是擴展指數加權移動平均函數,代碼如下:
?
//sma
inputs:?
PriceValue( numericseries ),?
Len( numericsimple ) ,?
waite(numericsimple);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
variables:?
var0( waite/ ( Len) ) ;
if CurrentBar = 1 then
sma = PriceValue
else
sma = sma[1] + var0 * ( PriceValue - sma[1] ) ;
?
文華的MA和EMA分別對應MC中的average和xaverage
?
文華中的sma是擴展指數加權移動平均函數,代碼如下:
?
//sma
inputs:?
PriceValue( numericseries ),?
Len( numericsimple ) ,?
waite(numericsimple);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
variables:?
var0( waite/ ( Len) ) ;
if CurrentBar = 1 then
sma = PriceValue
else
sma = sma[1] + var0 * ( PriceValue - sma[1] ) ;