New challenges

Created at 19 Aug 2020, 02:31
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
SA

samuel.jus.cornelio

Joined 19.03.2020

New challenges
19 Aug 2020, 02:31



New challenges The idea is to create a command that makes the bot not work on certain days. In this case the bot would work from Monday to Thursday, but it would be inactive on Fridays 
and on weekends. However I have no idea how to create this command, Does anyone have any idea how I can solve this problem? Thank you very much

 


@samuel.jus.cornelio
Replies

firemyst
26 Aug 2020, 14:33

Here's an example how. You have to get the current date in your code:

if (_currentDate.DayOfWeek != DayOfWeek.Friday && _currentDate.DayOfWeek != DayOfWeek.Saturday && _currentDate.DayOfWeek != DayOfWeek.Sunday)
{

}

 


@firemyst