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 it would be better to make your own multiplatform function that will work equally in MT4 and MT5. You need to get data using CopyXXXX() function. In this case - CopyOpen() and CopyClose().
Please tell me the answer to the 2nd part of the question: how to measure the body of the candle, I understand, but how to do it exactly at 58 seconds of its life? This is fundamentally important for my strategy. Thanks in advance for the answer.
Please tell me the answer to the 2nd part of the question: I understand how to measure the body of the candle, but how to do it at 58 seconds of its life? This is fundamentally important for my strategy. Thank you in advance for the answer.
//+------------------------------------------------------------------+//| Количество секунд, остающихся до закрытия свечи |//+------------------------------------------------------------------+long SecondsToCandleClose(conststring symbol_name,constENUM_TIMEFRAMES timeframe)
{
datetime array[];
int copied=::CopyTime(symbol_name,timeframe,0,1,array);
if(copied==1) return ::PeriodSeconds(timeframe)+array[0]-TimeCurrent();
return0;
}
//+------------------------------------------------------------------+
Good afternoon, read the article by the respected moderator(Initialization of global program variables and other useful knowledge), but I don't understand how to put it into practice.
There are two functions in OnInit, #1 draws two buttons, #2 builds lines from a file. If you click on the button, part of the lines will be removed. If you change timeframe, OnInit will be activated and function 2 will automatically draw all lines. I need to change the timeframe to save the changes made by pressing the button. How to do this correctly?
Good afternoon, read the article by the respected moderator(Initialization of global program variables and other useful knowledge), but I don't understand how to put it into practice.
There are two functions in OnInit, #1 draws two buttons, #2 builds lines from a file. If you click on the button, part of the lines will be removed. If you change timeframe, OnInit will be activated and function 2 will automatically draw all lines. I need to change the timeframe to save the changes made by pressing the button. How to do this correctly?
Look at the attachment. Remove the line by hand or by button and switch the timeframe
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
That would be great!!!
and at the beginning of the candle set immediately to the future min. max. ?
there is trolling, maybe something can be based on it
there istrolling, maybe something can be based on it
The least you can do on the basis of trolling is a sauna for 24 hours :)
The least you can do on the basis of trolling is a sauna for 24 hours :)
That was just a figure of speech. I think you get the gist of it.
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 it would be better to make your own multiplatform function that will work equally in MT4 and MT5. You need to get data using CopyXXXX() function. In this case - CopyOpen() and CopyClose().
Please tell me the answer to the 2nd part of the question: how to measure the body of the candle, I understand, but how to do it exactly at 58 seconds of its life? This is fundamentally important for my strategy. Thanks in advance for the answer.
Please tell me the answer to the 2nd part of the question: I understand how to measure the body of the candle, but how to do it at 58 seconds of its life? This is fundamentally important for my strategy. Thank you in advance for the answer.
Good afternoon, read the article by the respected moderator(Initialization of global program variables and other useful knowledge), but I don't understand how to put it into practice.
There are two functions in OnInit, #1 draws two buttons, #2 builds lines from a file. If you click on the button, part of the lines will be removed. If you change timeframe, OnInit will be activated and function 2 will automatically draw all lines. I need to change the timeframe to save the changes made by pressing the button. How to do this correctly?
Good afternoon, read the article by the respected moderator(Initialization of global program variables and other useful knowledge), but I don't understand how to put it into practice.
There are two functions in OnInit, #1 draws two buttons, #2 builds lines from a file. If you click on the button, part of the lines will be removed. If you change timeframe, OnInit will be activated and function 2 will automatically draw all lines. I need to change the timeframe to save the changes made by pressing the button. How to do this correctly?
Here's a look at the attachment. Remove the line by hand or button and switch the TF
Thank you!) everything worked out.
Good day, dear forum users.
Please help me with the following task:
I need to get the indicator data in mt4 using mql, e.g. MA5 with 1d timeframe, as of 14.30 of the day before yesterday.
i.e., if i ran the script with iMA the day before yesterday at 14.30, no questions would arise, but how do i get it today.
at least tell me where to dig