MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Write an Article and Earn Money

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
 
$1.1m pay packets as Och-Ziff London profits surge by 115%

$1.1m pay packets as Och-Ziff London profits surge by 115%

If you want to get an idea of what pay is really possible in large, publicly listed hedge funds, it’s worth looking at the figures filed in small subsidiaries over the accounts unveiled by the investor relations department. Och-Ziff Capital Management, for example, says it paid an average of $106k per head so far in 2014 across all its global offices.

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