datetime ends=yesterday;
This is a general question, or may be I didn't understand it clearly! ... Please make it specific or describe your case to get the right answer.
Meantime, this could help ...
I use this into my EAs for expiry period ...
datetime Expiry = D'2015.12.21 23:59'; ..... ..... ..... if(TimeCurrent()>Expiry){ ..... ..... ..... return(0); }
So, you may use same idea by changing the desired end time.
Osama Shaban:
thank you brother for helping This is a general question, or may be I didn't understand it clearly! ... Please make it specific or describe your case to get the right answer.
Meantime, this could help ...
I use this into my EAs for expiry period ...
So, you may use same idea by changing the desired end time.
but i want to change Expiry to yesterday automatically
Potential code
datetime yesterday = TimeCurrent() - 60 * 60 * 24; string time_yyyy_MM_dd = TimeToString(yesterday, TIME_DATE); Print("Yesterday=", StringToTime(time_yyyy_MM_dd));
Other example.
// Date of yesterday //------------------ datetime DayTimeBars[]; // Array for time/date value. CopyTime(Symbol(), PERIOD_D1, 1, 1, DayTimeBars); // Copy the time/date of the previous bar/day to array. Alert("The date of yesterday = ", DayTimeBars[0]);
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