Replies: 3 comments
-
this is what i came up with but I'm sure I'm not doing this the best way. if self.position.size > 0:
self.equity_during_trade.append(self.equity)
else:
self.equity_during_trade = [] |
Beta Was this translation helpful? Give feedback.
0 replies
-
The above works btw, I just wasn't sure if there was a more proper way. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here's an alternative: if buy_condition:
order = self.buy(...)
if order not in self.orders: # trade was executed
self.low_point_in_trade = self.equity
self.low_point_in_trade = min(self.equity, self.low_point_in_trade) I think I like yours better. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking to calculate the max drawdown point and measure my current distance from that point since I started opening trades. Something like the following:
the
bounce_from_low_pct
isbut obviously this doesn't work because self.equity is simply the current equity. I can't access the history.
Should I keep a list that I append the new equity every run of the next() method?
Is there a way to access the
_equity[-bars_since_trade_open:]
?Beta Was this translation helpful? Give feedback.
All reactions