Looks simple, doesn't work.

 

I have these two sequential lines of code and they output 0. Don't know if it's related to times I've needed to add Print commands to change values (values were wrong when the Print's were removed)

 double ma200 = iMA(NULL, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 1);

Print(ma200); 

 

Thanks for the help. 

 
if(iBars(NULL,0)< 200 || IsTradeAllowed()==false) return;
double ma200 = iMA(NULL, 0, 200, 0, MODE_SMA, PRICE_CLOSE, 1);

Print(ma200); 
Reason: