Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1050
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How do I add minutes to the advisor's block of hours?
How do I add minutes to the hourly block of an EA?
High Low Strategy On Time 2:
The bool TimeControl() is a function responsible for checking the time. It can work in two states: both dates within a day or dates over a day.
Please advise,
In MQL5 I need to close half of a position, but I need to check if half of the position is less than the minimum lot and then close the whole volume, is that correct?
Please advise,
In MQL5 I need to close half of a position, but I need to check if half of the position is less than the minimum lot, then close the whole volume, is that correct?
Maybe it is easier to check before dividing, if the lot is less than 2x the minimum, then there is no need to bother the terminal?
I can't pass the test for the marketplace, it returns an error, but there is no error in the report
What to do?
can't pass the test for the marketplace, it returns an error, but there is no error in the report
What to do?
How do I get the closing price of an order (trade, position - anything at all)?
For orders, only ORDER_PRICE_OPEN is available, but ORDER_PRICE_CLOSE is not.
The positions have only POSITION_PRICE_OPEN.
The trades don't have anything abstract at all: DEAL_PRICE.
Googled the forum, didn't find it.
How do I get the closing price of an order (trade, position - anything at all)?
For orders, only ORDER_PRICE_OPEN is available, but ORDER_PRICE_CLOSE is not.
The positions have only POSITION_PRICE_OPEN.
The trades don't have anything abstract at all: DEAL_PRICE.
I searched through the forum, didn't find it.
To make understanding and working in MQL5 easier:
1. ***
2. If you need a closing price, you cannot do without accessing the trading history. TheHistorySelect is responsible for requesting the trading history
3. The example of working with the history, with output of information either in a file or in the "Experts" tab, is in theHistory Deals and Orders code
To understand what deal this is, you need to know
ENUM_DEAL_ENTRY-direction of the deal - entry into the market, exit from the market or reversal
ENUM_DEAL_ENTRY
Identifier
Description
DEAL_ENTRY_IN
Entry into market
DEAL_ENTRY_OUT
Market exit
DEAL_ENTRY_INOUT
U-turn
DEAL_ENTRY_OUT_BY
Close counter position
ENUM_DEAL_TYPE-Type of deal
ENUM_DEAL_TYPE
Identifier
Description
DEAL_TYPE_BUY
Buy
***
These are the basics.
Thanks for the reply, I've looked at both the documentation and your example, but still haven't found how to get a parameter similar to OrderClosePrice() in MT4.
Thanks for the reply, I looked at both the documentation and your example but still couldn't find how to get a parameter similar to OrderClosePrice() in MT4.
alternatively openhttps://www.mql5.com/ru/code/16006
and look at@fxsaber's implementation
or just connect the above library and transfer the code from MT4 to MT5, in 99% of cases you won't have to tweak anything, everything will work the same as in MT4