Set Trailing Step According to Order Swap and Minimum Stop allowed

MQL4 Experts Aconselhamento

Termos de Referência

0

I am using a swap strategy with two account with different brokers (hedged accounts). I have the code that sync between the two account (via two brokers).

When i close a BUY order with broker A, my EA send Close message and the SELL order on broker B gets closed. i get profit from [swap minus commission] on broker B.

What i need instead of closing the order on broker B do the following:

  1. Get the total swap of the SELL order.
  2. Set the Trailing stop loss by the [swap minus commission] value, e.g if the [swap minus commission] is $50, set the stop loss so if it gets hit the loss will be $50 max.
  3. Check the minimum allowed stop loss by broker, and if the needed step (calculated on step 2) is above the minimum , do not set trailing stop , just close the order with the [swap minus commission] profit.

Respondido

1
Desenvolvedor 1
Classificação
(23)
Projetos
45
20%
Arbitragem
24
29% / 42%
Expirado
12
27%
Trabalhando
2
Desenvolvedor 2
Classificação
(258)
Projetos
395
28%
Arbitragem
69
19% / 49%
Expirado
120
30%
Livre
3
Desenvolvedor 3
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
4
Desenvolvedor 4
Classificação
(4)
Projetos
4
0%
Arbitragem
1
0% / 100%
Expirado
1
25%
Livre

Informações sobre o projeto

Orçamento
30+ USD
Desenvolvedor
27 USD
Prazo
para 10 dias