Implemented stop loss having no effect on results
I implemented stopLoss using the following code where stopLoss price is
d.close - p * standardDeviation(d,10). I vary the parameter p from [0.5,1,2 to 10], but it had just a bare minimum effect on the returns even for a large amount of data from 2005 to 2020. All the results including the one without stoploss differ within 0.1%. I mean even adding or deleting a month from this whole data would have had more impact on returns than stopLoss did. Am I doing something wrong?
o = self.buy(d,size=size) s = self.sell(d,price=stopLoss, size=size,exectype=bt.Order.Stop, parent=o) self.stops[d] = s