You seem to be confused. Here is a look and read carefully the comments to each line:
I hope everything will be clear now. As for the variable, I wrote to you in another thread that it can be called either position or m_position, etc. etc.
And please ask questions in this thread, it will be easier to get help.
Regards, Vladimir.
Yes, sorry, not CTrade, but CPositionInfo. But still you can't write instead of m_position position or " pos, posit, k_pos, k_position, etc. etc. " as you write. It is m_position (CPositionInfo m_position;) that is stuffed in the class.
You can write any name of the variable, the main thing is that further in the code it should have the same name. Example:
#include <Trade\PositionInfo.mqh> // включим файл PositionInfo.mqh
CPositionInfo k_pos; // объявим переменную, например, k_pos
// Далее в коде должны использовать только это название переменной
for(int i=PositionsTotal()-1;i>=0;i--)
if(k_pos.SelectByIndex(i)) // selects the position by index for further access to its propertiesif(k_pos.Symbol()==m_symbol.Name() && k_pos.Magic()==m_magic)
{
if(k_pos.PositionType()==POSITION_TYPE_BUY)
buys=true;
if(k_pos.PositionType()==POSITION_TYPE_SELL)
sells=true;
if(buys && sells)
return;
}
You can write any name of the variable, the main thing is that further in the code it should have the same name. Example:
Any other questions?
Regards, Vladimir.
All these prefixes of variable names, for example "m_", mean belonging to a certain class, from the word "member" - a member of the class. That is, outside the class you don't have to add them to variable names - they are not members of the class, they are members of the programme. All the more so when they are global - there is another prefix here. For example, if you look at MetaQuotes sources, you will see that global variables are prefixed with the prefix "Ext" - external, external.... If you want to use some prefix to your global variables in the form of "letter_", then "g_" - from global.
Терминал МetaTrader 5 дает новые возможности для оптимизации параметров создаваемых экспертов. Кроме уже имеющихся в тестере критериев оптимизации, разработчики получили инструмент для создания собственных критериев. Это открывает поистине безграничные возможности в тестировании и оптимизации экспертов. В статье рассматриваются практические способы построения таких критериев - как простых, так и достаточно сложных.
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.
You seem to be confused. Here is a look and read carefully the comments to each line:
I hope everything will be clear now. As for the variable, I wrote to you in another thread that it can be called either position or m_position, etc. etc.
And please ask questions in this thread, it will be easier to get help.
Regards, Vladimir.
Yes, sorry, not CTrade, but CPositionInfo. But still you can't write instead of m_position position or " pos, posit, k_pos, k_position, etc. etc. " as you write. It is m_position (CPositionInfo m_position;) that is stuffed in the class.
You can write any name of the variable, the main thing is that further in the code it should have the same name. Example:
Any other questions?
Regards, Vladimir.
You can write any name of the variable, the main thing is that further in the code it should have the same name. Example:
Any other questions?
Regards, Vladimir.
All these prefixes of variable names, for example "m_", mean belonging to a certain class, from the word "member" - a member of the class. That is, outside the class you don't have to add them to variable names - they are not members of the class, they are members of the programme. All the more so when they are global - there is another prefix here. For example, if you look at MetaQuotes sources, you will see that global variables are prefixed with the prefix "Ext" - external, external.... If you want to use some prefix to your global variables in the form of "letter_", then "g_" - from global.
Is the percentage of lost capital on the trail stop in the strategy tester taken into account as a minus to the drawdown?
i.e. if orders are closed with profit but not at the most favourable price, will the drawdown be higher or lower in this case?
Or does the drawdown only take into account the initial capital drawn down?
i.e. if orders are closed with profit but not at the most favourable price, will the drawdown be higher or lower in this case?
Or does the drawdown only take into account the initial capital drawn down?
The drawdown of balance and equity is taken into account from the maximum balance and from the maximum equity.
Sorry for the stupid question, what does equity mean in this case?
Equity is an unrecorded financial result.
Thank you, but can anyone tell me how to take into account in this class
https://www.mql5.com/ru/articles/286
or in other ways?
and also profit in the tester is calculated plus capital or only profit separately? what is the final figure I mean?
Thank you, but can anyone tell me how to account for this class.
https://www.mql5.com/ru/articles/286
or in other ways?
and also profit in the tester is calculated plus capital or only profit separately? what is the final figure I mean?
Here you can find out what standard figures you can get after passing in the strategy tester.
The initial balance is not taken into account in the "profit" figure.