This may be a question that has already been answered previously. Apologies if it is a repeat.
When using the the calculated trailing stop based on MFE, if the trade goes negative then no trailing stop is created. I have tried to use the following where a long trade immediately starts with losses, in an attempt to minimise losses but it does not give a consistent result. Would there be a simple explanation for this failure to work. Is there a way of coding this initial loss control?
I have tried your suggestion but it has a similar inconsistent result, or a result that does not seem to fit with the logic in the code – that is, it does not stop losses worse than 10. In the backtest, there remain losses worse than -10. My aim is to limit the losses to -10 worst case.
With this code you can have more than 10 points of loss because this condition is only read at close of the bar, and at that moment the difference could be more than 10 points obviously.
Oh – yes I now see that my calculation is identical to yours! Your second posts describes your problem much more clearly than the first and Nicolas’ answer to use SET STOP pLOSS will fix it for you as that will place a 10 pip stop on the market for every buy entry order that is filled.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.