Replies: 1 comment
-
Never mind I found it, just a bug :P |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can someone help me understand this? The stop loss (SL) is set at the INDIC6 level (there's a faint blue line which is INDIC6 indicating it below the orange one). While the program behaves as expected during some periods (many red triangles), there are also significant stretches of time when the SL doesn't activate as it should.
Within the next(self):
def next(self):
currentSma = self.indic6[-1]
currentClosePrice = self.data.Close[-1]
if len(self.orders) == 0 and (currentClosePrice > currentSma):
stopLoss = currentSma
self.buy(sl = stopLoss, size = 0.99)
I also set later the SL within next
for trade in self.trades:
if trade.is_long:
if currentClosePrice > 1.01 * currentSma:
stopLoss = currentSma
trade.sl = stopLoss
Beta Was this translation helpful? Give feedback.
All reactions