# Thread: Ten Stochs Wave EA

1. Originally Posted by funyoo
thank you very much for advice
i tried to do, but it still no good. I don't understand why, what is reason.
Logic seems correct but acting bad. so strange is that open trade buy altought one of stoch is down of levelforopen.

and if turn on close by stoch -True ,condition for close is ok(cross) , trade is close and then open another altought using string stopbuy and maxtradeperbar

It's night, i must go to sleep
goodnight

2. Originally Posted by przem81621
thank you very much for advice
i tried to do, but it still no good. I don't understand why, what is reason.
Logic seems correct but acting bad. so strange is that open trade buy altought one of stoch is down of levelforopen.

and if turn on close by stoch -True ,condition for close is ok(cross) , trade is close and then open another altought using string stopbuy and maxtradeperbar

It's night, i must go to sleep
goodnight
I have updated the guide :

3. Originally Posted by funyoo
I have updated the guide :

Seems that it's working
I will try
thanksgreat

4. welcome tonight
it's good - 1 trade for bar.

But I want to do one more ,please give me a idea how to do it.

1 bar - condition for open is good and ea open trade
2 bar - trade closed by any reason: Tp, SL or other , but condition for open is still good, so ea open next trade.
I don't want that second open, but how to stop it?

5. Originally Posted by przem81621
welcome tonight
it's good - 1 trade for bar.

But I want to do one more ,please give me a idea how to do it.

1 bar - condition for open is good and ea open trade
2 bar - trade closed by any reason: Tp, SL or other , but condition for open is still good, so ea open next trade.
I don't want that second open, but how to stop it?
Use a sleep function after the first trade : Sleep(X);

The X is an integer, knowing that 10000 = 10 seconds.

6. Originally Posted by funyoo
Use a sleep function after the first trade : Sleep(X);

The X is an integer, knowing that 10000 = 10 seconds.
thanks
so , if I want to stop for 5 min x= 300000 ?

and please tell , sleep in this place will be correct ?
if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){if (CB==1){OrderClose(OrderTicket(),OrderLots(),Bid,S lip,Red);Sleep(x); return(0);}}

7. Originally Posted by przem81621
thanks
so , if I want to stop for 5 min x= 300000 ?
Correct.

Originally Posted by przem81621
and please tell , sleep in this place will be correct ?
if(OrderType()==OP_BUY && OrderSymbol()==Symbol() && ((OrderMagicNumber()==Magic) || Magic==0)){if (CB==1){OrderClose(OrderTicket(),OrderLots(),Bid,S lip,Red);Sleep(x); return(0);}}
Exact.

8. Originally Posted by funyoo
Correct.
Exact.
thanks
i'm trying do some changes, but i'm begginer
so, i 've two problems to solve.
Would you be kind Mr.Funnyoo to help ?

1.ea gives the same results with sleep and without, so I did it wrong, but not know where.
2.I've add to use additional stoch for close trade. it work when cross signal and main line, typical.
After that (closed by stoch or if TP ) to not open next trade I want to move high level for open buy=100
and the same down level for sell=0.This levels should be stay untill all signal stoch fall down begining level-80 or grow up begining level - 20
it should be solve problem, but i can't do it correctly.

there is results what i've done

9. 1. Unfortunately, the sleep function doesn't work in backtesting.
2. Good question, I don't see how to do that.

10. Originally Posted by funyoo
1. Unfortunately, the sleep function doesn't work in backtesting.
2. Good question, I don't see how to do that.

i know someone use slip function instead of sleep function