Duplicate: Dynamic Maximum open position

How can i increase or decrease maximum open position in custom backtest interface according to situation.

Well you have to structure your intent before going all out.

What you can do is set Max Open positions to some upper limit that's logical to your system.
That way, now you don't have to increase them. All you have to do is manage the decrease part.

You can refer to logic by TJ quoting here
where a variable k can count the signals on each bar and access the logic set by you then

if( ++k > MaxOnBar[i] ) sig.Price = -1; // tell backtester to ignore signal
// Where you have defined the Max Limit for this bar

post link:


Duplicate of Max opened positions per bar