Using time in formula
-
Hi!
I would like to use the time (hours only) in a formula. How?
Thanks,
Avraham -
@avrahambr Which 'hours'? Time of day or time in trade?
I also would like to have a condition block for time in trade. Can't seem to find it. Perhaps my glasses are dirty ...
Thanks
-
You have the "check age" block

Might be what you are looking for.
-
Thanks. Check age seems to help in time of the trade, which i also need. But i still need time of the day. Anyone knows?
-
Hi @avrahambr
You have some blocks that can help you in what you are trying to get on the "TimeFilter" pane

If you are looking for a TimeFilter that allows or not the EA to run on that time period, this is how I am doing that

It works well for my purpose.
You have time options in the "Condition block" as well

There are many ways to do the same in fxDreema. If you share more detailed info of what you are trying to get, there are many people that will be glad to help giving you some guides/suggestions or sharing a simple EA for you. You don't have to give the whole logic of your project, of course. Just explain as much as possible what you need to achieve.
-
Thanks!
There is no secret here, just AlphaOmega's Mean reverse strategy from ForexFactory. There is a formula there, something like ((t+1)^2)/34 , when t is GMT time - only the hours. From the things you wrote here i see some way to do it, but a little complicated. Is there any straightforward way to do this? -
If you want to get the current hour, for example if now is 13:05 and you want to get 13, then in MT4 you can try this:
TimeHour(TimeCurrent())... where TimeCurrent() gives you the current server time as a number of seconds since 1.1.1970. TimeHour() obviously gets that number of seconds and gives you the current hour back.
Instead of TimeCurrent() you can use TimeLocal() or TimeGMT().
It's interesting that TimeHour() doesn't exist in MQL5, so it is a little but more complicated.