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

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
Good day gentlemen programmers!!!!
I will try once again to ask my question, but I have rephrased it a bit.
In a grid EA, we need to find the ticket of the penultimate order. I think, the solution -1 from the ticket of the maximum order does not work in the strategy tester, but it may be so on the demo and real accounts, it is difficult to see why.
I have written the code of the function that determines the next to last order ticket. This logic is as follows: if we look through all open orders in the grid, we will find the maximal one following it and it will be the necessary order ticket.
However, my programming level is not high enough and there is some error in the code. The result of this function is the minimum ticket. These two functions max ticket and penultimate ticket. The function defining max ticket works without problems.
Please advise what the error is. Thank you.
This is the second picture telling you that you do not need a maximum ticket or maximum opening time, but you need to select the minimum opening price for Buy orders and the maximum opening price for Sell orders.
Alexei I have the functions that determine these prices could you explain how to reach the ticket you are looking for?
This second picture shows that you do not need a maximum ticket or maximum open time, but you need to choose a minimum open price for Buy orders and a maximum open price for Sell orders.
Alexei I have the functions that determine these prices could you explain how to reach the ticket you are looking for?
Like this.
Like this
Alexey thanks!!! But before getting into the gist of the function I wanted to clarify: is this function for selecting the ticket of the penultimate order?
Alexey thank you!!! But before getting into the gist of the function I wanted to clarify: is this function to select the ticket of the penultimate order?
No, it finds the BUY order ticket with the lowest price. From here on it's up to me or Makar to let me practice.
No, it finds the BUY order ticket with the lowest price. From here on it's up to you or Makar to practice.
For the second day I feel inadequate in your company. I've got functions to calculate min/max ticket, they work without problems as Kalashnikov's machine, I haven't asked them yet, but the second day they turned me into a rut!
Well, anyway, thanks for the heads up
Yes Alexey I feel the second day among you not quite adequate person. Functions to calculate the min/max ticket is working smoothly as Kalashnikov's machine I did not ask anyone about them, but the second day I get turned on a snag!!!
Well, anyway, thanks for the tip.
Isn't this picture
Forum on trading, automated trading systems and testing trading strategies
Any questions from newbies on MQL4 and MQL5, help and discussion of algorithms and codes
EVGENII SHELIPOV, 2021.11.07 06:43
Good day gentlemen programmers!!!!
I will try once again to ask my question, but slightly rephrased.
In a grid EA, I need to find the ticket of the penultimate order. A solution of -1 from the ticket of the maximum order does not work in the strategy tester, maybe, but it will not work on a demo or real account, so I attach a picture, it will be clear why.
I have written the code of the function that determines the next to last order ticket. This logic is as follows: if we look through all open orders in the grid, we will find the maximal one following it and it will be the necessary order ticket.
However, my programming level is not high enough and there is some error in the code. The result of this function is the minimum ticket. These two functions max ticket and penultimate ticket. The function defining max ticket works without problems.
Please advise what the error is. Thank you.
Is this picture
Alexei, can you enlarge the picture, please?
Alexei, can you enlarge the picture, please?
This isthe PREDICTED order