Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 422
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
Greetings. Help is getting a volume return error:
I have an array created. Bid, date and volume..:
Marks: Invalid Array access
Is it possible to write the Volume of the current bar?
It doesn't work to write an array to an array in any way.
That is, I need to write the tick volume of the current bar.
Only then write it to the array
Is it possible to write the Volume of the current bar?
It doesn't really work to write an array to an array.
That is, I need to write the tick volume of the current bar.
Only then write it to the array
volume=Volume[0];
Can you tell me how to make all code to be executed every 15 min?
In MQL5Or is it better to do it in OnTick() function?
Can you tell me how to make all code to be executed every 15 min?
In MQL5Or is it better to do this in the OnTick() function?
https://www.mql5.com/ru/search#!keyword=%D0%9D%D0%BE%D0%B2%D1%8B%D0%B9%20%D0%B1%D0%B0%D1%80&module=mql5_module_forum
Hello! Help me resolve the situation: I open a position 1 under the condition of Y1, closed under the condition of Y2. But if before the occurrence of U2 once again occurs U1 and opened position 2, it does not react to come U2, and hangs to the next U2, which came after the new U1 (!) And this new position is not closed by a new U2, and waits for the next condition U1-U2. How to avoid that? My head is killing me. Thank you.
In this thread I want to begin to help those who really want to understand and learn programming in the new MQL4 and want to easily switch to MQL5 - the languages are very similar.
This will be a good place to discuss tasks and algorithms for their solution, as well as any other questions that may arise in one way or another when programming for MT.
I hope, that other experienced participants of our forum will join us and this branch will be interesting to all.
Hello Artem! Thank you very much in advance for volunteering to go "offroad" with us newbies. And immediately a question: I need to measure the body of a bullish candle from the opening price to the closing price in pips at 58 seconds of its life:) (Example: EUR/USD 1M, open 1.20100, close 1.20200 i.e. =100) and then enter the market if the condition meets the requirements of the strategy. The only question is whether this is better done using operators OPEN[], CLOSE[] or iOpen, iClose? Thank you
Hello Artem! I am very grateful in advance for volunteering, so to speak, to go "off-road" with us newbies. And immediately a question: I need to measure the body of a bullish candle from the open price to the close price in pips at 58 seconds of its life:) (Example: EUR/USD 1M, open 1.20100, close 1.20200 i.e. =100) and then enter the market if the condition meets the requirements of the strategy. The only question is whether this is better done using operators OPEN[], CLOSE[] or iOpen, iClose? Thank you
If the question is only about functions, then this is the following: if you want to get data only from the current period of a chart - the one where you are running the Expert Advisor/Script or indicator, then Open[] and Close[] are enough. If you want to receive data from a certain timeframe, regardless of which timeframe the Expert Advisor is running on, then iOpen() and iClose() will be enough.
But it is better to make your own multiplatform function which will work equally in MT4 and MT5. Here you need to get data using functions CopyXXXX(). In this case - CopyOpen() and CopyClose().
If the question is only about functions, then: if you want to receive data only from the current period of the chart - from the one on which the EA/script or indicator is running, then Open[] and Close[] are enough. If you want to get data from a certain timeframe, no matter what timeframe the Expert Advisor is running on, then iOpen() and iClose() will be enough.
But better to make my own multiplatform function which will work equally in MT4 and MT5. You need to get data with CopyXXXX(). In this case - CopyOpen() and CopyClose().
Thanks for the reply!
I don't understand, is my question above too complicated, or is it so simple that no one wants to bother answering it? At least give me some feedback!