Download MetaTrader 5
To add comments, please log in or register
Millions of traders download codes from MQL5 library. Share your app with them!
mariusz
5
mariusz 2014.10.25 15: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 .

Files:
forexlabor
2
forexlabor 2014.10.27 07:33  

Hi,

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 ....

bars_on_the_chart=Bars;


}

/
To add comments, please log in or register