[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

indicator to function



PureBytes Links

Trading Reference Links

Can this be made into a function?  Would like to call on it with settings of
2 and 5.
Would i also need a lamba function?  ...long day,   ...my head hurts.
grin

regema ind.

inputs:
 EMA_Length( 9 ),
 Lambda( 9 ) ;
variables:
 RegEMA( 0 ),
 Alpha( 2 / ( EMA_Length + 1 ) ) ;
if CurrentBar > 3 then
 RegEMA  = (RegEMA[1]*(1+2*Lambda) + Alpha * (C-RegEMA[1])
           - Lambda * RegEMA[2])/(1+lambda)
else
 RegEMA = Close ;
Plot1( RegEMA, "RegEMA") ;