Exclude a specific month from trading in cBot

Created at 27 Sep 2019, 03:57
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!
mparama's avatar

mparama

Joined 11.10.2016

Exclude a specific month from trading in cBot
27 Sep 2019, 03:57


Hi,

how can I exclude a specific month from trading in a cBot.

Actually I want to exclude: January, May, September

I have been trying to call the month by using:

var Maggio = Server.TimeInUtc.Month.Equals("May");

and I know its wrong

I need it for BackTesting 

any help please !!!


@mparama
Replies

mparama
27 Sep 2019, 06:30

Found It !!!

//---------------------------------------------
            var January = Server.TimeInUtc.Month.Equals(1);
            var May = Server.TimeInUtc.Month.Equals(5);
            var September = Server.TimeInUtc.Month.Equals(9);
            //---------------------------------------------

.................................................

...............................................

       if (!January && !May && !September)
            {

 

 

Thanks anyway !!!!


@mparama