M1 chart missing bars - page 4

 
DanLett:
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....?!
Set the range, for example - do not open the order at 34 minutes, but from 33rd to 35th, for example.

((Minute()>=33) && (Minute()<=35))
 
DanLett:
Does it open or not?
 
DmitriyN:

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)


 
DanLett:

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)


In the tester there are no errors, it is clear, you need to look at the log of the real (better the demo first, because the robot is losing cool, do not hurry up with the real).
 
I think there really is a problem with the leverage in the lots, we need to find out which leverage is on the tester...how do I do that...?!
 
DanLett:
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.

int start()
{
if (OrdersTotal()==0)

OrderSend(Symbol(),OP_SELL,0.01,Bid,0,0,0,"DLSexp",123,0);
Print(GetLastError());

return(0);

}
 
Holy shit...
Where in the OrderSend line
is the return code and error analysis???
 
jartmailru:
What's there to analyse, there's an error of 130 - clearly.
 

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?

 
DanLett:

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.

Reason: