I am coding a system which will be placing only one trade per day .
On the next day if market meets my requirements , selected order must be reversed , e.g. sell into buy
If the requirements are not met-> the postion should be opened till system reverse it . In that time new trades do not be filled!
Attached code cause that the new order can be opened and closed at the same day ;/
What is more next day occurs new trades without closing previous trade.;/
Please help me :)
I attached file .
just an idea:
- use D1 timeframe, and check the numbers of d1 candles
- in the expert init() sections:
in the expert start() sections:
if (bars_on_the_chart<Bars) //new day
//close orders ...
//open orders ....