Try this..
Put
as a global variable.
In the start function :
Code:
double ma1=NormalizeDouble(first_ma,Digits);
double ma2=NormalizeDouble(second_ma,Digits);
if(ma1=ma2)
{
ma_cross=ma1;
}
int spread=MarketInfo(Symbol(), MODE_SPREAD);
SLbuy=ma1+spread-SL*Point;
SLsell=ma1+SL*Point;
Hope this helps