Hi!
I can't figure out why my timefilter doesn't work. Let's say I would like to trade between 7:35-11:30 and 14:30-22:30 and I don't want to trade on Friday.
The time filter only works when I create a simple EA with only a trade.Buy function and no other conditions.
The more complex EA should only buy/sell when the vaule of the Supertrend indicator becomes higher/lower than the price and only in the given time intervals.
It should close the position at the next sell/buy signal (if it was a buy then it should be closed at the next 'sell' signal' ). When closing positions the time interval shouldn't matter.
The 'TradingIsAllowed' variable should return 'true' when the current time is between the allowed time interval but it always returns false and I can't figure out why. I rewrote my code 3 times already..
Could you please help me?
To don't trade on friday:
if(time.dayOfWeek>4){Filter==false;}

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi!
I can't figure out why my timefilter doesn't work. Let's say I would like to trade between 7:35-11:30 and 14:30-22:30 and I don't want to trade on Friday.
The time filter only works when I create a simple EA with only a trade.Buy function and no other conditions.
The more complex EA should only buy/sell when the vaule of the Supertrend indicator becomes higher/lower than the price and only in the given time intervals.
It should close the position at the next sell/buy signal (if it was a buy then it should be closed at the next 'sell' signal' ). When closing positions the time interval shouldn't matter.
The 'TradingIsAllowed' variable should return 'true' when the current time is between the allowed time interval but it always returns false and I can't figure out why. I rewrote my code 3 times already..
Could you please help me?