mjj38
- 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
392
Solved
5 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.41% )
- ago
#1
Hmm what about CurrentCash * MarginFactor? 🤷🏼‍♂️
0
mjj38
- 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
Cone8
 ( 24.57% )
- ago
#3
BuyingPower = ( ( MF - 1 ) * CurrentEquity ) + CurrentCash
1
Best Answer
mjj38
- ago
#4
Thank you
1
- ago
#5
I would be interested in this position sizer. I've run Percent Equity thus far and it has been useful when backtesting. But recently, I've had rejected orders from the broker because of lack of buying power. It would be awesome if there was a way WL knew my buying power and could make trades based off of that number....or if there was a feature that you could select for it to submit an order using the remaining buying power of an account (as long as the $ amount wasn't over X% of an account's total value).
1

Reply

Bookmark

Sort