Questions from Beginners MQL5 MT5 MetaTrader 5 - page 883
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
How does MT5 download the quote archive? In MT4 for example F2 and then you press refresh, but here?
You do not need to download anything to MetaTrader 5. You can use the quotes for the trading server you are connected to. If you want you can useCopyRates, if you want you can useCopyTicks.
How does MT5 download the quotes archive? In MT4 e.g. F2 and then you press update, but here?
You can't do it directly. Unless you create a custom symbol for which you can import history. The custom symbol can only be used to work with the history. It will not allow you to trade by it.
What if the EA was not active at the time? After all, we would like to get the data from the account history. But this, unfortunately, cannot be done in an unambiguous way. It can only be done with a lot of reservations.
It is strange why the developers did not implementOrderCloseTime() in MT5. Apparently, there was a good reason for it).
It's strange why developers didn't makeOrderCloseTime() in MT5. Apparently, there were serious reasons for that).
Because the order has a different meaning in terms of MT5 and Mql5. To find the closing time of a position, we need to select the orders and deals of this position, find among them a deal with the modifier DEAL_ENTRY_OUT and the time of this deal will be equal to the closing of the position.
Good afternoon, please advise, I cannot make a construction for the following condition: the indicator is started, suitable price parameters appear in the candle, a graphic indication is drawn, but let's say, if it is still far before the candle closes, the indicator can detect another candle combination in this place. The question is how to write the code in the process of every second monitoring so that it removes the previous result when the condition in this candle stops working?
Here is a proper example of rendering, but if I were to run the tester here, it would give me an incorrect candlestick reading. How do you fix it?
And another question - how to make an alert based on the following design concept:
Task - given: TF 1 hour.
The condition - to run the search part of the indicator only, say, after 55 minutes and up to 60 minutes of the current candle, and then restart the cycle.
How to implement this construct?
Good afternoon, please advise, I cannot make a construction for the following condition: the indicator is started, suitable price parameters appear in the candle, a graphic indication is drawn, but let's say, if it is still far before the candle closes, the indicator can detect another candle combination in this place. The question is how to write the code in the process of every second monitoring so that it removes the previous result when the condition in this candle stops working?
Here is a proper example of rendering, but if I were to run the tester here, it would give me an incorrect candlestick reading. How do I fix it?
1. The tester was and is working correctly, no errors.
2. mistake in your understanding of the testing process: when the first run of the indicator or paging history occurs (remember, the sign of this is prev_calculated==0), you go around all the bars in a loop. So, in this loop you use arrays-timeseries
which, for each i-th member of the loop, has only ONE value Open, High, Low and Close.
But when all the bars are passed, the tester starts working in tick mode on each bar - that is why you can see how High goes up and Low goes down.
1. the tester worked and works correctly, there are no errors.
2) There is an error in your understanding of the testing process: when the first indicator run or history paging occurs (remember, the sign of this is prev_calculated==0) you bypass all the bars in the loop. So, in this loop you use arrays-timeseries
which, for each i-th member of the loop, has only ONE value Open, High, Low and Close.
And when all bars are passed, the tester starts working on each bar in tick mode - that's why you can see how High goes up and Low goes down.
Yes, I agree that when the tester starts, the result is different due to price values filling, but the question is how to insert a condition when in one candlestick, for example, first one pattern is formed, but at the end another one appears but it cannot be replaced with another indicator entry because the corresponding condition is not prescribed. How to specify it?
Here is the code forming the candlestick indication, but how to make it re-drawable?
Yes, I agree that when you run the tester the result is different due to price values filling, but the question is how to put a condition in the construction, when in one candle, for example, first one pattern is formed, but at the end another pattern appears, but it cannot be replaced by another indicator entry, because the appropriate condition is not prescribed. How to specify it?
Here is the code forming the candlestick indication, but how to make it re-drawable?
Store the bar number in the index. Check it before drawing. If there is an object on the bar, delete it. ObjectDelete.
Yes, I agree that when you run the tester the result is different due to price values filling, but the question is how to put a condition in the construction, when in one candle, for example, first one pattern is formed, but at the end another pattern appears, but it cannot be replaced by another indicator entry, because the appropriate condition is not prescribed. How to specify it?
Here is the code forming the candlestick indication, but how to make it re-drawable?
Just to provide three states:
Simply provide three states: