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.
leon_17: 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'
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 :/
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.
Would really like an answer to my question about the begin parameter in the onCalculate function Or at least to see the code where these situations occur when begin != 0. Thanks!
MisterRight: 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:
При написании индикатора, который использует краткую форму вызова функции OnCalculate(), можно упустить то обстоятельство, что индикатор может рассчитываться не только на ценовых данных, но и на данных другого индикатора (встроенного или пользовательского - не имеет значения). Вы хотите улучшить индикатор, чтобы он правильно считался не только на ценовых данных, но и значениях другого индикатора? В этой статье мы по шагам пройдем все необходимые этапы такой модификации и выведем дополнительные полезные правила для правильного написания индикатора.
This is a question for mql experts. How do I change positions closing marks in EA? I want to have a red arrow to the left on a sell close and a blue arrow to the left on a buy close. Then I would immediately see that it is not the opposite opening, but exactly the closing. I have had it in MT4 and did not know a problem. I would like to change it in MT5. Thank you in advance.
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.
string cookie=NULL,headers;
char post[],result[]; string TXT="";
int res=-1;
//--- to work with the server, you must add the URL "https://www.google.com/finance" //--- the list of allowed URL (Main menu-> Tools-> Settings tab "Advisors"):
cookie="accept-encoding: deflate";
string google_url="https://ec.forexprostools.com/?columns=exc_currency,exc_importance&importance=1,2,3&calType=week&timeZone=15&lang=1";
//--- ResetLastError();
//--- download html-pagesint timeout=500/*0*/; //--- timeout less than 1,000 (1 sec.) is insufficient at a low speed of the Internetint max_try=5;
int n=0;
while(res==-1)
{
res=WebRequest("GET",google_url,cookie,NULL,timeout,post,0,result,headers);
...
}
This is what's coming in:
"<html><head><title> 406 Not Acceptable</title></head><body><center><h1> 406 Not Acceptable</h1></center><hr><center> nginx/1.16.1</center></body></html>" (length: 149)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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: