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

 
Ievgen Kurbatov:

hello! can you tell me if it's realistic to parse data from herehttps://www1.oanda.com/lang/ru/forex-trading/analysis/forex-order-book


so that the data can be collected in Excel for further calculations?

see oanda api - if I am not mistaken in the picture it is PositionBook

 
Artyom Trishkin:

ChartNavigate()

It works, but there are constant "glitches". The graph is positioned n times and then jumps to the end. And I have to rewind manually to see the found figure. Is it supposed to be like that or is it an error of MT?

There is no other way to position the chart?

 
Сергей Таболин:

It works, but there are constant "glitches". The graph is positioned n times and then jumps to the end. And I have to rewind manually to see the found figure. Is it supposed to be like that or is it an error of MT?

There is no other way to position the chart?

You have to disable graph autoscrolling. And remember that it is an asynchronous command.

 

Good evening.

Can you please tell me if it is appropriate to compare the order opening sequence from the history by ticket number? (As it is done in known video tutorials)

Doubts arose because OrderSend() returns int type, which is not infinite, and, I assume, is reset at some point.

 
Andrey Sokolov:

Good evening.

Can you please tell me if it is appropriate to compare the order opening sequence from the history by ticket number? (As it is done in known video tutorials)

Doubts arose because OrderSend() returns int type, which is not infinite, and, I assume, is reset at some point.

in general, it is incorrect. It's just historically so and so far it's supported. Int overflow is a tricky thing :-)

Besides overflow, it's a security-bug, I think that in some future releases it will be "broken" and all IDs will become unpredictable.

for saving the sequence there are timestamps, if they are not enough magic and comments will help

PS/ by the way even in 4 it's possible situations when later order will get lower ticket without integer overflow. For example two EAs working simultaneously on different charts in the same strategy.

 
If I put a parabolic on M5 with the standard parameters, how can I set another parabolic on it to display the parabolic from the M15 timeframe?
 
Andrey Sokolov:

Good evening.

Can you please tell me if it is appropriate to compare the order opening sequence from the history by ticket number? (As it is done in known video tutorials)

Doubts arose because OrderSend() returns int type, which is not infinite, and, I assume, is reset at some point.

No, it is not. Consistency is not guaranteed in order of increasing ticket numbers.

A chain of orders

MarketBuy #1, MarketBuy #2, PendingBuyLimit #3, MarketBuy #4, PendingSellLimit #5, MarketSell #6, MarketSell #7, MarketBuy #8

can have a sequence of positions

Buy #1, Buy #2, Buy #4, Sell #6, Sell #7, Sell #5, Buy #3, Buy #8

 

I'm writing this code by looping through the history. I take only the most recently closed trade

string stroka = OrderComment();
string s = StringGetCharacter(stroka,1);
string s_2 = StringGetCharacter(stroka,2);
string s_3 = StringGetCharacter(stroka,3);
string s_4 = StringGetCharacter(stroka,4);
string s_5 = StringGetCharacter(stroka,5);
Comment(stroka,"  ",s,"  ",s_2,"  ",s_3,"  ",s_4,"  ",s_5);                         

Why does the symbol return as a number?


 
Nikita Chernyshov:

I'm writing this code by looping through the history. I take only the most recently closed trade

Why does the symbol return as a number?


Because that's what you do- you get a code for every character in the string, not starting with the first, and output the codes in the commentary on the chart.

Документация по MQL5: Строковые функции / StringGetCharacter
Документация по MQL5: Строковые функции / StringGetCharacter
  • www.mql5.com
Строковые функции / StringGetCharacter - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Artyom Trishkin:

Because that's exactly what you're doing - getting the code of every character in the string, not starting with the first, and displaying the resulting codes in the comment on the chart.

Yeah. I'm in full meltdown. Artem, thank you very much.