dear friends,
i need help with the time and date to set my script in motion... meaning - how can i differentiate between Monday and Tuesday ... and how can I translate the hours from the broker platform ?
any piece of code in this respect is greatly appreciated !
have a wonderful day ahead & thank You !
Have you seen this? In there, the use of TimeToStruct will allow you to retrieve the day information.
if(TimeDayOfWeek(TimeCurrent())==SUNDAY) { BuyIcecream(MaxLots); ExpertRemove(); }
looks good - you just compare with the day ? can you do the same with the hour ? how ? appreciated !
- lippmaje:
if(TimeDayOfWeek(
Where do you see that function in the documentation? Or the added functions
List of MQL5 Functions - Reference on algorithmic/automated trading language for MetaTrader 5
New MetaTrader 5 Platform beta build 1845: MQL5 functions for operations with bars and Strategy Tester improvements - Options Trading Strategies - General - MQL5 programming forum 2018.06.08 - CB: can you do the same with the hour ? how ?
Perhaps Again you should read the manual.
This is the group of functions for working with data of datetime type
Date and Time - Reference on algorithmic/automated trading language for MetaTrader 5
Where do you see that function in the documentation? Or the added functions
List of MQL5 Functions - Reference on algorithmic/automated trading language for MetaTrader 5
New MetaTrader 5 Platform beta build 1845: MQL5 functions for operations with bars and Strategy Tester improvements - Options Trading Strategies - General - MQL5 programming forum 2018.06.08Perhaps Again you should read the manual.
Yes but if you know you can help him to save his time by summarizing for him.
MqlDateTime currentTime; datetime currentTime_dt=TimeCurrent(currentTime); // now we have the 'raw' current time in currentTime_dt and the 'structured' time in currentTime struct if(currentTime.day_of_week>=MONDAY && currentTime.day_of_week<=FRIDAY && currentTime.hour>=10 && currentTime.hour<=17) { ExpertGoToWork(); }Here's how to do it with a time struct, works both MQL4 and 5.
Then he keeps asking the same type of trivial question, wasting everyone's time and learning nothing. It's not saving him any time.
You'll change your mind, after you answer his 25th question.
Then he keeps asking the same type of trivial question, wasting everyone's time and learning nothing. It's not saving him any time.
You'll change your mind, after you answer his 25th question.
Here's how to do it with a time struct, works both MQL4 and 5.
lippmaje - great help sir. appreciated. we can close this thread. APPRECIATED SIR !
Then he keeps asking the same type of trivial question, wasting everyone's time and learning nothing. It's not saving him any time.
You'll change your mind, after you answer his 25th question.
i have opened 3 threads for the last 3 years. i have no idea why you are so exaggerated in reaction...
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
dear friends,
i need help with the time and date to set my script in motion... meaning - how can i differentiate between Monday and Tuesday ... and how can I translate the hours from the broker platform ?
any piece of code in this respect is greatly appreciated !
have a wonderful day ahead & thank You !