MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Dozens financial books in MetaTrader Market

One Order Per Day

Back to topics list To post a new topic, please log in or register
avatar
322
wackena 2006.10.11 02:52
 
Can someone help me with code that will only place one order between 0 to 24 hours? I want to code an MT4 EA to place one order per each 24 hour day. Whenever an order is triggered by EA during the day, EA can not place another order until after 24:00 Midnight.

Wackena
 
EURUSD intraday forecast
EURUSD intraday forecast
oleksandr bilokon | 19 December 2014, 06:05 | Views: 83
The indicator of OsMA, marking the decline of bear activity on the hasp of Up- of trend and going down, gives founding to priority of planning of trade operations of correction with advantage of purchases to date. Presently, taking into account the current orientation of indicator, we expect the return of course to the levels of key resistances (1th from 1,2407 to 1,2295 by the end of day, 2th from 1,2445 to 1,2391), where and it is recommended to estimate development of activity of parties in accordance with the charts of less temporal interval.
avatar
97
Zonker 2006.10.13 12:44 #
 

int tradeDay=0;

int start()
{ if(tradeDay != TimeDay(curTime())) tradeDay=0;

..

if(tradeDay==0)
{ if(BuyInCondition())
{ OrderSend(..);
tradeDay = TimeDay(curTime());
}
}
}

 
avatar
322
wackena 2006.10.13 15:09 #
 
Zonker wrote:

int tradeDay=0;

int start()
{ if(tradeDay != TimeDay(curTime())) tradeDay=0;

..

if(tradeDay==0)
{ if(BuyInCondition())
{ OrderSend(..);
tradeDay = TimeDay(curTime());
}
}
}



Zonker, thanks again. You have help me before and you have done it again.

BR,
Wackena
avatar
39
cyberpasta 2007.11.28 12:46 #
 
I have a similar code and works fine, but know I want a one sell and one buy per day, I don't how code this, I've tried this, but dosen't work because this code makes only one order per day. This is only an example, I'm learning.
if(TimeDayOfYear(TimeCurrent())!=DayOfLastBuyTrade && Ask==buystart && Ask>iBands(NULL,0,20,1,0,PRICE_CLOSE,MODE_UPPER,0)){
         OrderSend(Symbol(),OP_BUY,getLotSize(),Ask,2,buystart-sl,buystart+tp,"Comment",MagicNumber,0,CLR_NONE);     
        DayOfLastBuyTrade=TimeDayOfYear(TimeCurrent());
      }
     
      
      else if(TimeDayOfYear(TimeCurrent())!=DayOfLastSellTrade && Bid==sellstart && Bid<iBands(NULL,0,20,1,0,PRICE_CLOSE,MODE_LOWER,0)){
         OrderSend(Symbol(),OP_SELL,getLotSize(),Bid,2,sellstart+sl,sellstart-tp,"CABLEBOT_v1.2",MagicNumber,0,CLR_NONE);
         DayOfLastSellTrade=TimeDayOfYear(TimeCurrent());
      }

 
Back to topics list  

To add comments, please log in or register