Hi all:
I am quite confused about writing a indicator using C++ dll.
1. It seems that the DLL import must have a parameter, MT4 doesn't accept empty paramter function calls?
2. when I try to pass all the parameters in OnCalculate(...) to the dll function, it never works. Eventually, I split all the parameters into 3 functions and make it work.
Is there a parameter number limitation in MT4 call dll???
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[])
3. It there any better way to pass the data from MT4 to the DLL? Now it seems that I have to synchronize all the data and indicator every tick and it is very slow and inefficient.
Finally, is there any specification for MT4 calling DLL please???
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I am quite confused about writing a indicator using C++ dll.
1. It seems that the DLL import must have a parameter, MT4 doesn't accept empty paramter function calls?
2. when I try to pass all the parameters in OnCalculate(...) to the dll function, it never works. Eventually, I split all the parameters into 3 functions and make it work. Is there a parameter number limitation in MT4 call dll???
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[])
c++ dll............
YYH_SWING_API void SyncTime(int totalBars, int prev_Calculated, LONGLONG* time);
YYH_SWING_API void SyncPrice(double* open, double* high, double* low, double* close);
YYH_SWING_API void SyncVolume(LONGLONG* tickVolume, LONGLONG* volume, int* spread);
3. It there any better way to pass the data from MT4 to the DLL? Now it seems that I have to synchronize all the data and indicator every tick and it is very slow and inefficient.
Finally, is there any specification for MT4 calling DLL please???
Thanks