Download MetaTrader 5
To add comments, please log in or register
Add our channel to friends and follow the news!
Patrik Polak
296
Patrik Polak 2011.08.03 18:38 
Hello, I need accept only 1 trade (buy or sell) per 1 day (no more). Pls write me code, thx
Simon Gniadkowski
Moderator
17962
Simon Gniadkowski 2011.08.03 19:15  
rozirozi:
Pls write me code, thx
No !
noonehastherighttojudgeanother
211
noonehastherighttojudgeanother 2011.08.03 20:07  

i think the question might have been " can someone direct me to a sample of code that shows how can I limit my ea to only one trade in a day?"

Simon Gniadkowski
Moderator
17962
Simon Gniadkowski 2011.08.03 20:30  
serpentsnoir:

i think the question might have been " can someone direct me to a sample of code that shows how can I limit my ea to only one trade in a day?"

Ah I see . . . sorry, didn't realise ;-)

Try this: http://crum.be/1h

Adili Rouzi
188
Adili Rouzi 2011.08.04 02:51  

#property copyright "Copyright ?2011, Soldat Software Corp." //6
#property link "http://492598710.qzone.qq.com/" //7

int MAGICMA; //11
int totaltrade;
int ticket;
int start()
{
MAGICMA = TIME_DATE;
int li_ret_0 = 0 ;

for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++)
{
if (OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES))
if (OrderMagicNumber() == MAGICMA)
li_ret_0 = 1;
else
totaltrade++;
}
if(totaltrade == OrdersTotal())
{
ticket=OrderSend(Symbol(),OP_BUY,0.1,Ask-25*Point,3,0,Ask+25*Point,"Dolan",MAGICMA,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
return(0);
}
return(0);
}

/
To add comments, please log in or register