Hi,
I tried coding it with following:
But it showing 0:00 where as future starts at 1:00 then how can correct start time of Future instruments, CFD & Metals?
Thank you in advance.
Regards
I have never used this, but the documentation says that it returns market starting date not the time the market opens on a daily basis.
Is there any way to detect Future Contract market opening time in both mql4 & mql5?
Thank you
You can view the information from the Market Watch by right-clicking the instrument and selecting Specification:
I have never managed to retrieve that information in code.
At best (and this involves some risky presumptions) you can extract the time from contract start and contract end. The presumption is that the contract starts at the market open on the first day, and the contract ends at the market close on the last day. This is a risky and possibly erroneous conclusion, depending on the contract.
Here is an example on the DAX:
end =(datetime)SymbolInfoInteger(NULL,SYMBOL_EXPIRATION_TIME);
printf("Start: %s // End: %s",TimeToStr(begin),TimeToStr(end));
The outcome:
So the contract ends at 22:00 on 16 March... presumption is that the market closes at 22:00 each day (it does, on this contract).
Unfortunately, the "begin" datetime doesn't return a valid start date on this broker.
You can view the information from the Market Watch by right-clicking the instrument and selecting Specification:
I have never managed to retrieve that information in code.
At best (and this involves some risky presumptions) you can extract the time from contract start and contract end. The presumption is that the contract starts at the market open on the first day, and the contract ends at the market close on the last day. This is a risky and possibly erroneous conclusion, depending on the contract.
Here is an example on the DAX:
end =(datetime)SymbolInfoInteger(NULL,SYMBOL_EXPIRATION_TIME);
printf("Start: %s // End: %s",TimeToStr(begin),TimeToStr(end));
The outcome:
So the contract ends at 22:00 on 16 March... presumption is that the market closes at 22:00 each day (it does, on this contract).
Unfortunately, the "begin" datetime doesn't return a valid start date on this broker.
Hello honest_knave,
Thank you for the explanation. Actually I also did find 1970 start date. But no start time, So realises its not going to happen & added manual option for user to input future start time. But MetaQute should add a code for this.
Regards
Thanks again.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I tried coding it with following:
But it showing 0:00 where as future starts at 1:00 then how can correct start time of Future instruments, CFD & Metals?
Thank you in advance.
Regards