Experts: Risk Manager - page 3

 
Fixed a bug related to year change that occurred with users MrShuM and mairus. The code is being checked by a moderator.
 

Guys, tell me what error is generated during compilation?

Kudos to the author!


can't open "C:\Users\Oleg\AppData\Roaming\MetaQuotes\Terminal\FE0E65DDB0B7B7B40DE125080872C34D61\MQL5\include file riskmanager.mq5

 
Oleg:

Guys, tell me what error is generated during compilation?

Kudos to the author!


can't open "C:{\Users\Oleg\AppData\Roaming\MetaQuotes\Terminal\FE0E65DDB0B7BDE40BDE125080872C34D61\MQL5\include file riskmanager.mqh" include file riskmanager.mq5


The compiler cannot connect the Trade.mqh inclusion with standard trading functions. Check the presence of this file in the specified path and, accordingly, either manually throw the Trade.mqh file into the ...MQL5\include\Trade\ folder or reinstall the terminal.
 
Анатолий Сергеев:

The compiler cannot connect Trade.mqh inclusion with standard trade functions. Check if this file is available in the specified path and, accordingly, either manually add the Trade.mqh file to the ...MQL5\include\Trade\ folder or reinstall the terminal.

Got it, thanks!

 
Good afternoon! Anatoly, I use your risk manager. Great thing. It is on a VPS server, in mt5, and I trade through Quick futures. Everything would not be bad, but recently the robot started to perceive the daily clearing as the initial entry point, although by this time I am already in the plus. Zeroing out the margin, apparently it does the same thing. And when the price goes against me by the value of the stop, it closes the position.... it's a real shame! I didn't put a trailing stop. What should I do? I would also like to move the position through the night sometimes, but it's not enough to get fat) I would like to solve the first problem! Anatoly, if you can help me, I will be very grateful to you!
 
SergeySvetlyi:
Good afternoon! Anatoly, I use your risk manager. Great thing. It is on a VPS server, in mt5, and I trade through Quick futures. Everything would not be bad, but recently the robot started to perceive the daily clearing as the initial entry point, although by this time I am already in the plus. Zeroing out the margin, apparently it does the same thing. And when the price goes against me by the value of the stop, it closes the position.... it's a real shame! I didn't put a trailing stop. What to do? I would also like to move the position through the night sometimes, but it's not enough to get fat) I would like to solve the first problem! Anatoly, if you can help me, I will be very grateful to you!

I have stopped supporting this EA as I have written a new one. It is simpler but at the same time uses a more reliable algorithm. Specially for VPS. Without output on the screen (there is signalling on the phone via MetaQuotes ID), without global variables in the terminal and so on. Trailing is also removed. Only two ideas are implemented, which actually I need now for my own trading. 1. Tracking of risk for each trade. 2. Reduction of money on the specified % and closing the trade before the end of the day. That is, you can grow in the plus as much as you want, including overnight. In minus only by the specified percentage.

Regarding your problem, I understand that you want the Expert Advisor to ignore profits? Including those fixed by clearing? And %minus counted from the initial funds before entering the deal? Well, it can be implemented, but it will complicate the code very much, as the EA will have to perceive each trade separately, while now only the balance equal to the result of all open trades is tracked. Besides, it will have to save trades before clearing, including more than one, if the position is opened for a "long time". In principle, it is possible to make a fuss, but it goes against my vision of trading, in terms of the fact that the profit should be protected and taken away, as it is considered already earned money.

A slightly different type of Expert Advisors will work for you. Something like an automatic stop loss setter. This is exactly what you need. In the EA, you set the risk on the trade. The Expert Advisor waits for the opening of a new deal, automatically counts the n% loss on it and sets a stoploss at this price. It will be just the % of loss without taking into account profit. If I understood your request correctly.

 
Анатолий Сергеев:

I have stopped supporting this Expert Advisor as I have written a new one. Simpler but at the same time using a more reliable algorithm. Specially for VPS. Without output on the screen (there is signalling on the phone via MetaQuotes ID), without global variables in the terminal and so on. Trailing is also removed. Only two ideas are implemented, which actually I need now for my own trading. 1. Tracking of risk for each trade. 2. Reduction of money on the specified % and closing the trade before the end of the day. That is, you can grow in the plus as much as you want, including overnight. In minus only by the specified percentage.

Regarding your problem, I understand that you want the Expert Advisor to ignore profits? Including those fixed by clearing? And %minus counted from the initial funds before entering the deal? Well, it can be implemented, but it will complicate the code very much, as the EA will have to perceive each trade separately, while now only the balance equal to the result of all open trades is tracked. Besides, it will have to save trades before clearing, including more than one, if the position is opened for a "long time". In principle, it is possible to make a fuss, but it goes against my vision of trading, in terms of the fact that the profit should be protected and taken away, as it is considered already earned money.

A slightly different type of Expert Advisors will work for you. Something like an automatic stop loss setter. This is exactly what you need. In the EA, you set the risk on the trade. The Expert Advisor waits for the opening of a new deal, automatically counts the n% loss on it and sets a stoploss at this price. It will be just the % of loss without taking into account profit. If I understood your request correctly.


Thank you for such a detailed answer! )

 

Good day, can you tell me what trailing stop percentage counts from what and how? Let's say with a depo of 10 000, earned 500, daily loss 10% (i.e. 1000) how many percent of trailing should be set, so that at -500 the machine blocked the trade? Thanks

 
ark495:

Good day, can you tell me what trailing stop percentage counts from what and how? Let's say with a depo of 10 000, earned 500, daily loss 10% (i.e. 1000) how many percent of trailing should be set, so that at -500 the machine blocked the trade? Thank you


Trailing is counted from the maximum achieved floating profit (variation margin) and at a pullback by the specified amount of % (from the initial balance) all trades are closed. In your example the parameter "Trailing stop of daily profit in %:" should be set to 5% (which is equal to 500 roubles from the starting balance), accordingly at a profit of 500 trailing will close all transactions at the level of 10 000. If the maximum floating profit was 700 under the same conditions, all trades would be closed at the balance level of 10,200.

 
Great risk manager, nothing extra!