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

 
Artyom Trishkin:
In 5 an order !=position. And a deal. An order (order) generates a trade. And a trade generates a position, either changing it or closing it.

I see...

It's so complicated, MT4 is so much simpler

 
MakarFX:

I see...

How complicated it is, in MT4 it's much simpler

In fact, it's in four that everything is simplified for "caribasses". In five, however, everything is more reasonable - if a person sends a trade order to the server, it is a trade order - an order (read what the order is at least by google-translator). After we have ordered the broker to open a position, this order is checked by the server for correctness of parameters and is either rejected (in case of incorrect parameters) or accepted and placed in the queue. Once your order has been executed, a deal (the fact of execution of your order) is executed. And the deal already leads to appearance, change or closing of a position.

Order --> Trade --> Result (position / its change / its closing)

 
Artyom Trishkin:

In fact, everything in four is simplified for "Caribas". In five, however, everything is more clever - if a person sends a trade order to the server, then this is a trade order - an order (at least Google Translate and read what an order is). After we have ordered the broker to open a position, this order is checked by the server for correctness of parameters and is either rejected (in case of incorrect parameters) or accepted and placed in the queue. Once your order has been executed, a deal (the fact of execution of your order) is executed. And the deal already leads to appearance, change or closing of a position.

Order --> Trade --> Result (position / its change / its close).

Yes, to close a position to sell, you need a buy order instead of a simple OrderClose()

 
MakarFX:

Yes, to close a sell position you need a buy order instead of a simple OrderClose()

And who showed you the insides of a quadruple OrderClose()? Do you think it's the same there?

Five gave everyone access to a lower level - as people asked for. And now people have started saying it's complicated...

Well, if it's complicated - they gave me a standard library, where everything is already implemented - just work in the same style as in Four. But again, is something wrong?

Trading methods in SB is the same (I would assume so) as the trading functions in 4. But in fully open source code. Wrong again?

 
HistorySelectByPosition() does not give history with the selected magician. It does, but not positions, but orders or deals, I don't know what. Something is wrong here.
 
Artyom Trishkin:

Who showed you the insides of the quadruple OrderClose()? Don't you think it's the same there?

In Five they gave everyone access to a lower level - as people asked for. And now people have started saying it's complicated...

Well, if it's complicated - they gave me a standard library, where everything is already implemented - just work in the same style as in Four. But again, is something wrong?

The trade methods in SB is the same (I would assume so) as the trade functions in 4. But in fully open source code. Wrong again?

When I wrote "how complicated it is", I meant complicated for me. I am not a programmer and I have mastered MT4 to the level I need. If the situation forces me, I will switch to MT5)
 
MakarFX:
When I wrote "how complicated it is", I meant complicated for me. I am not a programmer, and I have mastered MT4 on the level I need. If the situation forces me, I'll have to switch to MT5)

It will. If you are going to write for MetaTrader, you will have to upgrade to 5

 
MakarFX:
When I wrote "how complicated everything is" I meant complicated for me. I'm not a programmer and I have mastered MT4 on the level I need. If the situation forces me, I will switch to MT5)
if(HistoryOrderSelect(ticket))
        {
         if(HistoryOrderGetInteger(ticket,ORDER_MAGIC)==Magic

It doesn't work because you have to load history with HistorySelectByPosition(). By time or by identifiers. But nothing works with Magik.

Besides, we can't understand which history is being loaded. The order positions or the deal positions. We need to define the POSITION which was closed by SL. Actually, we may use an order but we have no order load here which means we have no orders and no deals either.

 
Amon1953:

It doesn't work because you have to load history with HistorySelectByPosition(). By time or by identifiers. But nothing works with Magik.

Besides, we can't understand which history is being loaded. The order positions or the deal positions. We need to define the POSITION which was closed by SL. Actually, we may open an order but we don't have orders and hence no deals.

Art gave us a good link here

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

Wanted to print the chart on a colour printer with the 4K terminal's regular printout. It didn't work. It prints black and white, although the printer settings show a colour photo. The preview is also black and white. Does it print in black and white only?

Printscreen and save the picture as, of course, is a solution, but not good.

Reason: