Hi here is a my ema indicator. 

when I plot it I read an error message. If I scroll until the first bar 
initialized I see the indicator.
Obviously I use my ema for exemple, I don't need it :)


periodo = Param( "periodo", 200);

sma = MA(Close, periodo);

Coeff = 2/(periodo +1);

SetBarsRequired( sbrAll ) ;
 
 

for( i = 0 ; i <= periodo; i++ ) 
        {
        MyEma[i] = sma[i];
        }


for( i = periodo+1 ; i < BarCount; i++ ) 
        {
        MyEma[i] = MyEma[i-1]   + Coeff * (Close[i] - MyEma[i-1] );
        }

Plot( MyEma, _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), 
ParamStyle("Style") ); 

Reply via email to