Risk management, possible to call account equity? #814
Unanswered
PlainStack
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Okay so I tried the below which gives me an outcome that is relatively close, the rounding means it will be slightly more or less that 1% risked. The size _long runs fine but the size_short gives me OverflowError: cannot convert float infinity to integer. So not sure where I'm going wrong or if I'm even on the right track.
print returns 1000000 144 22883.0 22952.5 Another thing I noticed is that the account equity is the original cash balance I used (1000000) and doesn't change with PnL changes. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been testing different strategies. Core to most of my strategies is to have very tight risk management, i.e. only risk 1% of account on every trade.
For this to work I need to change the size of each trade depending on my distance to the stop loss price. Is it possible to call the account equity in the next() function so I can calculate a variable order size for each trade? Below the variables and the size_long variable I'm trying to solve. I'm not sure if or how to call the account_equity.
Feedback is much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions