Skip to content

Algorithm SDK

OPEN_POSITIONS_COUNT

The number of positions this algorithm has open. The same as OPEN_POSITIONS.length.

declare const OPEN_POSITIONS_COUNT: number;
declare const OPEN_POSITION_COUNT: number;

OPEN_POSITION_COUNT, without the S, is an older name for the same number. Use OPEN_POSITIONS_COUNT in new code.

function onIntervalClose() {
if (OPEN_POSITIONS_COUNT < 3 && rsi(14) < 30) {
openPosition("BUY", { quantity: 1000, stopLossPips: 20 });
}
}