Skip to main content
POST
/
newOrderWebhook
newOrderWebhook
curl --request POST \
  --url https://alphainsider.com/api/newOrderWebhook \
  --header 'Content-Type: application/json' \
  --data '
{
  "strategy_id": "string",
  "stock_id": "string",
  "action": "{{strategy.market_position}}",
  "leverage": 1.5,
  "api_token": "string"
}
'
{
  "success": true,
  "response": {
    "order_id": "qoppbNXH4lG0-4x21YLCp",
    "strategy_id": "7Wy5AzIKY9bCmkIqjcLSg",
    "type": "market",
    "action": "sell",
    "stop_price": null,
    "price": null,
    "amount": "0.000200000000000",
    "total": null,
    "created_at": "2024-10-22T21:47:19.540Z",
    "stock_id": "v3lhjrwEhNuAOxPT29oxO",
    "figi_composite": null,
    "symbol": "ETH-USD",
    "name": "Ethereum",
    "sector": "Cryptocurrencies",
    "security": "cryptocurrency",
    "exchange": "COINBASE",
    "stock": "ETH",
    "peg": "USD",
    "provider": "coinbase",
    "slippage": "0.000000000000000",
    "fee": "0.002500000000000",
    "links": {
      "trading_view": "https://www.tradingview.com/symbols/ETHUSD/?exchange=COINBASE",
      "yahoo_finance": "https://finance.yahoo.com/quote/ETH-USD",
      "coin_marketcap": "https://coinmarketcap.com/currencies/ethereum/",
      "google_finance": "https://www.google.com/finance/quote/ETH-USD"
    },
    "stock_status": "active",
    "bid": "2633.43",
    "ask": "2633.43",
    "last": "2633.43"
  }
}

Body

application/json
strategy_id
string
required

Strategy ID.

stock_id
string
required

Stock ID. "stock:exchange" or "stock_id"

action
enum<string>
required

Order actions. Action "buy" is the same as "long", "sell" is the same as "short", "close" is the same as "flat". It is recommended for TradingView webhooks to use the {{strategy.market_position}} to get all strategy actions. See TradingView strategy alert guide for full list of automated actions.

Available options:
buy,
long,
sell,
short,
close,
flat
api_token
string<JWT>
required

User API token with newOrderWebhook permission.

leverage
number

Leverage to trade at. When not set, buys go 1x long and sells close. WARNING: 2x leverage orders may fail if prices move; use less than 1.95x for reliable fills.

Required range: 0 <= x <= 2Must be a multiple of 0.01

Response

Request was successful.