Download MetaTrader 5

How to make my EA to trade 1 buy and 1 sell for one day

To add comments, please log in or register
Are you a good trader? Become a signals provider and make even more money!
fadil1994 2017.03.19 16:43 

Hi everyone,

I am new to mql4 programming and I have been trying to develop a expert advisor that will enter based on a certain condition, however I have managed to make the entry part work, but the problem is that I only want to have 1 buy and 1 sell entry everyday, for now, whenever the EA will add a new entry if the old entry has already hit it's take profit price. For example, if there is a buy entry running then the EA would not add more entry, that's perfect but once the buy is already TP, the EA adds another entry if the conditions are TRUE. It would be great if anyone could help me with fixing this problem, I just want to make 1 buy and 1 sell entry per day.

Shehbaz Nawaz
Shehbaz Nawaz 2017.03.20 08:55  

Count the trades by EA using magic number 

You'll have to loop through all the market orders

If tradesByEA()!=0 no need to add trade

To add comments, please log in or register