Download MetaTrader 5

dll questions

To add comments, please log in or register
Ming Luo
Ming Luo  
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[])

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???

To add comments, please log in or register