Stop Loss - Dynamic Level (Price Input)
-
Hi,
On buy and sell positions I am using Stop Loss - Dynamic Level (Price Input) to close the trade at 0.5% loss, as shown in the example below:
https://fxdreema.com/shared/PSuUbzN2b
I works perfectly on backtest and is mostly alright on live testing, but on several ocasions the SL is too short, it does not obey the rules.
Check out today's report:
*2016.03.10 10:04:53 TOTS3 sell 300.00 33.34 0.00 Short position
2016.03.10 10:05:20 TOTS3 buy 300.00 33.64 -90.00 [sl 33.49]
Sell at 33.34, stop loss as 0.5% should be 33.512016.03.10 10:06:01 CTIP3 sell 300.00 40.39 0.00 Short position
2016.03.10 10:57:37 CTIP3 buy 300.00 39.65 222.00 Position #18254748 closed2016.03.10 10:06:01 SMLE3 sell 300.00 38.61 0.00 Short position
2016.03.10 10:33:02 SMLE3 buy 300.00 38.62 -3.00 [sl 38.62]
Sell at 38.61, stop loss as 0.5% should be 38.802016.03.10 10:06:10 HYPE3 sell 400.00 26.88 0.00 Short position
2016.03.10 10:08:25 HYPE3 buy 400.00 26.95 -28.00 [sl 26.94]
Sell at 26.88, stop loss as 0.5% should be 27.012016.03.10 10:11:23 BBAS3 sell 500.00 20.85 0.00 Short position
2016.03.10 10:14:36 BBAS3 buy 500.00 20.95 -50.00 [sl 20.95]
Sell at 20.85, stop loss as 0.5% should be 20.95 - CORRECT2016.03.10 10:13:01 SULA11 sell 500.00 18.41 0.00 Short position
2016.03.10 10:25:13 SULA11 buy 500.00 18.14 135.00 Position #18255920 closed2016.03.10 10:15:10 HYPE3 sell 400.00 26.94 0.00 Short position
2016.03.10 11:28:56 HYPE3 buy 400.00 26.46 192.00 Position #18256295 closed2016.03.10 10:15:51 TOTS3 sell 300.00 33.36 0.00 Short position
2016.03.10 10:16:41 TOTS3 buy 300.00 33.42 -18.00 [sl 33.41]
Sell at 33.36, stop loss as 0.5% should be 33.532016.03.10 10:17:24 PCAR4 sell 200.00 47.99 0.00 Short position
2016.03.10 11:41:10 PCAR4 buy 200.00 47.17 164.00 Position #18256547 closed2016.03.10 10:19:20 BRKM5 sell 400.00 24.56 0.00 Short position
2016.03.10 11:28:14 BRKM5 buy 400.00 24.11 180.00 Position #18256944 closed2016.03.10 10:26:40 FIBR3 buy 300.00 31.43 0.00 Long position
2016.03.10 10:29:34 FIBR3 sell 300.00 31.27 -48.00 [sl 31.29]
Buy at 31.43, stop loss as 0.5% should be 31.27 - CORRECT*Do you know why this happens? The same rules, different results.
Is there a better way to configure SL if I want a 0.5% of position value as SL?
Thanks!
-
Maybe there is slippage and the open price is changed on the server? Or minimum limit where SL can be put. Are there other messages in the log?
-
Hi,
I don't have those logs anynore, I migrated my MT5 to a virtual server this weekend so I only have logs starting today.
Well, today it happened again:
*2016.03.14 10:04:16 PCAR4 sell 200.00 48.37 0.00 Short position
2016.03.14 10:25:27 PCAR4 buy 200.00 47.31 212.00 Position #18389902 closed
%(#FF0000)[While I had a gain in this trade, the SL was too short.]
LOG:
2016.03.14 10:18:47.747 Trades '50424729': deal #15893951 sell 200.00 PCAR4 at 48.37 done (based on order #18389902)
2016.03.14 10:18:47.544 Trades '50424729': exchange sell 200.00 PCAR4 at market sl: 48.49
SL should be registered as 48.61 (0.5%), not 48.49.2016.03.14 10:05:53 BRKM5 sell 400.00 24.56 0.00 Short position
2016.03.14 10:06:00 BRKM5 buy 400.00 24.88 -128.00 [sl 24.61]
%(#FF0000)[In this case, SL was too long, it should be 24.68]
LOG:
2016.03.14 10:20:24.888 Trades '50424729': deal #15894085 sell 400.00 BRKM5 at 24.56 done (based on order #18390056)
2016.03.14 10:20:24.372 Trades '50424729': exchange sell 400.00 BRKM5 at market sl: 24.61
The strage thing is that it registers a smaller SL (24.61) but executes a longer one (24.88), while the correct should be 24.68. Is this slippage fault? Is there a way to "limit" it?2016.03.14 10:19:27 BRFS3 buy 200.00 52.06 0.00 Long position
2016.03.14 12:07:57 BRFS3 sell 200.00 52.81 150.00 Position #18391881 closed
%(#00BF00)[In this case I had a gain and the SL was correct.]
LOG:
2016.03.14 10:33:58.669 Trades '50424729': deal #15895675 buy 200.00 BRFS3 at 52.06 done (based on order #18391881)
2016.03.14 10:33:58.466 Trades '50424729': exchange buy 200.00 BRFS3 at market sl: 51.80
SL was 51.80 (0.5%).2016.03.14 10:20:14 SMLE3 buy 300.00 38.23 0.00 Long position
2016.03.14 10:20:27 SMLE3 sell 300.00 38.11 -36.00 [sl 38.16]
%(#FF0000)[Here the SL was too short, it should be 38.04 (0.5%)]
LOG:
2016.03.14 10:34:45.606 Trades '50424729': deal #15895768 buy 300.00 SMLE3 at 38.23 done (based on order #18391988)
2016.03.14 10:34:45.419 Trades '50424729': exchange buy 300.00 SMLE3 at market sl: 38.16 *Is there a better way to control SL? I would like to control the maximum loss, but more importantly, I don't want SL to be too short because it really affects my strategy.
Thank you for your help.
-
SL (and/or TP) is sent to the server as a price value, absolute value. The Open Price (let's call it OP) is also sent, which is Ask for Buys and Bid for Sells, but it doesn't matter, because the broker may decide to open the position at a different price => this is slippage, deviation, or call it how you want. As a result OP can be different than the requested one, but SL and TP are gonna be the same as the requested, or there will not be position at all.
So I think that this happens. SL is calculated correctly with the current Ask/Bid price that is available at the moment. But while you send that position the price is moving.... and then on the server the trade is opened at a different price. SL/TP is again, the same as requested. As a result you have shorter SL and longer TP or longer SL and shorter TP.
I can't help for these slippages. This is what it is - you are telling the server to open the position at X price, but then it decides to open it in some other price. Even if in fxDreema SL/TP are defined as "Fixed pips", they are still sent as absolute values, they are not relative to OP.
Here is something I found:
https://forum.mql4.com/62441#946057
so, for Market execution (ECN) the rule is that the position is opened at the first market price available. For Instant execution you can specify maximum slippage, but I'm not sure that such brokers exists anymore
-
Hi, thanks for the explanation.
My trades usually happen on periods of high volatily, so probably that is what is hapening.
I am thinking about setting up a SL after the position is open, so I don't have this kind of problem.
I will buy/sell with no SL. Then I use the block "modify stop" below a "once per positions" block to apply a SL based on the position that is already running.
I'll see if it works. I'll posts results tomorow. If you have a better idea (or if you notice a flaw in my way of thinking) please let me know.
Thank you for all the help so far.
-
Well, it didn't work. I had very strange results.
I'll think about something else...