Increase MaxOpenPositions depending on Portfolio Equity Level

Hello,

Currently, I'm using the below code for defining the number of open positions:

scrips = 4;
SetOption("MaxOpenPositions", scrips );
SetPositionSize( 100/scrips, spsPercentOfEquity );

But, if I want to increase the number of open positions, how do I do that? The kind of use case I'm looking at is thus: Portfolio Equity increases by 50%, add 2 more open positions so that final MaxOpenPositions is 6.

I know that Portfolio Equity is only accessible through Low-Level CBT, and I'm comfortable using that, but I don't see any way to increase MaxOpenPositions as it is not a part of CBT objects.

Regards,
Rakesh

The "Maximum Open Positions" is what the name says: MAXIMUM.
It is not actual number of open positions. It is MAXIMUM ever achievable.

Whenever you open that many or less, depends on SIGNALS that you generate and position size. Say you have maximum open positions set to 10, but position size is set to $20000 and you only have $40K equity. Then despite max open pos you will be able only to open 2 positions because you would run out of cash.
So the simplest implementation is to set fixed dollar amount. As your equity grows, you will be able to open more positions automatically.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.