Signal Expert for Daytrade: How to stop execution and close positions at end of the day, and start again on next day?

 

Hi guys,


I'm a newbie struggling with this problem:


I want to create a signal for expert wizard to operate on daytrade.

The standard library has a "intraday filter", it limits trades but doesn't close open positions after period, so it is useless for my purpose.

I've tried to implement Long/Short Conditions (if (Closetime-1min)-->close), changed Direction in various ways, without success.

Also, I tried to mess directly at expert generated code (although I would prefer, if possible, to pack everything inside Signal) with OnTrade, OnTick etc. but nothing works.

So, how can the signal turn expert on/off when condition is satisfied, closing positions at the end?


Any ideas?

 
Solved (poorly, but works) forcing close inside Direction().
Reason: