newOrderAllocations
Create new orders based on percentage allocations.
Important: Before submitting allocation-generated orders, this endpoint cancels any existing open orders for the strategy. It then creates market orders to move the strategy toward target percentage allocations.
Headers
User API token.
Body
AlphaInsider strategy identifier.
The allocations array represents the strategy's complete desired position set: any current position omitted from the array is closed, and an empty array closes every position.
Slippage represents the percentage offset from the current bid/ask price when placing a limit order. This adjustment helps ensure that orders are more likely to fill by accounting for potential price movements.
Please note that the allocations may not sum precisely to 100%. The following calculation illustrates our approach to determining a conservative buffer for potential fees and slippage:
MaxOrderTotal = BuyingPower * 2
This calculates the maximum possible order total, representing a full position reversal (e.g., from maximum long to maximum short, or vice versa).ConservativeFeeTotal = MaxOrderTotal * (fee * 2)
This accounts for the buying power reduction due to fees, as fees are deducted from collateral. (Stock Fees: 0%, Crypto Fees: 0.25%).ConservativeSlippageTotal = MaxOrderTotal * Slippage
This reserves funds for the worst-case scenario of order fills impacted by slippage.FinalBuyingPower = BuyingPower - ConservativeFeeTotal - ConservativeSlippageTotal
The adjusted buying power after these reductions.
0 <= x <= 2Must be a multiple of 0.001