Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1295
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
Please, advise how to calculate closed orders in history. I tried it like this:
It gives out some nonsense, much more than closed orders.
What is the status? FILLED, CANCELED, EXPIRED, REJECTED?
What is the status? FILLED, CANCELED, EXPIRED, REJECTED?
I don't know what you mean. In the help, it is written as follows:
Returns the number of orders in the history. Before calling the HistoryOrdersTotal() function, you need to get the history of deals and orders, using theHistorySelect() orHistorySelectByPosition() functions.
There is nothing about any status.
Can you tell me what to use to count closed orders in history. I tried it like this:
It gives out some nonsense, much more than closed orders.
Stay out of warrants. Work with the DREAMS. \
Reference:
Be sure to read the entireTransaction Properties section and see what properties a transaction can have. You specifically need the'DEAL_ENTRY_OUT' property.
ENUM_DEAL_ENTRY
Identifier
Description
DEAL_ENTRY_IN
Market entry
DEAL_ENTRY_OUT
Market exit
DEAL_ENTRY_INOUT
U-turn
DEAL_ENTRY_OUT_BY
Close counter position
Now your algorithm is as follows:
HistorySelect -> loop through all trades -> get deal properties -> summarise trades 'DEAL_ENTRY_OUT'
Stay out of warrants. Work with the DREAMS. \
Reference:
Be sure to read the entireTransaction Properties section and see what properties a transaction can have. You specifically need the'DEAL_ENTRY_OUT' property
ENUM_DEAL_ENTRY
Identifier
Description
DEAL_ENTRY_IN
Market entry
DEAL_ENTRY_OUT
Market exit
DEAL_ENTRY_INOUT
U-turn
DEAL_ENTRY_OUT_BY
Close counter position
Now your algorithm is as follows:
HistorySelect -> loop through all trades -> get deal properties -> summarise trades 'DEAL_ENTRY_OUT'
Thank you! I'm still confused about the division of these concepts: position, order, deal... Especially between an order and a deal (HistoryOrdersTotal and HistoryDealsTotal return the same values). And it turns out they also have to be manually counted in the history :/
Stay out of warrants. Work with the DREAMS. \
Reference:
Be sure to read the entireTransaction Properties section and see what properties a transaction can have. You specifically need the'DEAL_ENTRY_OUT' property.
ENUM_DEAL_ENTRY
Identifier
Description
DEAL_ENTRY_IN
Market entry
DEAL_ENTRY_OUT
Market exit
DEAL_ENTRY_INOUT
U-turn
DEAL_ENTRY_OUT_BY
Close counter position
Now your algorithm is as follows:
HistorySelect -> loop through all trades -> get deal properties -> summarise trades 'DEAL_ENTRY_OUT'.
This is if you are not FORTS. Or else clearing is added.
Or at least to see the code where these situations occur when begin != 0.
Thanks!
I would really like to get an answer to my question about the begin parameter in the onCalculate function
Or at least to see the code where such situations occur when begin != 0.
Thank you!
The article'Indicator by Indicator in MQL5'. For your convenience, after opening the article in your browser, I recommend to press 'Ctrl' + 'F' and type 'begin' in the search field. All occurrences of the word 'begin' will now be highlighted in the article:
Ctrl+F I use to search the built-in help, but I can't always find it.
There is an indicator for downloading news. A sample code from it is below. WebRequest returns 406. should I specify a different cookie or what could be the problem? Six months ago everything was working.
This is what's coming in: