Skip to main content
POST
/
newOrderAllocations
newOrderAllocations
curl --request POST \
  --url https://alphainsider.com/api/newOrderAllocations \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "strategy_id": "<string>",
  "allocations": [
    {
      "stock_id": "<string>",
      "action": "buy",
      "percent": 1
    }
  ]
}
'
{
  "success": true,
  "response": [
    {
      "order_id": "l0-nlN5HEe3UdIutvYcDU",
      "strategy_id": "7Wy5AzIKY9bCmkIqjcLSg",
      "type": "market",
      "action": "buy",
      "stop_price": null,
      "price": null,
      "amount": null,
      "total": "1.246293514070567",
      "created_at": "2026-01-27T21:12:58.215Z",
      "stock_id": "6128jONlulvgURhFwmIb2",
      "figi_composite": "BBG000BDTBL9",
      "symbol": "SPY",
      "name": "SPDR S&P 500 ETF Trust",
      "sector": "Exchange Traded Fund",
      "security": "stock",
      "exchange": "NYSE",
      "stock": "SPY",
      "peg": "USD",
      "provider": "polygon",
      "slippage": "0.000000000000000",
      "fee": "0.000000000000000",
      "links": {
        "finviz": "https://www.finviz.com/quote.ashx?t=SPY",
        "trading_view": "https://www.tradingview.com/symbols/AMEX-SPY/",
        "yahoo_finance": "https://finance.yahoo.com/quote/SPY",
        "google_finance": "https://www.google.com/finance/quote/SPY:NYSEARCA"
      },
      "stock_status": "active",
      "bid": "695.42",
      "ask": "695.49",
      "last": "695.54"
    }
  ]
}

Headers

Authorization
string<JWT>
required

User API token.

Body

application/json
strategy_id
string
required

Strategy ID.

allocations
object[]
required

An array of positions the strategy should be allocated to.

slippage
number
default:0.002

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.
Required range: 0 <= x <= 2Must be a multiple of 0.001

Response

Request was successful.