Slippage features
-
Hello!
I search info about SLIPPAGE function but I have no find the answer.
-
Can you confirm that the SL and TP of the buy/sell block depend from the real open price of the order request (without slippage)? I have read this: viewtopic.php?f=14&t=2719
-
When slippage occur GO ON the green OUTPUT of the block (..slippage is an error?)
-
Where can I get the "open price value" of the order request (before slippage)?
Thanks!

-
-
This is the problem:
The EA calculates the future SL and TP based on the current price (Ask or Bid) and sends this data to the server. Meanwhile the price may change and the trade may be opened at different price. But SL and TP are the same as requested. As a result SL becomes bigger than TP or TP becomes bigger than SL. The absolute difference between TP and SL is the same as the requested, but the open price is shifted towards one of them.This is what I decided to do:
The EA remembers the requested open price and after the trade was created, this price is compared with the real open price. If there is some difference, then TP and SL are moved with the same difference. So, if you wanted 10:10 pips for SL:TP, the EA tries to provide them. Instead of 12:8 for example.No, this is not considered error. I'm aware that this is something that people don't want, but I think that error is when you want a trade and you don't have a trade. So the second output becomes active only when no trade is created.
If you are still in the same tick, for example immediately after Buy now, then the Ask is the requested open price. But I'm not sure about that... maybe the value of Ask will be updated on-the-fly. I never tested that.
I think that the Slippage value can't be get later. The EA does not collect this value as well.
-
Many thanks, is more clean!

But if the block have the slippage filter there is a comparison and the block get the two price (request and open) ... you have said: "The EA remembers the requested open price and after the trade was created, this price is compared with the real open price."
So... is not possible get the two price?
I need all dates to test EA that trade in volatility.. now I have add the "spread value in the comment of every trade but I would like to mark slippage too.
Regards!

-
But you don't know the amount of slippage until it happens. The problem is that you request some price, but the server does not accept that price and opens the trade at different price. And the Comment of the trade (not the comment at the upper left) can be set once when the trade is created, but you can't modify it later, or at least I don't know how.
-
Yes, is true. To get the two price is only to see the trade result and to see if there was slippage. Is only for test purpose to decide the future setting.
But I have no understand something:
1: About slippage setting in trade block... who do the comparison the EA or the Broker server? I think the broker server because it open to different price and it can stop the trade.
2: If I set 10 pips in the filter and the EA fire the trade is possible to know if there was slippage between 0 and 10 pips?
3: If the trade do not fire is possible to know that the EA try to fire a trade but there is "NoTrade" due slippage filter? For this reason I think that it will be very useful the "out error" for slippage filter (to use for open other trade, message, arrow in chart ...)
**
Finally the question is: **
When the trade is open (or not due slippage filter) is possible to know the slippage of the trade (or "no trade") to decide if do something and for information purpose?
Have you suggest for how to do it?Many thanks.
-
you can save ask/bid price into variableA before block for opening trade, and into variableB save price opened trade (after opening block), you make difference into variableC = variableA-variableB in pips and variableC is now something you are requested.
-
Hello Miro,
many thanks for your reply and suggest...yes, this is true ... how you can see we have comment above:
__"If you are still in the same tick, for example immediately after Buy now, then the Ask is the requested open price. But I'm not sure about that... maybe the value of Ask will be updated on-the-fly. I never tested that"[/quote:1e8rg793]
The ASK or BId are the price of the EA when the "internal signal" occur , we are not sure that is the same that read the broker when receive the request. For example for internet latency between the MT4 and broker or for busy line in Internet.... 1 second with volatility can be 10 -20 pips from the ask/bit of EA and the price request of broker.
I think that the slippage value of the fx dreema block is sending to broker with the request, the broker decide to open or not the trade but I think they do not send log in case of slippage and "no trade" (I'm not sure... I'll test it!).
Some serious Broker send the log of the request with price of the request and other log for the open trade at the real price ... but in the last time I don't see it. Time ago I have see the "slippage" alert in the same trade log!
For example this is of yesterday, for pending order there is the price (because is the price of the pending) and the slippage was of 8 pips, for direct trade there is the request but no price (the request was already in the broker server before of the pending!!) .. the trade is opened with 7 second of latency and more of 60 pips of "slippage" or "broker delay" ...I do not know why! ...7 second and 60 pips to find liquidity maybe is too much!! ...
.. this is Pepperstone! 
0 13:29:01.663 : order buy market 1.00 USDJPY sl: 0.000 tp: 0.000
0 13:29:01.820 : order #13444246 buy stop 0.30 USDJPY at 100.452 activated at price 100.540
0 13:29:08.581 : order was opened : #13444643 buy 1.00 USDJPY at 100.901 sl: 0.000 tp: 0.000I have request to send me the full file log from the broker.
If is not possible to get the price of the request (from broker) the last solution is the ask or bit from EA. Moreover is very interesting to see in the chart the price of the signal too.
I test in the next days.

Thanks...Regards!
-
yes, this can be problem with real ecn brokers (real is even discutable :D)
have your broker this option? Enable maximum deviation from quoted price (I think it works only with instant order, with market order(ECN) it is not working - because you become warning that order will be executed with market conditions and there can be significantly difference between prices)
fxdreema make EA in sending orders with slippage option (function OrderSend()), so I mean (in my opinion) all depends on your broker, when he rejects order because slippage difference - I think it make nonECN broker with instant orders, but ECN broker with market orders accept your order and open it at market conditions directly (guaranted opening but on not guaranted prices)
there was hard safe method how to avoid this problem with market conditionsonTick section:
old_Ask = x_Ask;
x_Ask = Ask;
if (MathAbs(old_Ask - x_Ask) < (my_slippage * PipValue(symbol)) EA_can_Trade = true;
x_Ask = MarketInfo(symbol,MODE_ASK);
// PipValue() is function from fxdreema, instead you can use MarketInfo(Symbol(), MODE_POINT)) but you need know if you broker is quoting pairs standard with 4 or 5 digits (2 or 3)if difference between x_Ask and old_Ask is more than your slippage then it looks better not to trying place the trade
you can play with 8-)
-
__1: About slippage setting in trade block... [/quote:3e4bb4j4]
This is something else, this does not work... most probably. As you can see, the OrderSend() function has "slippage" as a parameter - https://docs.mql4.com/trading/ordersend Yes, this is the "Slippage" from "More settings". But as you can read here: https://forum.mql4.com/45904 in ECN brokers it has no effect. I can only measure it.
Once I tried different values for "slippage" in OrderSend() and really, there was no difference. I tried values like 0.1, 1, 100 (because I never really knew what kind of value to use for this parameter). You can try this as well, if you want. But this looks to be non-ECN parameter.
-
Great.. many thanks for all the information!
The next week I will test and try to find best solution.... anyway I think that the best solution is:" TO BE A BROKER!!"
