Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 330

 

dll calls are not allowed;'kernel32.dll'-'_lopen'

What is this?

Can you please tell me, the copier worked for a couple of seconds and this is in the log
 
Ivan Butko:

dll calls are not allowed;'kernel32.dll'-'_lopen'

What is this?

Can you please tell me, the copier worked for a couple of seconds and this is in the log

The DLL call is prohibited. You need to check the checkbox in EA settings in General tab --> Allow import of functions from DLL

 
Vitaly Muzichenko:


It works, but doesn't wait any longer than a mouse click on the chart. I need the Expert Advisor to wait for the pressing of a button which I monitor like this if(ObjectGetInteger(0, "cm STOP ALL",OBJPROP_STATE)) and determine a point on the chart where to place stops, i.e. I call the function = OnChartEvent in curly braces and call this function {OnChartEven } but how to write it correctly?

 

I transferred the function to the file ATP_funccii.mq4, connected it to the Expert Advisor #import "ATP_funccii.mq4". When compiling, the function call 'RectLabelCreate' - function not defined is not defined, what can be wrong?


 
Basicprof:

I transferred the function to the file ATP_funccii.mq4, connected it to the Expert Advisor #import "ATP_funccii.mq4". When compiling, the function call 'RectLabelCreate' - function not defined is not defined, what can be wrong?


Include it in the mqh file and connect this file as #include

 
Artyom Trishkin:

Include it in the mqh file and connect this file as #include

I don't know if it works now or not, it was possible to import-export functions from one code to another, but for this, besides #import "ATP_funccii.mq4" there must be export after the closing parenthesis

void ATP_funccii() export
 {

 }
 
Alexey Viktorov:

I don't know if it works now or not, it was possible to import-export functions from one code to another, but for this, besides #import "ATP_funccii.mq4" there must be export after the closing bracket

May be so. Honestly, I have not worked with it.

 
Artyom Trishkin:

Maybe so. Honestly - haven't worked with it.

I haven't used it either.
 
Alexey Viktorov:
I haven't used it either.

Digging in this direction?

Forum on trading, automated trading systems and trading strategies testing

Peculiarities of mql5 language, tips and tricks

Artyom Trishkin, 2017.10.06 06:36

What can replace standard OrderCalcProfit() and OrderCalcMargin() so that functions are cross-platform? It seems that it already was somewhere, but I cannot find it here - may be I am too sleepy... But an hour of searching should have woken up :)


 
Artyom Trishkin:

Have you dug in that direction?


1. I haven't.

2.

AccountInfoDouble(ACCOUNT_MARGIN_FREE) /*или AccountFreeMargin()*/ - AccountFreeMarginCheck(string  symbol, int cmd, double  volume);

For pending orders the same error as for OrderCalcMargin(), counts by current quote of margin currency to deposit currency.