Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1299

 
Александр:

If there are no open orders, then let it go out. Or? I don't understand...

It reads - If selected order is not market order (order with index i) then we should continue with continue - without further check. Continuity - finish iteration of the cycle here and go to Cycle 3 expression. And break, exit the cycle, and if the 2nd order is pending(pending orders are not marketable), then the cycle will end with break, and subsequent orders will not be checked.

colour has not triggered

// after two slashes comment)))

Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Приказы на проведение торговых операций оформляются ордерами. Каждый ордер имеет множество свойств для чтения, информацию по ним можно получать с помощью функций Идентификатор позиции, который ставится на ордере при его исполнении. Каждый исполненный ордер порождает сделку, которая открывает новую или изменяет уже существующую позицию...
 

Please explain the difference

for(int pos=0;pos<OrdersTotal();pos++)
for(int pos=OrdersTotal()-1;pos>=0;pos--)
 
MakarFX:

Please explain the difference

print out the values of the variables, it will be clearer than an explanation

 
MakarFX:

Please explain the difference

If you do not delete the selected orders, then nothing. If you delete, then skip the order, then in the first option you will skip the next order after the deleted one. Its index will become equal to the index of the deleted order.
 
Fast235:

print out the values of the variables, it will be clearer than an explanation

How to print them out?
 
Valeriy Yastremskiy:
If you do not delete the selected orders, then nothing at all. If you delete, then skip the order, the first option will skip the next order after the deleted order. Its index will become equal to the index of the deleted order.

For deleting orders, this option is better

for(int pos=OrdersTotal()-1;pos>=0;pos--)
 
MakarFX:

For deleting orders, this option is better

put everywhere

Print("File: "__FILE__,": str = ",__LINE__,". Error code = ",_LastError);
 
MakarFX:

For the deletion of orders this option is better

Valeriy Yastremskiy:

This reads - If the selected order is not a market order (order with index i) then we have to continue with the continue - without further checking. Continuity - end iteration of the cycle here and go to Cycle 3 Expression. And break, exit the cycle, and if the 2nd order is pending(pending orders are not marketable), then the cycle will end with break, and subsequent orders will not be checked.

colour has not triggered

// after two slashes)))

Thanks for the reply! I always thought that OrderSelect

MODE_TRADES (default) - the order is selected among open and pending orders,

 
ANDREY:

That's exactly what I did. So I can be confident about the quality of their (Alpari's) quotes....
One more thing please. I just started to learn MT5. I realised that if I choose REAL TICKS based modelling then when I test my Expert Advisor, I get REAL spread at trade close, i.e. like when I trade on a real account.

QUESTION 1. With this simulation method, is the slippage at market close also considered on the REAL account?

QUESTION 2 If the simulation method is all ticks, is the spread considered as on REAL account?

QUESTION 3 If all ticks are simulated using simulation method, slippage is considered like on REAL account
Thanks for your help
.

1. In mt5 the spread is coded. I.e. mt4 coding + another spread. So my actions there in mt5 are very limited.

2. I try to write Expert Advisors with sufficient price Open because I haven't learned how to deal with terminal problems concerning quality. I have not managed to do it. In general, it is a real problem. Quotes. I would ask someone who knows about them. I do not know who.

 
Александр:

1. In mt5 the spread is built into the coding. I.e. mt4 coding + more spread. So there, in mt5, my actions are very limited.

2. I try to write Expert Advisors with sufficient price Open because I haven't learned how to deal with terminal problems concerning quality. I have not managed to do it. In general, it is a real problem. Quotes. I would ask someone who knows about them. I do not know who.

The spread can be closed, i.e. we can add some value to the bid price. But how can we add the size of this value? In real ticks the spread is floating, i.e. its size is unknown. And therefore it cannot be closed on real ticks ..... in my professional opinion, but purely logically. It is probably possible to sew only what is EXACTLY known FOREVER.