curl --request POST \
--url https://alphainsider.com/api/newOrder \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"strategy_id": "<string>",
"stock_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({strategy_id: '<string>', stock_id: '<string>'})
};
fetch('https://alphainsider.com/api/newOrder', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alphainsider.com/api/newOrder"
payload = {
"strategy_id": "<string>",
"stock_id": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://alphainsider.com/api/newOrder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'strategy_id' => '<string>',
'stock_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://alphainsider.com/api/newOrder"
payload := strings.NewReader("{\n \"strategy_id\": \"<string>\",\n \"stock_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"response": {
"order_id": "qoppbNXH4lG0-4x21YLCp",
"strategy_id": "7Wy5AzIKY9bCmkIqjcLSg",
"type": "limit",
"action": "sell",
"stop_price": null,
"price": "4000.000000000000000",
"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-USD",
"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",
"order_dependencies": []
}
}{
"success": false,
"response": "Request failed."
}{
"success": false,
"response": "Authentication failed."
}newOrder
Create an open order with exactly one positive normalized amount or total. Limit orders require price; stop-market orders require stop_price; stop-limit and OCO orders require both. Prices must be positive market prices. For OCO buys, price <= bid <= stop_price; for sells, stop_price <= ask <= price. Acceptance does not mean the order has filled. For percentage targets or signals, see newOrderWebhook or newOrderAllocations.
curl --request POST \
--url https://alphainsider.com/api/newOrder \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"strategy_id": "<string>",
"stock_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({strategy_id: '<string>', stock_id: '<string>'})
};
fetch('https://alphainsider.com/api/newOrder', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alphainsider.com/api/newOrder"
payload = {
"strategy_id": "<string>",
"stock_id": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://alphainsider.com/api/newOrder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'strategy_id' => '<string>',
'stock_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://alphainsider.com/api/newOrder"
payload := strings.NewReader("{\n \"strategy_id\": \"<string>\",\n \"stock_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"response": {
"order_id": "qoppbNXH4lG0-4x21YLCp",
"strategy_id": "7Wy5AzIKY9bCmkIqjcLSg",
"type": "limit",
"action": "sell",
"stop_price": null,
"price": "4000.000000000000000",
"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-USD",
"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",
"order_dependencies": []
}
}{
"success": false,
"response": "Request failed."
}{
"success": false,
"response": "Authentication failed."
}Headers
User API token.
Body
AlphaInsider strategy identifier.
AlphaInsider stock identifier, or SYMBOL:EXCHANGE in requests.
Order action.
buy, sell Type of order.
market, limit, stop_market, stop_limit, oco Positive normalized quantity to receive on a buy or remove on a sell. Supply exactly one of amount or total.
Positive normalized cash to spend on a buy or receive on a sell, with fee effects included. Supply exactly one of amount or total.
Positive market-price limit. Required for limit, stop_limit, and oco orders.
Positive market-price trigger. Required for stop_market, stop_limit, and oco orders.
Same-strategy open order IDs to wait on. Removal by execution or cancellation releases the dependency; it does not prove a fill.