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

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
Read your comment: it turns out that if one of the last three orders closes with a profit, the trade will stop!
Thanks for the tip
OPEN THE NEW ORDER I gave just for the sake of example. I am not trading yet.
I just don't understand how to code this condition .
If 3 - 4 - 5 ..... last orders have closed at STOP
I HAVE NO IDEA WHAT TO DO.
The differences are minimal. One of the variables is boolean.
The output will say true or false
Ugh, I can't figure out how to add variables - i.e. let's say I have 4 boolean variables and need to go through them?
I understand the essence of the case - should be a remainder less or more than zero after division - but I can not figure out how to achieve this :(
Thanks for the tip
OPEN THE NEW ORDER I gave just for the sake of example. I am not trading yet.
I just don't understand how to code this condition .
If 3 - 4 - 5 ..... last orders have closed at STOP
I JUST NEED TO TAKE SOME ACTION.
and only then open another order
The script attached - I checked it, it works, the result is attached
That's all history
And this is right click on history and chose period till May 3
Attached is the script - tested it, it works, the result is attached
That's the whole story.
And this is right-clicking on the history and selecting the period up to May 3
I'm sorry to bother you, I will answer my question again.
I think it's time to look at the chart, I'm not a big expert on mql4.
I may have asked a question in the wrong branch.
Attached is the script - tested it, it works, the result is attached
That's the whole story.
And this is right-clicking on the history and selecting the period up to May 3
Artem! In the lower right corner of the terminal
is the indicator for exchanges with the server - kilobytes received and sent. The indicator showed 2318. Right clicked on the history and selected Today (and today is Sunday). The history was emptied. The script displays that there are no orders in the history. I right clicked on the history and selected All History. The indicator came to life with 518 kilobytes added to it. So when you set the filter to a LARGE period the orders are downloaded from the server. If you set a smaller period, they are deleted. Therefore, you'd better set Last Week, Last 3 Days or Today to speed up your work (less orders to be processed). This can be easily checked with the help of script which has Alert(OrdersHistoryTotal());
About sorting. If you click on the column headers in the history, you can sort the history visually by descending or ascending of any column. However orders are always selected using the OrderSelect(Number, SELECT_BY_POS, MODE_HISTORY) function, starting from the beginning of the SELECTED interval of the history. And in the history, the orders are ordered by the time they were sent to the server, which is the most natural. If the number = 0, then this is the oldest order of the SELECTED interval of history. If OrdersHistoryTotal()-1, it's the most recent order of the chosen interval of history. I've checked this many times. And it's unlikely it will ever be changed.
Artem! In the bottom right corner of the terminal is an indicator of exchange with the server - the received and sent kilobytes. On the indicator was 2318. Right clicked on history and selected Today (and today is Sunday). The history is empty. The script displays that there are no orders in the history. I right clicked on the history and selected All History. The indicator came to life with 518 kilobytes added to it. So when you set the filter to a LARGE period the orders are downloaded from the server. If you set a smaller period, they are deleted. Therefore, you'd better set Last Week, Last 3 Days or Today to speed up your work (less orders to be processed). This can be easily checked with the help of script with Alert(OrdersHistoryTotal());
About sorting. If you click on the column headers in the history, you can sort the history visually by descending or ascending of any column. However orders are always selected using the OrderSelect(Number, SELECT_BY_POS, MODE_HISTORY) function, starting from the beginning of the SELECTED interval of the history. And in the history, the orders are ordered by the time they were sent to the server, which is the most natural. If the number = 0, then this is the oldest order of the SELECTED interval of history. If OrdersHistoryTotal()-1, it's the most recent order of the chosen interval of history. I've checked this many times. And it is unlikely that this will ever be changed.
You are so new here that you don't know everything as it was. It's been a rule of threescore years that a time-based search is the only reliable way of identifying the last/first or consecutive positions. You're working with money. Okay, if only with your own, but with someone else's, too. Even indirectly with your program.
And what you're telling me is no secret or revelation - everyone has known about it for years ;)
And what I was saying - you still don't get it...
You are so new here that you don't know everything as it was. It's been a rule of thumb for three hundred years that a time-based search is the only reliable way of identifying the last/first or consecutive positions. You're working with money. Okay, if only with your own, but with someone else's, too. Even indirectly with your program.
And what you're telling me is not a secret or a revelation - everyone has known about it for years ;)
And what I was talking about - you still don't get it...
Artem, either it's unobtrusive trolling or you don't know what you are writing about!!!
In your last post you talked about sorting. Explained to you that there is no dependence on sorting.
I have seen and participated in one of the discussions about the selection of orders by time. The conclusion was that orders are now sorted in the order database by the time they are sent to the server. But THEORETALLY there is a fear that the developers may change this. That was the end of that discussion. As a database specialist I assure you that this fear is unfounded, a change is out of the question. You can refer the issue to the developers. If I write something, I know what I write. It's the 50th anniversary of programming. If you notice in my posts some mess from your point of view - write to me in person. I will explain, and your doubts will dispel. But here bicker unlikely to be appropriate. I wrote the man a script - he said thank you. Isn't it good?
About the other day. I just changed my username, you can guess what it was by style. Or check your IP, you probably have access... Please leave it unanswered.