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

 
Alexander Bykov:

Greetings. Help is getting a volume return error:

I have an array created. Bid, date and volume..:


Marks: Invalid Array access

volume_start=Volume[ index(0,1,2,...) ]; // какой бар смотреть
 
Vitaly Muzichenko:

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

 
Alexander Bykov:

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?
Or is it better to do it in OnTick() function?

In MQL5
 
Roman Sharanov:

Can you tell me how to make all code to be executed every 15 min?
Or is it better to do this in the OnTick() function?

In MQL5

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

Поиск - MQL5.community
Поиск - MQL5.community
  • www.mql5.com
Поиск выполняется с учетом морфологии и без учета регистра. Все буквы, независимо от того, как они введены, будут рассматриваться как строчные. По умолчанию наш поиск показывает страницы...
 

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.

 
Artyom Trishkin:

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

 
tura210577:

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().

 
Artyom Trishkin:

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!

Reason: