Questions from Beginners MQL5 MT5 MetaTrader 5 - page 199

 
StrangerNet:

Good afternoon, why is the function not defined (message 'OrderModify' - function not defined):

There's something else wrong with the curly braces.
#include <Trade\Trade.mqh>
Ctrade trade;//-- глобально объявить
trade.OrderModify(tik,ORDER_PRICE_OPEN,NormalizeDouble(Bid-_Point*(TrailingStop/10),5),ORDER_TP,ORDER_TYPE_TIME,ORDER_TIME_EXPIRATION);
 
barabashkakvn:

Have you connected the CTrade class?

StrangerNet:
Yes, it is connected.

First, in MetaEditor apply code styler (Ctrl+,). After that deal with missing curly braces ( } ).

ORDER_TYPE_TIME must be one of the constants:

ENUM_ORDER_TYPE_TIME

Identifier

Description

ORDER_TIME_GTC

Order will be in the queue until it is removed

ORDER_TIME_DAY

Order will be valid for the current trading day only

ORDER_TIME_SPECIFIED

Order will be valid until the expiry date

ORDER_TIME_SPECIFIED_DAY

The order will be in effect until 00:00 on the specified date. If that time does not fall on a trading session, the expiration will be at the nearest trading time.

 
lewvik:

Thank you helps)))))

 
barabashkakvn:

First, in MetaEditor apply the code styler (Ctrl+,). Then deal with the missing closing curly braces ( } ).

ORDER_TYPE_TIME must be one of the constants:

ENUM_ORDER_TYPE_TIME

Identifier

Description

ORDER_TIME_GTC

Order will be in the queue until it is removed

ORDER_TIME_DAY

Order will be valid for the current trading day only

ORDER_TIME_SPECIFIED

Order will be valid until the expiry date

ORDER_TIME_SPECIFIED_DAY

The order will be in effect until 00:00 on the specified date. If that time does not fall on a trading session, the expiration will be at the nearest trading time.

There is no curly bracket because continuation is going on there, I did not put it all out as it was not relevant))))) I have already corrected the list, thank you! )))))
 
barabashkakvn:

First, in MetaEditor, apply a code styliser (Ctrl+,).

By the way, I have this command for some reason puts the header of the function)))))
 
barabashkakvn:

First, in MetaEditor apply the code styler (Ctrl+,). Afterwards, deal with the missing closing curly braces ( } ).

This bad habit of making brackets as short as possible is a real problem for beginners. When I was studying MQL4, I tried to put them on one line (in order not to disturb). I' ve tried to put them in one line (that's why they don't get in the way)))) It took me long time to understand where they came from.
 
StrangerNet:
By the way I have this command for some reason puts the header of the function)))))

Ctrl and <

or in menu service => styler

 
lewvik:

Ctrl and <

or in the service menu => styling tool

That's the one I was looking for))))
 

What is the status of the order if it is closed by a MetaTrader when the SL or TP condition is met? And will it be on the ticket at all?

 
StrangerNet:

What is the status of the order if it is closed by a MetaTrader when the SL or TP condition is met? And will it be on the ticket at all?

https://www.mql5.com/ru/docs/trading/historyorderselect
Reason: