trying to capture values for EMA.5, EMA.10 and SMA.50 and SMA.100

 
Looking to code an Expert Advisor that trades based on EMA.5 crossing over EMA.10 and/or SMA.50 crossing over SMA.100 but I am having problems trying to capture the different EMA and SMA values in my code.  Any suggestions?
 
flwilliams87:
Looking to code an Expert Advisor that trades based on EMA.5 crossing over EMA.10 and/or SMA.50 crossing over SMA.100 but I am having problems trying to capture the different EMA and SMA values in my code.  Any suggestions?
Show your EA.
 
Alexander Voronkov:
Show your EA.

Code is below. I want to copy EMA5 and EMA10 into an array so that I can do a conidtional statement on whether EMA5 crosses above or below EMA10.


EM5_Handle=ima(Symbol(),5,0,MODE_EMA,PRICE_CLOSE;

EM10_Handle=ima(Symbol(),10,0,MODE_EMA,PRICE_CLOSE;


CopyBuffer(EMA5_Handle,MODE_EMA,0,9,EMA5_ARRAY);

CopyBuffer(EMA10_Handle,MODE_EMA,0,9,EMA10_ARRAY);


does the above look like it might work?