Thread: How to code?
View Single Post
  #510 (permalink)  
Old 11-27-2007, 01:36 AM
antone antone is offline
Senior Member
 
Join Date: Oct 2006
Posts: 102
antone is on a distinguished road
Quote:
Originally Posted by Devil2000 View Post
Really? I can't find it on the previous page.
That should be working. But in an hour, sometimes there will be some minutes missing due to your internet connection or server's lag.
sorry for the confusion this is the code for the Clocks so i can change with different GMT

Quote:
double Clocks = TimeCurrent() - (Broker)*3600;
broker is broker time in GMT..

another problem code i need guys.. sorry if i ask too much..

my problem :
i want that it will only open a max of 1 floating sell and 1 floating buy in a day.. but can open more than a lot of buy or sell in a day.. if the EA runs three days and everyday order conditions are met then it will have 3 floating buy/sell or 6 floating buy and sell..

example:
DAy 1 = open a 1 buy hits Tp and open another buy = 1 buy still open
Day 2 = previous buy still open and open another buy = 2 buys still open
Day 3 = 2 buys still open and another buy open = 3 buys still open


Quote:
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == false) break;
if(OrderSymbol()== Symbol () && OrderMagicNumber()== Magic_Number)
{
if(OrderType() == OP_BUY) buys++;
if(OrderType() == OP_SELL) sells++;
}
}

if (buys < 1) it orders a buy
if (sells < 1) it orders a sell when the conditions are met

Last edited by antone : 11-27-2007 at 04:18 AM.
Reply With Quote