How to close opened trade on next days ?

Back to topics list To post a new topic, please log in or register
prozac_md 2014.10.25 17:17

 Hi All,

 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 .

Attached files:
  forumuopen.mq4  (2.59 KB)
forexlabor 2014.10.27 08:33 #


just an idea:

- use D1 timeframe, and check the  numbers of d1 candles

- in the expert init() sections:

int bars_on_the_chart=Bars;

in the expert start() sections:

if (bars_on_the_chart<Bars)  //new day


//close orders ...

//open orders ....



Back to topics list  

To add comments, please log in or register