Hello!
Just getting my feet wet here but I was hoping for some guidance on how to track potential margin calls.
Here I am just trying to graph when the portfolio might get a margin call (indicated by the value going below 0)
maintenance_requirement = 0.25
total_value = context.portfolio.positions_value + context.portfolio.cash
margin = (total_value) - (context.portfolio.positions_value * maintenance_requirement)
record(margin_watch=margin)
For some reason I feel like this is too simple and very incorrect. Advice/Suggestions very welcome!