You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
but then how to repeat the request to open an order, for example, if there is no bar 8 34 and what would open at 8 35....?!
((Minute()>=33) && (Minute()<=35))
Simplified to the extreme. Set your time by a minute longer than the server's. And run it:
Does this code open your orders at all?
It's working for me.
The whole code
int start()
{
//----
if ((OrdersTotal()==0 && Hour()==21) && (Minute()>=13))
OrderSend(Symbol(),OP_SELL,0.01,Bid,0,Ask+100*Point,Ask-100*Point,"DLSexp",123,0);
Print(GetLastError();
//----
return(0);
}
It always gives out
2012.06.27 22:17:00 wesfsdf EURUSD,M1: 0
PS wesfsdf the name of the EA)
all code
int start()
{
//----
if ((OrdersTotal()==0 && Hour()==21) && (Minute()>=13))
OrderSend(Symbol(),OP_SELL,0.1,Bid,0,Ask+100*Point,Ask-100*Point,"DLSexp",123,0);
Print(GetLastError();
//----
return(0);
}
I get it all the time
2012.06.27 22:17:00 wesfsdf EURUSD,M1: 0
PS wesfsdf the name of the Expert Advisor)
I think there really is a problem with the leverage in the lots, you need to find out which leverage is on the tester...how do you do that...?!
Try running this one. Maybe you have stops to set afterwards.
Where in the OrderSend line
is the return code and error analysis???
I've got it figured out my mistake,
if(OrdersTotal()==0) I had 4 trades open, so it didn't open:) thanks a lot for the help!
One last question
How can i open only one trade with this EA!
Example: open 1 trade either Buy or Sell after closing at TP or Sl then open another trade under the condition,
i.e. if condition 1: then Buy
if condition 2: then Sell and exactly close them...
But what would my trades opened earlier do not close?
But it doesn't close my previously opened trades?!
And your Expert Advisor does not close orders - it does not have a closing mechanism. Your orders are closed by TP or SL.
If the condition OrdersTotal()=0, the opening will take place if there are no orders, i.e., their amount is 0.
If the condition OrdersTotal ()<2, the opening will be, if the number of orders is less than 2.