Questions from Beginners MQL4 MT4 MetaTrader 4 - page 106
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
1. How do I close a position with a pending order? I couldn't find any special tools in the documentation. So, only by counter order and then OrderCloseBy()?
2. How do I know the error that occurred when triggering a pending order, e.g. NOT_ENOUGH_MONEY? There is nothing in LastError(). But it is there and the tester displays it in the log.
1. Look how this issue is handled smartly in the MT5 when using a netting account. There all simultaneously opened orders for one instrument are summed up. The opening price of a net position is then averaged. Opening a counter order closes the position. Opening of the double opposite order reverses the position, etc. There is no need for many calculations for a pile of orders
2. Perhaps, after the pending order triggering, another operation, changing the value of the _LastError variable, is performed. Try to check it immediately when entering OnTick().1. Yes, from that point of view it is convenient. On the other hand, if there are several systems running on the account at the same time, it only makes it more difficult to control them.
2. That's exactly what I do, GetLastError() always = 0.
p.s. how do i get a response from Metaquotes? there is nothing at all in the documentation about working with pending orders in MT4.
2. That's exactly what I do, GetLastError() always = 0.
p.s. how do i get a response from Metaquotes? there is nothing at all in the documentation about working with pending orders in MT4.
1. So, either SL, TP help, or wait for the order to open in the market and CloseBy, but the second option makes sense...
Are you sure about MT4? in MT5, you just need to check ResultRetcode, not LastError.
what is not in the documentation? it's always been enough
1. Yes, from that point of view it is convenient. On the other hand, if there are several systems running on the account at the same time, it only makes it harder to control them.
p.s. how do i get a response from Metaquotes? there is nothing at all in the documentation about working with pending orders in MT4.
The other brigade is a democracy, but the deposit is shared. The boss says after the meeting: OK, go buy at 50. In the meantime I'll sell the rest at 40.
Which brigade has a higher yield?
PS There is a language reference in the documentation. And everyone drains the deposit at their own risk. Examples in codeBase a lot. In the terminal, open the library tab at the bottom third from the end. There you can also filter Indicators, Expert Advisors, Scripts by right-click on the title
Good afternoon everyone, could you please advise why the quotes occasionally start to deviate from the real ones?
Good afternoon everyone, could you please advise why the quotes occasionally start to deviate from the real ones?
Everyone uses it silently to make a profit.
Question about orders in MT4, sorry for the off-topic, but there is no life in that section :( and I would like toget an answer fromMetaquotes.
https://www.mql5.com/ru/forum/160587/page106#comment_6130412
It's just that my charts have variations of a hundred pips and different candlesticks. I can't figure out what the reason is.
It's a trend direction indicator! Use it to make a profit...
Metaquotes has provided a tool. Using it involves risks, you apply it at your own risk. Examples of use in CodeBase. In the terminal, the Library tab. Metaquotes is unlikely to teach you