Why can't I connect library in mql4 from c++? Here is my code in Visual Studio 2012 C++. File main. with cpp extension (main.csr)
#define MT4_EXPFUNC __declspec(dllexport) создал макрос чтобы не писать запись __declspec(dllexport)int __stdcall add(int a=0, int b=0)
//__declspec(dllexport)int __stdcall add(int a=0, int b=0)и так пробовал тоже
MT4_EXPFUNC int __cdecl add(int a=0, int b=0)//stdcall данная примитивная функция ничего не делает а просто возвращает значение 18
{return (18);пробовал так return 18;}
Then I created a file with main extension def (main.def) that has a list of exported functions, the code looks like this :
LIBRARY "dllmt42"
EXPORTS
add
Then I imported it into compiler
#import "dllmt42.dll"int _add(int a=0, int b=0);
#import
No problems after compilation, but when you leave the EA on the chart, I get confused
Unresolved import function call, find '_add' in 'dllmt42.dll'. Total Comander sees the function as well as the compiler itself when dragging the file
Trying to retrieve indicator data in MT5 using a function:
//************************************************************************************************/double Envelopes(string symb, ENUM_TIMEFRAMES TF_1, int period, int method, int shift, int price,double Deviation(ENUM_TIMEFRAMES TF_2, int kanal), int buff, int index)
{
double buf[1];
int handle=iEnvelopes(Symbol(), TF_1, period, method, shift, price, Deviation(TF_2, kanal), buff);
if(handle<0)
{
Print("Failed to create handle ATR, Error: ",GetLastError());
return(WRONG_VALUE);
} else
{
if(CopyBuffer(handle,0,index,1,buf)<0)
{
Print("Failed to copy data from the indicator ATR, Error: ",GetLastError());
return(WRONG_VALUE);
}
}
return(buf[0]);
}
//************************************************************************************************/
This error indicates that you're trying to modify a position/order at the price at which you've already modified it...
No, I checked it many times already, the problem was in the randomness of selecting the input parameters of MQL when testing the products, which are not always compatible - I fixed that too. But now I got a message that there is no open order
Although I have them on the same pairs and timeframes
No, I've already checked it many times. The problem was in randomness of selecting the input parameters of MQL when testing the products, which are not always compatible - I've already fixed that too. But now I got a message that there is no open order
Corrected... But there's one left for some reason.
And I can't reproduce it in the tester. I just don't have it on the same date
Why can't I connect library in mql4 from c++? Here is my code in Visual Studio 2012 C++. File main. with cpp extension (main.csr)
Then I created a file with main extension def (main.def) that has a list of exported functions, the code looks like this :
LIBRARY "dllmt42" EXPORTS addThen I imported it into compiler
No problems after compilation, but when you leave the EA on the chart, I get confused
Unresolved import function call, find '_add' in 'dllmt42.dll'. Total Comander sees the function as well as the compiler itself when dragging the file
Who can help?
Corrected... But there's one left for some reason.
And I can't reproduce it in the tester. I do not have this error on the same date
This error shows that you are trying to modify a position/order at the price at which you made the modification earlier...
Trying to retrieve indicator data in MT5 using a function:
I get an error :
Please advise how to fix code for MT5
This error indicates that you're trying to modify a position/order at the price at which you've already modified it...
No, I checked it many times already, the problem was in the randomness of selecting the input parameters of MQL when testing the products, which are not always compatible - I fixed that too. But now I got a message that there is no open order
Although I have them on the same pairs and timeframes
No, I've already checked it many times. The problem was in randomness of selecting the input parameters of MQL when testing the products, which are not always compatible - I've already fixed that too. But now I got a message that there is no open order
But I have them on the same pairs and timeframes
I don't know why my EA does not trade.
Find out why the EA does not trade.
It may not trade if the input parameters are randomly chosen so that signals simply do not occur. But you should not limit it either
What is meant by" tradingfreeze distance "? Received through
MQL4
I have error #1 again when modifying. In this EA, SL or TP levels are only modified in four blocks
1 block
2 block
3 block
4 block
I have already checked everything many times but I can't find any errors
I have error #1 again when modifying. In this EA, SL or TP levels are only modified in four blocks
This is not correct, also in other examples
If you put a stop at 1.2356 and on a new tick you put a stop at 1.2356 again, you will get error 1