How do I retrieve the date-time for a specified bar? I looked at the date-time functions
but couldn't find an answer or I probably overlooked.
For example, in the following sample code, I am trying to write the date, open,
high, low and close to a file. How do I find the date of the bar being used ?
....
int nCurrBar = Bars;
while (nCurrBar > 0 )
{
// Print the Date of the nCurrBar.
FileWrite(hFile, **date of nCurrBar**, Open[nCurrBar], High[nCurrBar], Low[nCurrBar],
Close[nCurrBar] );
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.
For example, in the following sample code, I am trying to write the date, open, high, low and close to a file. How do I find the date of the bar being used ?
....
int nCurrBar = Bars;
while (nCurrBar > 0 )
{
// Print the Date of the nCurrBar.
FileWrite(hFile, **date of nCurrBar**, Open[nCurrBar], High[nCurrBar], Low[nCurrBar], Close[nCurrBar] );
nCurrBar--;
}
Thanks in advance,
Adheer.