How do I get the difference of the current MA to the previous MA?

 

New to the language,

 

 Can someone help get the difference between two MAs, current MA-previous MA.

 

Any help would really be appreciated.

 

TONY 

 
  double ma_current = iMA(NULL,0,13,8,MODE_SMMA,PRICE_CLOSE,0);
  double ma_previous = iMA(NULL,0,13,8,MODE_SMMA,PRICE_CLOSE,1);
  double difference = ma_current - ma_previous;
  Print("difference=",difference);
 
codersguru:


codersguru, thank you very much! That will help alot!

 

Tony 

Reason: