Trailing Stop and Spread
-
Hi! ... please need suggest ... I do not find the best way to add in every tick the "spread" to trailing stop.
The trailing stop follow the bit price (for sell) or ask price(for buy) but increase/decrease if the spread increase/decrease.
SELL: TRAILING STOP PRICE = bit price + trailing pips + spread
BUY: TRAILING STOP PRICE = ask price - trailing pips - spreadEXAMPLE SELL TRADE:
The Spread is the variable:
Trailing pips= 10 pips
Hip1: Spread= 1 > Trailing stop= 11
Hip2: Spread= 8 > Trailing stop= 18The best way maybe would be a box adjust in the "trailing stop" block ... so is possible to add a variable value (spread in this case) to the trailing stop value.
Unfortunately this block do not permit the retreat of the stop!I think the best way is use "modify stop":
I have try with "modify stop" block but it do not trail.
I have try with "extend stop" block but I was unable to do it.Please can you suggest a block combination to do it please?
Many thanks!

-
By default the block works with Ask for Buys and Bid for Sells, but there is one option Reference price where you can switch that
-
Yes... this is clear....and very useful!
My question is a little bit complex ...sure I have not explain well.
Anyway I can solve this with "modify stop" and "pips away from stop" blocks. Only I need an option that have all other block ... the possibility to choose if the distance is from bid or ask!
Could you add?... is possible?
Many thanks!

-
But the Trailing stop block is very customizable, why is it not enough? Otherwise yes, I think such option is possible.
-
By the way, just for fun you can try something like this - http://prntscr.com/aut7v9
http://i.imgur.com/8zST6Ca.png
I didn't tested it and I don't know if it works. But Spread() is this native function https://www.mql5.com/en/docs/standardli ... infospread and toPips() is fxDreema function that can convers values such as 0.0001 to pips. Of course, you can also multiply or divide Spread() with plain number. -
Hi,
the "trailing stop" block is very good but I cannot use it because it has only ONE OUTPUT and is ALWAYS ON ...so is impossible to detect the time it does not trail!
** I have test with "trace activity" the output of "trailing stop" and is always active even when it doesn't trail the stop.*Maybe could you add the second output below?
... it would be very useful do do something when the block not trail!ORANGE ON: BLOCK TRAILING
YELLOW ON: BLOCK NO TRAILING***In this case it would be easy .. when it does not trail is possible to do something! **
http://imageshack.com/i/pmmZO9W7p
Otherwise I must use the block "pips away from stop loss" + "modify stop"
%(#FF0000)[Please but I have not understand yet ... about the "pips away from the stop" ..first reference is "stop loss" and the second is ask or bid?]http://imageshack.com/i/plVvkNcbp
I have try to use Spread() in various modes and blocks but always get error.
This is not a problem ...only need to create a variable spread!
Thanks.

-
Well, the thing with the Trailing Stop block is that it can work with 1 trade and it can work with 100 trades at the same time. If you have many trades at the moment, one of them will be modified now, other one will be modified later... you don't know, it's like something random. The output would be compound.
Anyway, I added this Reference price option in "pips away..." blocks. I didn't tested it, but I tink it will work
I was wrong about Spread(), it looks to be a function in some different context. There is a way to get the spread anyway, but with functions that look ugly

pips away from stop-loss - this block measures the difference between the current price and the stop loss. This distance is always a positive value. For Buys this is Ask-SL, for Sells this is SL-Bid. I made this block when I wanted to be possible to make trailing stop functionality with pink blocks. And the trailing stop works this way - it check the distance to the current SL and if it's too big -> SL is moved closer. The yellow output of the block is "else" of the orange output, I guess not very useful
-
Hello,
really many thanks for the add in the block ...I'll test it and if I see some problem I' ll contact you.

About the "trailing stop block" I understand that it can work for many trades, moreover it can work for each trade bat it has the setting of group, block etc .. is possible to use this functions to separate the trades.
Following the logical of the FxDreema blocks I thing it will be useful to know when the block work or no (just I need it!).
In this case the function of the block is to trail the stop, so I think it would be useful to have the possibility to detect when the block work or no. Then, depending of the strategy, is possible to set for which trade.
For example the block "pips away from stop" has the second output (and is useful...), so I can detect when it work or no.
Thanks...

-
Trailing stop works this way from the beginning and maybe there are people using the fact that it's output is always true to connect other blocks after it that should run every time. If I change the way it works, these project will become buggy for these people, because they don't know what happened
-
Yes, I'm agree, this is correct ... do not worry ...I'll find a solution!
Many thanks!
