Replies: 1 comment 4 replies
-
Here is my code: class MyStrategy(Strategy):
def next(self):
if self.position:
if self.position.pl_pct >= 0.015:
self.position.close()
elif self.position.pl_pct <= -0.002:
self.position.close()
else:
print('Passing')
else:
if self.ema_buy:
self.buy(
limit=self.data.Close[-1],
tp=self.data.Close[-1] + (self.data.Close[-1] * 0.5),
stop=self.data.Low[-1] - (self.data.Low[-1] * 0.02)
)
elif ema_sell:
self.sell(
limit=self.data.High[-1] + (self.data.High[-1] * 0.05),
tp=self.data.High[-1] - (self.data.High[-1] * 0.5),
stop=self.data.High[-1] - (self.data.High[-1] * 0.05),
sl=self.data.High[-1] + (self.data.High[-1] * 0.06)
) The result has very large numbers in it and surprisingly almost no loss. the numbers look too good to be true.
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
why are the value of
Equity Final [$]
so large? is this the symptom of a deeper issue in my code?Beta Was this translation helpful? Give feedback.
All reactions