View Single Post
  #1 (permalink)  
Old 09-28-2005, 11:36 AM
cardio cardio is offline
Senior Member
 
Join Date: Sep 2005
Location: St Louis, MO, USA
Posts: 176
cardio is an unknown quantity at this point
Post Basic questions ...

Hi

I want to do the following in code

'Don't trade for 30 minutes since my last trade'
So if my indicators indicate that I should add to my current trade again then I place trade in the same direction only if 30minutes have past

I am doing the following - this code does work yet - it is just in design phase - I don't know how to add 30 minutes to my last order

This is for an EA only working on the current pair

int start()
{
int cnt, ticket, total, stop1;
static datetime lasttime

total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

//Determine the time of the last OrderClose
if (OrderCloseTime > lasttime + 30)
{
lasttime = orderclosetime
}//if (OrderCloseTime)
}

Now I want to say
if (Curtime() > lasttime + 30 minutes)
{
Contiue trading
}

pls help
Reply With Quote