Set Trailing Step According to Order Swap and Minimum Stop allowed

MQL4 专家 咨询

指定

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.

反馈

1
开发者 1
等级
(23)
项目
45
20%
仲裁
24
29% / 42%
逾期
12
27%
工作中
2
开发者 2
等级
(258)
项目
395
28%
仲裁
69
19% / 49%
逾期
120
30%
空闲
3
开发者 3
等级
项目
0
0%
仲裁
0
逾期
0
空闲
4
开发者 4
等级
(4)
项目
4
0%
仲裁
1
0% / 100%
逾期
1
25%
空闲

项目信息

预算
30+ USD
开发人员
27 USD
截止日期
 10 天