EA: 关闭所有仓位

 

关闭所有仓位:

当达到指定利润水平时关闭所有仓位

作者: Vladimir Karputov

 
你好,请教,这个利润是只净值达到目标关闭所有仓位?
 
opmopt :
你好,请教,这个利润是只净值达到目标关闭所有仓位?

Closing positions when the profit level is reached Close all if Profit . In this case, the total profit for all positions is summed up: regardless of the symbol and magic number.

Profit is calculated only at the moment of the birth of a new bar.

 
Vladimir Karputov:

Closing positions when the profit level is reached Close all if Profit . In this case, the total profit for all positions is summed up: regardless of the symbol and magic number.

Profit is calculated only at the moment of the birth of a new bar.

你好,能否修改成,当净值大于某个值时关闭所有仓位?谢谢。

 
opmopt :

你好,能否修改成,当净值大于某个值时关闭所有仓位?谢谢。

Please read the description. When the profit of all positions reaches 'Close all if Profit', all positions are closed.

True, this is a very simple code and there is no 100% guarantee for closing all positions.

 
Vladimir Karputov:

Please read the description. When the profit of all positions reaches 'Close all if Profit', all positions are closed.

True, this is a very simple code and there is no 100% guarantee for closing all positions.

那能将这个代码编写成自动执行的EA?

 
opmopt :

那能将这个代码编写成自动执行的EA?

This is already an advisor.

 
您好。
能否修改计算 EA 利润的逻辑,使其只在新条形图 诞生时计算,而在 "当前条形图 "上计算?
因为在大的时间段内(H1、H2、H4 等),有可能在当前条形图上立即达到目标利润水平。

,致以最崇高的敬意。
 
Edviao:
您好。
您能否修改计算 EA 利润的逻辑,使其仅在新条形图 诞生时计算,而在 "当前条形图 "时计算?
因为在大的时间段内(H1、H2、H4 等),有可能在当前条形图上立即达到目标利润水平。

,致以最崇高的敬意。

好的,我会添加这样一个选项。此外,我还会为符号添加一个选项:只为当前符号或所有符号计算盈利和平仓。

 
Vladimir Karputov :

Tamam, bunun gibi bir seçenek ekleyeceğim.我们的目标是:通过我们的努力,让更多的人参与到游戏中来。

超级棒!
新功能将使 EA 更加灵活。
非常感谢,***。

注意:
例如,附加参数可以是

参数 A = "新条形图 诞生" 时的利润计算
参数 B ="新条形+当前条形的利润计算"。
Обработчик события "новый бар"
Обработчик события "новый бар"
  • www.mql5.com
Для создателей индикаторов и экспертов всегда был актуален вопрос написания экономичного кода с точки зрения времени выполнения. Можно подойти к решению этой задачи с разных сторон. Из этой обширной темы в данной статье будет затронут, казалось бы уже решенный вопрос: проверка появления нового бара. Это достаточно популярный способ ограничения...
 
Edviao:


NOTA:
例如,附加参数可以是

参数 A = "新条形图 诞生" 时的利润计算
参数 B ="新条形+当前条形的利润计算"。

不,有两个参数:设置利润计算之间的停顿(以秒为单位)。如果小于 "10 "秒,则仅在新条形图诞生时进行检查;如果大于等于 "10 "秒,则仅是以秒为单位的检查间隔。