M1 chart missing bars - page 2

 

I trade manually strictly according to this algorithm and it works...seriously

2 days on 6 times recorded all profits except the 1st trade.

Naturally i will modify it but at first i think i will trade this way .

Plz help me to understand why it does not trade.

 
And then, what time is it on your watch? What does Hour() show?
I don't know about you, but I have an hour difference.
 
I have the same per hour, i.e. for example I have 22 00msk in MT4 21 00
 

It's not even aboutHour() .

It's that at the right time the EA just doesn't open trades... it passes by, but in the tester it goes strictly to profit (everything works)
 
It works for me on real as well. If your broker has five digits, i.e. a quote of 5 decimal places on EURUSD, then Tp=340, Sl=550
 
DanLett:
And in the tester it may not always be, because you have strict conditions like Minute()==bM3 . And if there is no such bar? In real life or on demo, the connection can easily be lost.
Check the checkboxes here: Top menu/Service/Settings/Advisors.
 

And then atTp=340, Sl=550 in the tester opened trades...

4 digits (if I am not mistaken) :)

 

Hang on, let me get this straight...

1. In the EA settings there must be a tick in front of "Allow EA to trade".

2. Check the leverage in the tester and in the real / demo, if the leverage in the tester is 500, and in real 100, the free margin may not be enough to open a deal.

3. Insert after OrderSend(); Print(GetLastError()) line;

Look at the log to see what error is occurring, and then use this as a jumping-off point. When debugging the Expert Advisor, insert this line in doubtful places, you can erase or comment it later.

 
DmitriyN:
And it may not always work in the tester, because you have strict conditions like Minute()==bM3 . But what if there is no such bar? In real life or on demo may easily lose connection.
Check the checkboxes here: Top menu/Service/Settings/Advisors.


It is allowed to trade by itself, it is checked

Are you saying that my code works for you?!

 

More:

   if((OrdersTotal()==0 && Hour()==sH && Minute()==sM)||(OrdersTotal()==0 && Hour()==sH2 && Minute()==sM2)||
    (OrdersTotal()==0 && Hour()==sH3 && Minute()==sM3))
Why do you compare OrdersTotal()==0 several times?
It's enough to do it once.