Hi
I had code running from the beginning of this week and it had the following filter.
If Dayofweek = 7 then
TradeOK =0
else
Tradeok =1
endif
The code proceeded to execute a trade at market open around 10:03pm (Berlin time)
So my filter did not stop it.
If I change it to
If Dayofweek >= 1 then
TradeOK =1
else
Tradeok =0
endif
Then it did prevent the trade. But it will create other problems for my code and if Sunday is regarded as 7 then it may still place a trade.
I do not want to let the algos trade so early at the start of the week as bid offer spreads are too wide and unpredictable.
Is there maybe another solution where one can create code that measures the current bid offer spread to create a better filter?