Experts: Close by Equity Percent

 

Close by Equity Percent:

The EA closes all positions if the equity reaches a certain ratio as related to the balance.

Author: Vladimir Karputov

 

Just a reminder...this is NOT equity percent from balance...this is a RATIO.

mb

 

I am still testing this...but I think if you want 1% of your balance then you type 1.1 as the input (Ratio =1.1:1)

mb

 

What's this for?

ulong m_magic=15489; // magic number

ulong m_slippage=50; // slippage


I haven't seen on MT-5 with closing by magic or by symbol yet - if you have seen it, please tell me in private.

 
Askr:

What's that for?

ulong m_magic=15489; // magic number

ulong m_slippage=50; // slippage


I haven't seen on MT-5 with closing by magic or by symbol yet - if you have seen it, please tell me in private.

This is something.

So it is not the first year already

MetaTrader 5 build 1295
MetaTrader 5 build 1295
  • 2016.04.01
  • MetaQuotes Software Corp.
  • www.metatrader5.com
Чтобы расширить возможности трейдеров ритейл-форекса, в платформу добавлена вторая система учета — хеджинг. Теперь по инструменту можно иметь множество позиций, в том числе — разнонаправленных. Это позволяет реализовывать торговые стратегии с так называемым локированием — если цена пошла против трейдера, он имеет возможность открыть позицию в...
 

for 1% you must enter 1.01


for 1/2% you must enter 1.005

 

It is not per cent, it is per ratio.

To use 0.5% enter 1.005.

To use 1% enter 1.01.

 
Hello Vladimir,
If possible, could you please adapt the following enhancement for this EA?
Thank you.


Parameter 'Close:'

- if you specify 'true', the total profit will be counted only for positions opened on the current symbol (the current symbol is the symbol on the chart of which the Expert Advisor is launched).
- if you specify 'false', the total profit will be counted for all positions for all symbols.

The 'Search signals' parameter - sets the interval for checking the total profit in seconds. If you set the value less than '10' seconds, the profit check will be performed ONLY at the moment when a new bar is born.


NOTE. Once the EA reaches the specified profit percentage and closes the positions, this trade will be repeated after reaching the target profit percentage for each new position, right?
 
Edviao:
***
Once the EA reaches the specified profit percentage and closes the positions, this trade will be repeated after reaching the target profit percentage for each new position, correct?

There is no repetition. The EA only closes positions.

 
Hello,
In other words, once the consultant has closed all positions, the consultant will not close any more positions even if the newly opened orders reach the specified profit value.
(If I am wrong, please correct me).

In the meantime, will you make the above improvements?
Совершение сделок - Торговые операции - Справка по MetaTrader 5
Совершение сделок - Торговые операции - Справка по MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 
Edviao:
***
Parameter 'Close:'

- if 'true' is specified, the total profit will be counted only for positions opened on the current symbol (the current symbol is the symbol on the chart of which the Expert Advisor is running).
- if you specify 'false', the total profit will be counted for all positions for all symbols.

The 'Search signals' parameter - sets the interval for checking the total profit in seconds. If you set the value less than '10' seconds, the profit check will be performed ONLY at the moment when a new bar is born.
***
Edviao:
***
In other words, once the consultant has closed all positions, the consultant will not close any more positions, even if the newly opened orders reach the specified profit value.
(If I am wrong, please correct me).
***

I plan to make these improvements on the basis of Close Balance Equity - the closing algorithm is better built there.

Close Balance Equity
Close Balance Equity
  • www.mql5.com
Советник закрывает все позиции по ТЕКУЩЕМУ символу при превышении Баланса или Средств над заданными. Входные параметры Инициализации шага происходит в OnInit, а далее когда в рынке нет ни одной позиции.