■ HOW to make wait time after stoploss hit ?

 

Dear all specialits,

Hi, My name is Yoshi from Japan.

I would like to have a hint to create EA to implemtnt

" 5 minute Waiting time after stoploss hit "

I want use Sleep function, but could not use.....

if(CurrentPosition == -1){  
  //If BB lower hit, implement order.
  if(iClose(NULL,0,0) < iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_LOWER,0)){
    

    Ticket = OrderSend(Symbol(), OP_BUY, 1, Ask, 3, Ask-(200*Point), Ask+(400*Point), "Buy", 0, 0, Blue);
//sleep for 5 minute.

Sleeep(300000);
 }
}

So If you could help me it would be really appriciate.

Thank you thank you.

yoshi

 
lastchancenow wrote >>

Dear all specialits,

Hi, My name is Yoshi from Japan.

I would like to have a hint to create EA to implemtnt

" 5 minute Waiting time after stoploss hit "

I want use Sleep function, but could not use.....

if(CurrentPosition == -1){  
  //If BB lower hit, implement order.
  if(iClose(NULL,0,0) < iBands(NULL,0,20,2,0,PRICE_CLOSE,MODE_LOWER,0)){
    

    Ticket = OrderSend(Symbol(), OP_BUY, 1, Ask, 3, Ask-(200*Point), Ask+(400*Point), "Buy", 0, 0, Blue);
//sleep for 5 minute.

Sleeep(300000);
 }
}

So If you could help me it would be really appriciate.

Thank you thank you.

yoshi

search this ea : Viseu Open 001 and have a look to it after ech loss it wait 90 min beffore ctrading again. cheers

 
lastchancenow wrote >>

Dear all specialits,

Hi, My name is Yoshi from Japan.

I would like to have a hint to create EA to implemtnt

" 5 minute Waiting time after stoploss hit "

I want use Sleep function, but could not use.....

I would look at the order that has hit stoploss from the History; take the Orderclosetime and add the minutes you like to wait.

 
start() {
  //...
  //---- Find my open order,
  for(int index = OrdersTotal() - 1; index >= 0; index--) if (
     OrderSelect(index, SELECT_BY_POS)
  && OrderMagicNumber()	== MagicNumber	// with my magic number,
  && OrderSymbol()	== Symbol() ) {	// in my chart.

    // modify trailing stops, etc

    static datetime newAllowed;
    newAllowed = curTime() + 60 * 5; // No new trade until this one closes
}

if (curTime() < newAllowed) return(0);  // No new trades yet.

// Now I can open a new one.

//...
 

Apart from all that - you spelled Sleep with too many "e"s.


CB

 
logan113 wrote >>

search this ea : Viseu Open 001 and have a look to it after ech loss it wait 90 min beffore ctrading again. cheers

Dear Mr.Logan113,

Thank you for reply ^^

I tried to find Viseu Open 001, but could not found...

If you could tell more infomations, it will be glad so much^

Yoshi

 
ronaldosim wrote >>

I would look at the order that has hit stoploss from the History; take the Orderclosetime and add the minutes you like to wait.

Dear Mr.ronaldsim,

Thank you for reply^^

take order close time means,

Stoptime = OrderCloseTime()

And how to add minute ??

if you could tell a hint, it will be so glad^^

thank you

yoshi

 
cloudbreaker wrote >>

Apart from all that - you spelled Sleep with too many "e"s.

CB

Dear Mr.Cloudbreaker

Thank you for attention^^

Yoshi

 
WHRoeder wrote >>

Dear Mr.WHroeder,

Thank you for your informations

I will try sample code ^^

Thank you ^^

Yoshi

 

if(iBarShift(Symbol(),0,OrderCloseTime())) > number of bars you want to wait


this one is safer than Sleep()

 

Dear Mr.Uchiha Itach,

Thank you for your reply !

I like "Naruto" too^^

It will be really nice if you could teach me

where should I put

"if(iBarShift(Symbol(),0,OrderCloseTime())) > 5".

Thank you a lot ^^

Reason: