- REST API:
https://alphainsider.com/api - WebSocket:
wss://alphainsider.com/ws - OpenAPI: https://api.alphainsider.com/openapi.yaml
- Skill guide: https://api.alphainsider.com/skill.md
Core model
AlphaInsider strategies use normalized internal values:strategy_valuemeasures the strategy’s normalized portfolio value.- Position
amountand orderamount/totalare strategy-normalized units. price,bid,ask,last, and stop/limit prices are real market prices.input_multiplierconverts strategy-normalized units into the user’s display units.- Fetch
input_multiplierfromGET /getStrategySubscriptions. - Preview a subscriber calculation with
GET /getStrategyCalculation; save it withPOST /updateStrategyCalculation. Supplystrategy_id,input_value, andinput_date, then use the returned multiplier. - API numeric values may arrive as strings. Convert before doing math.
strategy_value, position amount, and order total before showing them as dollars or shares.Missing multiplier
Strategy owners have aninput_multiplier. If yours is missing, refresh the subscription/calculation context before displaying values or sizing fixed orders.Subscribers may have input_multiplier: null. When it is missing:- Do not silently treat it as
1. - Show clearly labeled percentages derived from
strategy_value, or supplyinput_valueandinput_datefor a calculation. - Do not size a fixed
newOrderfrom user-visible shares/USD until a multiplier exists.
Display formulas
Use these formulas when showing positions, cash, shares, crypto, or portfolio values to a user.Use
bid for long assets, ask for short liabilities, and 1 for cash.For example, a normalized quantity of 0.0125 with a multiplier of 4000 represents 50 shares. A normalized portfolio value of 3 represents $12,000. The multiplier must be positive, and percentage calculations require a nonzero denominator. If a required value is missing or invalid, leave that calculation unavailable.The portfolio percentage describes its value relative to the normalized starting value. A strategy_value of 1.2 means 120% of that baseline, or a 20% gain from a baseline of 1.Margin interest
Strategies pay interest on borrowed cash, like a margin account. Every hour, AlphaInsider charges each active strategy with negative cash and adds the charge to that negative cash, which lowers the strategy value and its performance. The annual rate is 6.5% for stock strategies and 6% for cryptocurrency strategies, accrued over a 365-day year including weekends and holidays. Positive cash earns no interest, short positions pay no borrow fee, and the charge does not create a trade or timeline event.For example, $8,760 of borrowed cash in a stock strategy costs $0.065 per hour:8760 * 0.065 / 365 / 24.Order endpoint choice
Check
GET /getMaxOrderSize before large or leveraged fixed orders. Its quantity and cash limits use the same normalized units as order inputs. A returned cash capacity of 2 with a multiplier of 4000 represents $8,000 before reserves for fees and slippage.newOrder
newOrder accepts exactly one of amount or total.amountis strategy-normalized shares or crypto units.totalis strategy-normalized cash.- If the user gives a share or crypto count, send
amount = user_visible_amount / input_multiplier. - If the user gives a USD amount, send
total = user_visible_dollars / input_multiplier. - Do not use
newOrderwith user-visible shares/USD wheninput_multiplieris missing.
getOrders, newOrder, newOrderAllocations, newOrderWebhook, and wsOrders include order_dependencies as prerequisite order IDs. [] means no outstanding prerequisite.An amount order fixes the quantity received on a buy or removed on a sell. A total order fixes the cash spent on a buy or received on a sell. Fees affect the other side: buying an exact quantity costs more than quantity times price, while selling an exact quantity returns less. Prices and stop prices stay in market-price units.Limit orders require price; stop-market orders require stop_price; stop-limit and OCO orders require both. An accepted order is open and may wait for a price trigger, a prerequisite, or an open market. Check positions and trade activity before treating it as completed. Cancelling a prerequisite releases dependent orders, so check the remaining orders after a cancellation.newOrderAllocations
Use newOrderAllocations when the user wants target portfolio percents instead of exact shares/USD.Before submitting allocation-generated orders, this endpoint cancels any existing open orders for the strategy.- Send target percents as documented in OpenAPI.
- Do not apply
input_multiplier. - Do not send
order_dependenciesin the request. - Allocation-generated increase orders may depend on reduce orders; read returned
order_dependenciesbefore assuming an order can fill immediately. - Send the complete desired position set. Omitted positions close; an empty list closes all positions. Fractions such as
0.25mean 25%.
Webhooks and streams
newOrderWebhook is for signal-style actions and uses api_token in the body. It does not need multiplier math. By default each alert goes fully in or out of the position at leverage; the optional pyramiding integer splits entry into steps across same-direction alerts. AlphaInsider calculates each step’s order size.Before submitting a new order, newOrderWebhook cancels any existing open orders for the strategy.For live displays, subscribe to:wsStrategyValue:<strategy_id>for livestrategy_value.wsPositions:<strategy_id>for position changes.wsOrders:<strategy_id>for open order changes andorder_dependencies.