iMA function handle returns int ?

 

The moving average function returns an integer value, while the moving average value of each bar is a decimal amount. How can this be explained?

 
Behzad Hajipoor: The moving average function returns an integer value, while the moving average value of each bar is a decimal amount. How can this be explained?

You should read the documentation properly. In MQL5 the iMA function returns a handle (not buffer data). With that handle you then retrieve the data with CopyBuffer.

Documentation on MQL5: Technical Indicators / iMA
Documentation on MQL5: Technical Indicators / iMA
  • www.mql5.com
iMA - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Your topic has been moved to the section: Technical Indicators — In the future, please consider which section is most appropriate for your query.
Reason: