Discussing the article: "Developing a multi-currency Expert Advisor (Part 12): Developing prop trading level risk manager"

 

Check out the new article: Developing a multi-currency Expert Advisor (Part 12): Developing prop trading level risk manager.

In the EA being developed, we already have a certain mechanism for controlling drawdown. But it is probabilistic in nature, as it is based on the results of testing on historical price data. Therefore, the drawdown can sometimes exceed the maximum expected values (although with a small probability). Let's try to add a mechanism that ensures guaranteed compliance with the specified drawdown level.

Recently, the topic of risk management was considered in the articles Risk manager for manual trading and Risk manager for algorithmic trading. In these articles, the author proposed a programmatic implementation that controls the compliance of various trading parameters with pre-set indicators. For example, if the set loss level for a day, week or month is exceeded, trading is suspended.

The article Take a few lessons from Prop Firms also turned out to be interesting. The author examines the trading requirements imposed by prop trading companies to challenge traders wishing to receive capital for management. Despite the ambiguous attitude towards the activities of such companies, which can be found on various resources dedicated to trading, the use of clear risk management rules is one of the most important components of successful trading. So it would be reasonable to take advantage of the already accumulated experience and implement our own risk manager, using the risk control model used in prop trading companies as a basis.

Author: Yuriy Bykov

 
Awesome work you are doing! Thanks for the article.
 
Thanks for the feedback! We will do our best to continue to keep the bar high.
 

Thanks for the interesting article! Nice work.

If I may, I would like to clarify a couple of logical and technical points:

Do I understand correctly that when controlling risks in the DailyLoss() method, the risk of equity drawdown is not taken into account?

Why do you use macros when working with arrays?

Thanks.

 

Thanks for the feedback!

Правильно я понимаю, что при контроле рисков в методе DailyLoss() не учитывается риск просадки по еквити?

Probably wrong. The DailyLoss() method does not evaluate how big the drawdown was. It only converts the specified maximum drawdown level to the account currency from per cent if necessary. The comparison itself takes place in the CheckDailyLimit() method:

if(m_dailyProfit < -DailyLoss() && CMoney::DepoPart() > 0) { ... }

The value of m_dailyProfit is updated on each tick and is calculated as the difference of the current funds (equity) and the daily level(the maximum of the balance value and the funds at the beginning of the daily period):

m_dailyProfit = m_equity - m_baseDailyLevel;

So it seems that the drawdown on funds is just taken into account. Or did I misunderstand the question?


Why do you use macros when working with arrays?

For compactness of the code. Macros also allow you to pass a code block as a parameter, while when implementing such operations through functions, you cannot pass a code block to functions as a parameter.

 
Yuriy Bykov each tick and is calculated as the difference between the current funds (equity) and the daily level(the maximum of the balance and funds at the beginning of the daily period):

So it seems that the drawdown on funds is just taken into account. Or did I misunderstand the question?


For code compactness. Also, macros allow passing a code block as a parameter, while when implementing such operations through functions, you cannot pass a code block to functions as a parameter.

Thank you very much for your extended answer )) We will wait for new articles! )