Something with SL+TP that i don’t understand happens on forward testing (demo/live)
there is something with SL+TP that i don’t understand happens on forward testing (demo/live)
lets say i got a fixed TP of 10pips and fixed SL of 30pips,
some trades get executed fine with those values,
but sometimes i see that the values are not exactly TP=10, SL=30, but TP=11.5, SL=28.5 or things like that, is it because of the spread?, is it because of the slippage?, can i cancel that change of my SL and TP somehow in the mql code?, please if someone could explain to me why does this thing happen, and maybe how to prevent this thing from happening via the mql code change,
Slippage, the order is being sent with SL and TP already defined, but the price you get entered on is up to the broker. Use the max slippage feature to cancel trades that have too much slippage. Small SL/low timeframe strategies are highly sensitive to slippage.
You shouldn’t change your SL TP after slippage because your backtests do not account for this, you backtests are based on accurate entries and optimized to accurate entries, the cancel order feature is best.
I’m using STP/ECN brokers though, i do not trade with MarketMakers so the slippage limitation wont work..,
i understood what you said about the slippage with the SL+TP,
with that said, could you or somebody please point me to the line/function of the mql code that does that change of the SL+TP?, i want to run a forward demo test with both versions.., just out of curiosity maybe it will change something :/
thank you for your time.
I use ECN as well, but I don’t use the slippage feature because my stops are usually very large so small slippage has never been an issue.
I didn’t realize the slippage feature was only for otherwise, thanks for letting me know this.
I thought it would work like this- if slippage is greater than 3, the EA automatically closes the order in a split second so it ends only in spread loss. That should be the feature for ECN. Perhaps a worthy request.
There is no line of code to adjust the SL/TP like you wanted.
STP/ECN do not have a slippage limitation, no matter what you will set at the MaxSlippage the order will be executed no matter what.., this feature only works with marketmaker brokers mate.., thats the con of STP/ECN brokers, oh there is another con that the order that you execute wont be executed with SL and TP right away, the order will be executed with SL=0 and TP=0 and then the order will be modified with your SL and TP parameters.., the only thing you can limit is the spread, but this is a code line you will need to add manually into the mql code like i did, i did add a lot of stuff already into the code..
ill check about that thing i’ve asked here more in depth now i guess..
I assume SQ slippage in backtesting is working the same way though- the entry suffers effecting the SL/TP ratio. If you make a line of code to adjust this in live trading, it will invalidate your testing/optimization, so this code adjustment would have to also be added into SQ’s testing and you will need to reoptimize your SL/TP.
Viewing 6 posts - 1 through 6 (of 6 total)