[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 428

 
Dimka-novitsek:


Yes, it's just a check to see how it works, all that's not clear. The first thing I do is to place a pending bylimit order, 20 pips above the price. Then I immediately check it with OrderType,

and it turns out it's not zero. It's zero!!!!. How can it be zero, it's a bylimit!!! Besides, it's not deleted either, it says some kind of error. In addition, all subsequent orders are corrected as 4 or 5, are deleted normally, behave normally.

Moreover, even the orders opened above the first one behave normally, with the same lot, location, in short, all in one! All except the first.

is that the part you're talking about?

       tiket= OrderSend( Symbol(), OP_BUYSTOP,  volume*A, Price +otstup*Point, Point* 3, R1, Price+takeprofit*Point+otstup*Point, "OP_BUYSTOP", 1000,  expiration, Red); 
   Alert ("OP_BUYSTOP", GetLastError( )); 
   
   for(int i=OrdersTotal();i>0;i--){Alert ("i", i);OrderSelect(i,SELECT_BY_POS );Alert ("OrderType( )OP_BUYSTOP", OrderType( ));
   OrderDelete(OrderTicket( )) ; Alert ("OrderDelete-vseOP_BUYSTOP",  GetLastError( ) );}

It has been pointed out to you repeatedly that the expression

for(int i=OrdersTotal();i>0;i--)

WRONG

let's consider for one order

(i = 1; i>0; i--) - there will be one step for i = 1, well

OrderSelect(i,SELECT_BY_POS )


choose an order with position 1 in the list(does NOT exist) there is only one order and its position is NULL

 
Good afternoon, can you advise how, after checking the conditions in the init() function, to terminate the EA?
 
Thanks!!!! Yeah, I didn't get it!!!
 

Dear Professionals!

Could you please tell me how to fill in the Server SMTP, etc. fields in the Metatrader 4 mail settings, so that it can send emails to email.

 
Dophin:
I apologise for the duplication - the opera is glitchy

Opera has nothing to do with it. Just hands and patience. One is in a hurry, the other is lacking
 
Dophin:

Dear Professionals!

Could you please tell me how to fill in the Server SMTP, etc. fields in the Metatrader 4 mail settings, so that it can send emails to email.


https://www.mql5.com/ru/search?keyword=SMTP
 

Good day to all!

Here is the problem. When I tried to open an order in my log, I got the message "Requote 1.4589/1.4591 to open buy 0.01 EURUSD at 1.4587". As a result, the order was not opened. Please advise how to fight with this.

Thank you in advance.

 
 
demlin:

Good day to all!

Here is the problem. When I tried to open an order in my log, I got the message "Requote 1.4589/1.4591 to open buy 0.01 EURUSD at 1.4587". As a result, the order was not opened. Please advise how to fight with this.

Thank you in advance.


What's the slipage?
 
Transferred.
berezhnuy:

Help me make up a function. I have a signal, but it's duplicated: How do I make a function or something like that to determine if it's the same signal or a new one?

p1>p3 && p2>p1 && (High[1]>(p2+p1)/2)

dimeon:
int schetchik=0;
int start()
if( p1>p3 && p2>p1 && (High[1]>(p2+p1)/2 && schetchik==0) {любое действие; schetchik++;}
Условие для обнуления счетчика; Например: 
if (OrdersTotal==0) schetchik=0;