- ago
I'm trying to write a custom position sizer where the calculation requires the current buying power. Is the current buying power simply:
CurrentEquity * MarginFactor - CostBasisOfOpenPositions ?
0
189
Solved
4 Answers

Reply

Bookmark

Sort
- ago
#1
Hmm what about CurrentCash * MarginFactor? 🤷🏼‍♂️
0
mjj37
- ago
#2
I'm using a margin factor > 1 so CurrentCash goes negative as the simulation is on margin.

I thought the calculation would be CurrentEquity * MarginFactor - (CostBasisOpenPositions or MTMOpenPositions).

But I'm still getting NSF positions occasionally when there shouldn't be with the above logic.

Is it possible to add a CurrentBuyingPower property to UserStrategyBase to go along with CurrentCash and CurrentEquity?
0
Cone7
- ago
#3
BuyingPower = ( ( MF - 1 ) * CurrentEquity ) + CurrentCash
1
Best Answer
mjj37
- ago
#4
Thank you
1

Reply

Bookmark

Sort