Download MetaTrader 5

CopyRealVolume problem

To add comments, please log in or register
DavidHuynh
17
DavidHuynh  

I've tried to copy volume but I got this error. Please help me! 

'CopyRealVolume' - no one of the overloads can be applied to the function call

 

Thank you very much!

 

//+------------------------------------------------------------------+
//|                                                        a.mq4.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window

double a[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   int copied = CopyRealVolume(Symbol(),0,0,Bars,a);
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
Alain Verleyen
Moderator
31199
Alain Verleyen  

Forum on trading, automated trading systems and testing trading strategies


Hello,

This forum is about MT5/mql5, please post your question about MT4/mql4 on mql4.com forum.

  • They are more people who can answer there.
  • They are more people who can have similar problem there.
  • A forum is not only to get help but to share with the community, mql4/MT4 community isn't the same as mql5/MT5 community.
CopyRealVolume takes a long array as last parameter, not a double.
Documentation on MQL5: Timeseries and Indicators Access / CopyRealVolume
Documentation on MQL5: Timeseries and Indicators Access / CopyRealVolume
  • www.mql5.com
Timeseries and Indicators Access / CopyRealVolume - Documentation on MQL5
To add comments, please log in or register