Questions from Beginners MQL5 MT5 MetaTrader 5 - page 291
![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
Hello. I have a question like this. I have just started studying MQL, and I must be doing something wrong, but I don't know where and what exactly. The matter is this: I am writing an Expert Advisor (in this case a trivial "martingale" combined with "10 pips per day"). In the Strategy Tester it gives results, which in principle I am satisfied with. Everything seems to work, but (!) only until I do not put it for real. It simply does not work. It doesn't open trades when it should, and there are no messages in the Experts tab or in the Journal. What am I doing wrong? I'm not sure what to do with it.
You have no error handling when opening orders.
For example:
You want to open a short Ask position and set SL and TP at the same time.
Firstly, not all brokers allow you to do this. Open an order with zero SL & TP, then modify it.
Secondly, if you have 4-digit quotes, then modification at Bid+10*Point will still work, for 5-digit brokers it will not, as SL/TP will be too close to the current price.
Third, always check the result in the OrS variable, if there is -1, then check GetLastError() to clarify the error.
You have no error handling when opening orders.
For example:
You want to open a short Ask position and set SL and TP at the same time.
Firstly, not all brokers allow you to do this. Open an order with zero SL & TP, then modify it.
Secondly, if you have 4-digit quotes, then modification at Bid+10*Point will still work, for 5-digit brokers it will not, as SL/TP will be too close to the current price.
Third, always check the result in the OrS variable, if there is -1, then check GetLastError() to clarify the error.
Thanks, I'll try without SL\TR, but I think in that case I'd get error 130 when the server responds. But the problem is that there is not even an attempt to open an order.
I was writing for 4-digit quotes, so I didn't bother with this point until demanded. In any case, I am thinking to implement manual setting of TP and SL during initialization.
GetLastError is relevant when I expect some error and am ready to create an exception for it. But I usually try to avoid such situations. In order to know the error number, it is enough to see the EA log.
Thanks anyway) I will try to play with stops after all.
Hello, I would like to ask you to help me to understand the MT5 terminal. I traded in Kvik before, in other markets.
Attached are screenshots of the same section of the chart with the trend line (resistance line marked in blue) at different timeframes.
What is confusing is that the same trend line is located absolutely differently in different timeframes.
Moreover, it is not an error (like in Quick Fix, for instance), but a colossal difference. For me it is critical.
I do not even consider the timeframe less than one hour because this line is not present on them at all!
For me it is critical. Maybe I should tighten something in the settings, or maybe it should be like this (I'm slightly shocked, then).
Please, explain it to me.
One more question. Attached is a screenshot of a candlestick chart with some candlesticks highlighted in green (where the opening and closing price coincide)
Why is it highlighted? Where can I disable it?
Thanks in advance for the tip.
I am writing my questions in this thread because I did not find a dedicated MT5 thread on the forum.
One more question. Attached is a screenshot of a candlestick chart with some candlesticks highlighted in green (where the opening and closing price coincide)
Why is it highlighted? Where can I disable it?
Thanks in advance for the tip.
I am writing my questions in this thread because I did not find a dedicated MT5 thread on the forum.
Hello, I would like to ask you to help me to understand MT5 terminal. I traded on other markets using Quickswitch before.
Attached are screenshots of the same section of the chart with the trend line (resistance line marked in blue) at different timeframes.
What is confusing is that the same trend line is located absolutely differently in different timeframes.
Moreover, it is not an error (like in Quick Fix, for instance), but a colossal difference. For me it is critical.
I don't even want to trade on TFs less than 1 hour because this line is not present on them at all!
Maybe I should tighten something in the settings somewhere or it should be like this (I'm slightly shocked then).
Please, explain it to me.
Maybe, it would be better, if you place the attachment points of the trend line more precisely, on D1 or less, so that they don't "hang" in the air.
But in general, this is a bug, write to servicedesk (in the profile).
ps there's that old no joke: the lines in MT intersect. This problem is older than MT5. If you want geometry on the chart - I'm afraid MT5, for all its merits, is not your choice.
...
Posting my questions in this thread as I couldn't find a dedicated MT5 thread on the forum.
Maybe it would be a bit better if you placed the trendline anchor points more accurately, on D1 or less, so that they don't "hang" in the air.
But in general it's a bug, write to servicedesk (in the profile).
ps there's that old no joke: the lines in MT intersect. This problem is older than MT5. If you want geometry on the chart - I'm afraid MT5, for all its merits, is not your choice.
In the terminal colour settings (F8). "Line" in my opinion.
Thank you, I understand. So it's not just me (my broker). I trade by levels (manually, without indicators). I didn't think it was so bad from the point of view of the basic (simplest) tools in the super-promoted MT. Yes, I'm trying to make trends on lower TFs. But then I just do not see important (global) market points defined in older TFs, unfortunately. After all the older is the TF the more significant are its levels, extrema etc.