Hi guys,
this problem is driving me nuts.
So it goes like this, note that I am testing in the MT4 Strategy Tester, my account is in AUD.
I have an EURUSD open Buy trade at 0.02 lots,
when the price gets to X pips in profit, 1/2 the trade closes and the remaining lots, 0.01 ride. At this stage, the Stoploss is bought to BreakEven. So far so good.
Now when the price hits my Stoploss, I am expecting a profit/loss of 0.00 but I am getting small losses eg below. -0.74, -1.15
25 2018.09.03 00:00 s/l 10 0.01 1.15977 1.159770 -0.74 5118.2
32 2018.09.28 00:00 s/l 13 0.01 1.16909 1.169090 -1.15 5121.35
With the open Sell trades, they are always in small profit, 0.48, 0.73, 0.15, 0.29
My BreakEven code is as follows,
I have tried adding the spread into the calc of the Stoploss with no luck,
it reduced the loss from -0.74 to -0.59.
Notice the Stoploss in line 89 is the same as the Openprice.
86 2019.10.31 00:00 modify 37 0.02 1.10818 1.10818 0.00000 0.00 4992.28
87 2019.10.31 00:00 close 37 0.01 1.11488 1.10818 0.00000 6.29 4998.57
88 2019.10.31 00:00 buy 38 0.01 1.10818 1.10818 0.00000 0.00 4998.57
89 2019.11.06 00:00 s/l 38 0.01 1.10818 1.10818 0.00000 -0.74 4997.83
Does it have anything to do with adjusting for the Account being AUD and not USD.
Any help would be great,
Cheers.
Edit:
Just did a test on USDCAD and small losses occurring on Buy and Sell BreakEven Stoploss.
this problem is driving me nuts.
So it goes like this, note that I am testing in the MT4 Strategy Tester, my account is in AUD.
I have an EURUSD open Buy trade at 0.02 lots,
when the price gets to X pips in profit, 1/2 the trade closes and the remaining lots, 0.01 ride. At this stage, the Stoploss is bought to BreakEven. So far so good.
Now when the price hits my Stoploss, I am expecting a profit/loss of 0.00 but I am getting small losses eg below. -0.74, -1.15
25 2018.09.03 00:00 s/l 10 0.01 1.15977 1.159770 -0.74 5118.2
32 2018.09.28 00:00 s/l 13 0.01 1.16909 1.169090 -1.15 5121.35
With the open Sell trades, they are always in small profit, 0.48, 0.73, 0.15, 0.29
My BreakEven code is as follows,
Inserted Code
ret = OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green);
I have tried adding the spread into the calc of the Stoploss with no luck,
it reduced the loss from -0.74 to -0.59.
Inserted Code
ret = OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice() + tradeSpread,OrderTakeProfit(),0,Green);
Notice the Stoploss in line 89 is the same as the Openprice.
86 2019.10.31 00:00 modify 37 0.02 1.10818 1.10818 0.00000 0.00 4992.28
87 2019.10.31 00:00 close 37 0.01 1.11488 1.10818 0.00000 6.29 4998.57
88 2019.10.31 00:00 buy 38 0.01 1.10818 1.10818 0.00000 0.00 4998.57
89 2019.11.06 00:00 s/l 38 0.01 1.10818 1.10818 0.00000 -0.74 4997.83
Does it have anything to do with adjusting for the Account being AUD and not USD.
Any help would be great,
Cheers.
Edit:
Just did a test on USDCAD and small losses occurring on Buy and Sell BreakEven Stoploss.