How to use DayOfWeek for omitting trades during specific days of the week

Created at 01 Mar 2018, 18:20
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!
MA

marwaha1@gmail.com

Joined 27.02.2018

How to use DayOfWeek for omitting trades during specific days of the week
01 Mar 2018, 18:20


hi,

would appreciate if someone can help me with how to set the day of week as parameter and then using it inside the onBar logic to "NOT TRADE on that day of week"

i tried this but it doesnt work.

[Parameter("nonTradingDay", DefaultValue = 0)]
        public int DoW { get; set; }


protected override void OnBar()
{
    if(Time.DayOfWeek != DoW)
     {
          //do not trade
     }
}

 


@marwaha1@gmail.com