Set Trailing Step According to Order Swap and Minimum Stop allowed

Tarea técnica

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.

Han respondido

1
Desarrollador 1
Evaluación
(23)
Proyectos
45
20%
Arbitraje
24
29% / 42%
Caducado
12
27%
Trabaja
2
Desarrollador 2
Evaluación
(258)
Proyectos
395
28%
Arbitraje
69
19% / 49%
Caducado
120
30%
Libre
3
Desarrollador 3
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
4
Desarrollador 4
Evaluación
(4)
Proyectos
4
0%
Arbitraje
1
0% / 100%
Caducado
1
25%
Libre

Información sobre el proyecto

Presupuesto
30+ USD
Para el ejecutor
27 USD
Plazo límite de ejecución
a 10 día(s)