Preventing EA from placing 2 of the same trades in one day.

 

Hi All.

Quick question does anyone have an idea for how to stop or prevent an EA making another type of trade, if it has already traded one in that day.
For example, if I have placed a buy limit, and it has triggered. How would I prevent another buy limit being placed later in the day.
I currently have it so it only places or has one trade at a time, however if one buy limit stops out, it may place another buy limit in the same day.
However, if the first buy limit is triggered, and say, for example, stops out, I need to prevent it from placing another buy limit in the same day.

Any ideas???


Thanks in advance guys.

 
Before you place an Order check the Order History for recently closed trades and check the OrderOpenTime() . . one thing I'm not sure on is if this is the time the pending Order was placed or the time that the Order activated and became a trade . . if its the time it became a trade then it's no good to you and you will have to record all this info yourself in a file . . . or alternatively you might want to bodge it and use a Global Variable.
Reason: