> ## Documentation Index
> Fetch the complete documentation index at: https://api.alphainsider.com/llms.txt
> Use this file to discover all available pages before exploring further.

# newOrderAllocations

> Create new orders based on percentage allocations.



## OpenAPI

````yaml /openapi.yaml post /newOrderAllocations
openapi: 3.1.0
info:
  title: AlphaInsider
  version: '1.0'
  description: >-
    The official API and websocket documentation for
    [AlphaInsider.com](https://alphainsider.com/)
servers:
  - url: https://alphainsider.com/api
security: []
tags:
  - name: Introduction
  - name: Authentication
  - name: Users
  - name: Strategies
  - name: Subscriptions
  - name: Payments
  - name: Withdrawals
  - name: Timelines
  - name: Stocks
  - name: Trades
  - name: Webhooks
  - name: Bots
  - name: Websockets
paths:
  /newOrderAllocations:
    post:
      tags:
        - Trades
      summary: newOrderAllocations
      description: Create new orders based on percentage allocations.
      operationId: newOrderAllocations
      parameters:
        - $ref: '#/components/parameters/api_token'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - strategy_id
                - allocations
              properties:
                strategy_id:
                  $ref: '#/components/schemas/strategy_id'
                allocations:
                  type: array
                  description: An array of positions the strategy should be allocated to.
                  items:
                    $ref: '#/components/schemas/allocations'
                slippage:
                  type: number
                  minimum: 0
                  maximum: 2
                  multipleOf: 0.001
                  default: 0.002
                  description: >-
                    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.
      responses:
        '200':
          description: Request was successful.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    $ref: '#/components/schemas/success'
                  response:
                    type: array
                    description: >-
                      Endpoint-specific response payload, or an error message
                      when `success` is false.
                    items:
                      type: object
                      properties:
                        order_id:
                          $ref: '#/components/schemas/order_id'
                        strategy_id:
                          $ref: '#/components/schemas/strategy_id'
                        type:
                          type: string
                          enum:
                            - market
                            - limit
                            - stop_market
                            - stop_limit
                            - oco
                            - liquidate
                          description: Type or category for this object.
                        action:
                          type: string
                          enum:
                            - buy
                            - sell
                          description: Order or signal action.
                        stop_price:
                          type:
                            - string
                            - 'null'
                          description: Stop trigger price.
                        price:
                          type:
                            - string
                            - 'null'
                          description: Price or execution price, depending on context.
                        amount:
                          type:
                            - string
                            - 'null'
                          description: Amount.
                        total:
                          type: string
                          description: >-
                            Total value; for positions/orders this is
                            strategy-normalized unless documented otherwise.
                        created_at:
                          $ref: '#/components/schemas/created_at'
                        stock_id:
                          $ref: '#/components/schemas/stock_id'
                        figi_composite:
                          type: string
                          description: Composite FIGI identifier when available.
                        symbol:
                          type: string
                          description: Ticker or asset symbol.
                        name:
                          type: string
                          description: Display name.
                        sector:
                          type: string
                          description: Sector or asset category.
                        security:
                          type: string
                          enum:
                            - cryptocurrency
                            - stock
                          description: Security type, such as stock or cryptocurrency.
                        exchange:
                          type: string
                          description: Exchange code.
                        stock:
                          type: string
                          description: Stock symbol as stored by AlphaInsider.
                        peg:
                          type: string
                          description: Peg or quote currency.
                        provider:
                          type: string
                          enum:
                            - coinbase
                            - binance
                            - massive
                            - alphainsider
                          description: External provider or data provider.
                        slippage:
                          type: string
                          description: Slippage value or configured slippage fraction.
                        fee:
                          type: string
                          description: Fee value.
                        links:
                          type: object
                          description: External research and market-data links.
                        stock_status:
                          type: string
                          enum:
                            - active
                            - deleted
                          description: Current stock status.
                        bid:
                          type: string
                          description: Current bid price.
                        ask:
                          type: string
                          description: Current ask price.
                        last:
                          type: string
                          description: Last traded price.
                        order_dependencies:
                          type: array
                          description: >-
                            Order IDs this order is waiting on; `[]` means the
                            order has no outstanding dependencies.
                          items:
                            type: string
              examples:
                '200':
                  value:
                    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: ARCX
                        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'
                        order_dependencies: []
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
components:
  parameters:
    api_token:
      in: header
      name: Authorization
      description: User API token.
      required: true
      schema:
        type: string
        format: JWT
  schemas:
    strategy_id:
      type: string
      description: AlphaInsider strategy identifier.
    allocations:
      type: object
      description: Array of positions, in percents, for the strategy to go into.
      properties:
        stock_id:
          $ref: '#/components/schemas/stock_id'
        action:
          type: string
          description: >-
            Order actions. Action "buy" is the same as "long", "sell" is the
            same as "short", "close" is the same as "flat". When using "close"
            or "flat", the percent is set to 0—ignoring any percent passed.
          enum:
            - buy
            - long
            - sell
            - short
            - close
            - flat
        percent:
          type: number
          description: >-
            The final position size, expressed as a positive decimal fraction of
            your equity (e.g., TSLA long 1.5 for a 150% long position in TSLA).
            Values must be positive decimals ranging from 0 to 2, with the sum
            of all allocations not exceeding the maximum leverage of 2 (or
            200%).
          minimum: 0
          maximum: 2
          multipleOf: 0.0001
    success:
      type: boolean
      description: True when the request succeeded.
    order_id:
      type: string
      description: Order identifier.
    created_at:
      type: string
      format: date-time
      description: Creation timestamp.
    stock_id:
      type: string
      description: AlphaInsider stock identifier, or `SYMBOL:EXCHANGE` in requests.
  responses:
    '400':
      description: Request failed.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                description: False when the request failed.
              response:
                type: string
                description: Error message.
          examples:
            '400':
              value:
                success: false
                response: Request failed.
    '401':
      description: Authentication failed.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                description: False when the request failed.
              response:
                type: string
                description: Error message.
          examples:
            '401':
              value:
                success: false
                response: Authentication failed.

````