Questions from Beginners MQL5 MT5 MetaTrader 5 - page 579

 
Artyom Trishkin:
Do you use mql4? If so, the candlestick number can be read by its time recorded in the structure. iBarShift() will help you.

Now I am using MQL4 editor, but I want to use MQL5 right away. As I understood from the reference, the difference was removed in the latest builds, and the compiler is also unified.

I'm interested in MQL5 because our market uses it and it looks faster.

 
Andrey Koldorkin:

At the moment I am using MQL4 editor, but I want to start writing in MQL5. As I understood from the reference, the difference was removed in the latest builds, and the compiler is also unified.

I'm more interested in MQL5 because our stock exchange uses it, and it looks faster somehow.

In this case, iBarShift() is rejected and time is used to search for the nearest low. All this is already written in the structure.
 
Andrey Koldorkin:
need....

You are completely confused by these cycles, comparisons and structures. Start from the beginning, with the simplest one. Think about how you would solve the problem manually, without any programming. Let's say you have a pile of digits (let's say ten digits). Your task is to arrange all the digits into piles, so that each pile contains only the same digits (a bunch of nines, a bunch of fives, a bunch of threes, etc.):


How would you solve this problem?

Would you need to sort this pile in order first, so that you could then decompose it into smaller piles of identical prices?

 
Is it possible to distinguish between an order closed manually and an order closed by stoploss/takeprofit? All I see in the discussions is "look in Order Comment", but it is not clear what the broker will write there.
 
Arkady Segal:
Can I tell the difference between a manually closed order and a stoploss/takeprofit order?
Yes. By the order comment. An order closed by Stop Loss or Take Profit has these sub lines in its commentary: "[sl", "[tp"
 

Artyom Trishkin:
Да. По комментарию ордера. Закрытый по стоплосс или тейкпрофит имеет в комментарии такие подстроки: "[sl", "[tp"

Thank you

 
Vasiliy Sokolov:

You are completely confused by these cycles, comparisons and structures. Start from the beginning, with the simplest one. Think about how you would solve the problem manually, without any programming. Let's say you have a pile of digits (let's say ten digits). Your task is to arrange all the digits into piles, so that each pile contains only the same digits (a bunch of nines, a bunch of fives, a bunch of threes, etc.):


How would you solve this problem?

Would you need to sort this pile in order first, so that you could then decompose it into smaller piles of the same prices?

I agree.

Artyom Trishkin:
Well then we refuse from iBarShift() and use time to find the nearest low. All this is already written in structure.

Artem,

I understand correctly, when we write an array of matching candlesticks in the second loop, the loop is closed by curly braces and so is the second loop. And I should already start processing operations of this array within the On Start () function ?

 
Andrey Koldorkin:

I agree.

Artem,

I understand correctly, that after we have written an array of matching candlesticks in the second loop, the loop is closed by curly braces and so is the second loop. And I should already start operations on this array within On Start () function ?

I will answer you later. I am not at home, no editor at hand.
 
Artyom Trishkin:
I'll answer later. I'm not at home, I don't have an editor handy.
OK. I'll wait.
 
Andrey Koldorkin:
OK. I'll wait.
Well, while I'm on my mobile, I'll say this: where in the code the alert and the loop with the print, the structure is already filled in.