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

 
I remember making a system with a terminal restart and generating vbs code from an EA, but I had to do it the hard way: first make a txt file and then rename it to vbs. It didn't work otherwise.
 
Dmitri Custurov:
I know it will look like this, but the code returns an error as I wrote above. That is - it won't open. File handle returns -1 and error 5002 - invalid file name. All text files, pictures opens fine, all ex4/5 and dll does not open.

which (let alone target) ex4/5 do you want to open ? if it is captured by the terminal (loaded/locked) it may not come out.

 

Hello!

How do I save the graph ID in a global variable?

The ID is long and the global variable is double.

Direct type conversion can cause an error.

Perhaps there is a solution after all...

Thank you in advance!

MT4

 
Evgeny Potapov:

Hello!

How do I save the graph ID in a global variable?

The ID is long and the global variable is double.

Direct type conversion can cause an error.

Perhaps there is a solution after all...

Thank you in advance!

MT4

double - 64 bits, long - 64 bits.... as long as you don't do arithmetic (just save/retrieve), there shouldn't be any problems.

Just don't convert via type conversion, but bit-for-bit via union...

 
Maxim Kuznetsov:

which (let alone target) ex4/5 do you want to open ? if it is captured by the terminal (loaded/locked) it may not come out.

The file was in the Files folder

 
Dmitri Custurov:

The file was in the Files folder

and if a random file is named *.ex5, then the same reaction, i.e. it won't open ? and is the permissions correct ?

then it should be written in documentation that files with extension ex4/5 cannot be opened by FileOpen. Watch out for the file names.

 
Hello, I need to redesign an EA...Can you help?
I am enclosing an EA in which, when the given points are reached, X opens the opposite order with a given (fixed) lot. I need to remake - each next opposite order opening multiplied by given coefficient...
For example:
I manually open the first order BUY 1.3710 with lot 0.01
. When 10 points go down (i.e., to 1.3700), the advisor opens a SELL order with the same lot 0.01 (I need it to double, i.e., open a SELL order with 0.02 lot)
- then if the price goes upwards, at 1.3710 it opens again a BUY order with 0.01 lot (I need it to double, i.e., open a BUY order with 0.04 lot).
If it is possible, I will ask to remake it, if not, please inform me about it.
Please send me the attachment.
Thank you in advance
***
Files:
MB22.mq4  8 kb
 
64398709 Мирослав:
Hello, I need to modify an EA...Can you help me?
I am adding an EA in which the opposite order with a given (fixed) lot. I need to remake - each next opposite order opening multiplied by given coefficient...
For example:
I manually open the first order BUY 1.3710 with lot 0.01
. When 10 points go down (i.e., to 1.3700), the advisor opens a SELL order with the same lot 0.01 (I need it to double, i.e., open a SELL order with 0.02 lot)
- then if the price goes upwards, at 1.3710 it opens again a BUY order with 0.01 lot (I need it to double, i.e., open a BUY order with 0.04 lot).
If it is possible, I will ask to remake it, if not, please inform me about it.
Please send me the attachment.
Thank you in advance
***

why drive a zaporozhets (mt4) when you can drive a ziguli (mt5) ????????????????????????????????????????

 
Greetings. Could you please tell me if it is possible to write code in mt4 and in mt5 without {} brackets around operators, when there are several, as it is done in pyton?
 
Andrey Sokolov:
Greetings. Could you please tell me if it is possible to write code in mt4 and in mt5 without {} brackets around operators when there is more than one, as it is done in pyton?

NO. This is the syntax of the language.

Reason: