View Single Post
  #3 (permalink)  
Old 12-22-2005, 09:27 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow

Quote:
Originally Posted by maxime_mataf
Hi all,

I develop my first expert advisor. I've just a small problem. I don't want more than one BUY order and SELL order per day.

By example, if I have a signal for open a Buy order : It won't be open if a Buy order was opened during the day (00h00 GMT ==> 00h00 GMT) and it's the same thing for the short position : if I have a signal for open a Sell order, it won't be open if a Sell order was opened during the day.

So the EA can open only one Buy order and only one Sell order per day.

How to develop that ??

Thank you

Max
Max,

I just want to ask you, what if this order (Buy or Sell) hasn't been opened today (Ex: Yesterday)?
Do you want to open a new order in this case or you want to open only one order per chart?

Anyway, you can use something like this to check if the order has been opened today or not:

PHP Code:
if(OrderSelect(1SELECT_BY_POS)==true)
  {
   if(
TimeToStr(OrderOpenTime(),TIME_DATE ) != TimeToStr(CurTime(),TIME_DATE ))
     {
       
//open new order  
     
}
  } 
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote