Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1010
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
When opening an order, write the number of the rule/variable to it in the comment.
Then when you do a history check, you pull that number, add 1 to it and get a new rule number
Thank you! That's a good way. I'll try
Experiment with this code, maybe this is what you need
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.7 ---> 0.7
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.6 ---> 0.7
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.5 ---> 0.6
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.4 ---> 0.5
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.3 ---> 0.4
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.2 ---> 0.3
2019.11.28 22:31:26.409 tst EURUSD,H1: 0.1 ---> 0.2
In my function GetNextLot() you feed the volume of the last closed order, and it will return the next value of the Lot_XX setting
the only limitation in this code is that you have to configure lots in ascending order - I think the code is simple and straightforward, you can modify it to suit your needs
Thanks!!!
Thank you!!!
please
If your lot calculation is arbitrary, you could try replacing if with switch-case in my example
What is the best way to write the algorithm?
Task:
One Expert Advisor runs on different charts.
I need to have a separate file with minute by minute information about account, balance, equity, etc.
Now it turns out that all Expert Advisors write all information in one file. As a result, we have a lot of unnecessary entries.
What could be the ingenious solution for only one bot to make records in the file? (And if for example it was deleted, the records started to make another bot, etc.)
I want to open 2 terminals MT4 and connect to one EA from them, ie one program will be installed in one terminal and the second will also be able to find the EA, it is very hard to compile a program and every time I have to throw a file there and there. Is it possible to do this?
You can't do that.
Look for a Windows program that synchronises data in folders. And set it up so that the EA is automatically copied to the new terminal
What is the best way to write the algorithm?
Task:
One Expert Advisor runs on different charts.
I need to have a separate file with minute by minute information about account, balance, equity, etc.
Now it turns out that all Expert Advisors write all information in one file. As a result, we have a lot of unnecessary entries.
What is the possible original solution, so that only one bot writes to the file (And, for example, if it was deleted, the other bot starts making records, etc.).
You can try to organize communication through GV.
For example: Started the first one, it doesn't find GV and creates it with a certain name. The chart ID can be used as the value. You start the next Expert Advisor, GV is there, it does not write. You delete the first one, it checks the value and if the value is equal to the chart ID, it deletes the GV. The next one sees that the GV is absent and creates it with its own value.
Thus GV can be deleted only by the one who created it or by the one who is in charge, literally. Deletes it by hand.
Hello, everyone. I have a silly question, I just don't want to experiment a bit. I have an indicator, I don't need to output anything from it, but my Expert Advisor has to take data from it. What is the right way to initialize arrays?
INDICATOR_DATA or INDICATOR_CALCULATIONS?
Well, in general, I want to know, if I can get data from the buffer number in the iCustom function - using the buffer defined as SetIndexBuffer(N, BufferName, INDICATOR_CALCULATIONS);
Hello, everyone. I have a silly question, I just don't want to experiment a bit. I have an indicator, I don't need to output anything from it, but my Expert Advisor has to take data from it. What is the right way to initialize arrays?
INDICATOR_DATA or INDICATOR_CALCULATIONS?
Well, in general, I want to know, if I can get data from the buffer number in the iCustom function - using the buffer defined as SetIndexBuffer(N, BufferName, INDICATOR_CALCULATIONS);
Take the standard MA, change the buffer data type, compile and check in the terminal data window (Ctrl+D)
ChartID() is written to the terminal's global variables with an error. what is this nonsense?
Try this code: