time older than by days
One solution:
(TimeCurrent () - OTime) > (86400 * 3)
Sorry for missing the code button again. I am on mobile.
Don't hard code numbers. Write self-documenting code. You should be able to read the code out loud and have it makes sense.
mohd alqallaf: i am confused how to calculate if "OTime" is older than 3 days
oTime < TimeCurrent() - 3 * PeriodSeconds(PERIOD_D1) // oTime is older than 3 days ago.The question is ambiguous. Do you mean 3 days or 3 trading days.
iBarShift(_Symbol, PERIOD_D1, oTime) > 3 // oTime is older than 3 trading days ago.
thanks for the help
Hey also look at CDateTime in Include/Tools/...
There is a brilliant solution where the current Time is resolved into MqlDatetime struct, where every time unit is displayed in int numbers and you have an Increment/Detrement method for every unit(say hours/days).
But, the MqlDateTime is all public which means you can show every seconds value at every point in time.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i am confused how to calculate if "OTime=2022.05.20 22:00" is older than 3 days by TimeCurrent()
i tried
or
forgot about my calculations its totally fail i just want to use 'if expression' date(OTime) is older/greater than 3 days by TimeCurrent()