newStrategy
curl --request POST \
--url https://alphainsider.com/api/newStrategy \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"input_value": 123
}
'const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', input_value: 123})
};
fetch('https://alphainsider.com/api/newStrategy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alphainsider.com/api/newStrategy"
payload = {
"name": "<string>",
"input_value": 123
}
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/newStrategy",
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([
'name' => '<string>',
'input_value' => 123
]),
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/newStrategy"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"input_value\": 123\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": {
"strategy_id": "WuRnay0CF3P1oPRSdogj5",
"product_id": "1bRPI9xQHhE23KpAXViKW",
"user_id": "user_1",
"type": "stock",
"private": false,
"name": "Test strategy",
"description": "",
"categories": [],
"updated_at": "2024-10-22T20:44:42.391Z",
"created_at": "2024-10-22T20:44:42.391Z",
"price": 0,
"subscriber_count": "0",
"timeframes": [
{
"timeframe": "day",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
},
{
"timeframe": "week",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
},
{
"timeframe": "month",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
},
{
"timeframe": "year",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
},
{
"timeframe": "five_year",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
}
]
}
}{
"success": false,
"response": "Request failed."
}{
"success": false,
"response": "Authentication failed."
}Strategies
newStrategy
Create new strategy.
POST
/
newStrategy
newStrategy
curl --request POST \
--url https://alphainsider.com/api/newStrategy \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"input_value": 123
}
'const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', input_value: 123})
};
fetch('https://alphainsider.com/api/newStrategy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://alphainsider.com/api/newStrategy"
payload = {
"name": "<string>",
"input_value": 123
}
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/newStrategy",
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([
'name' => '<string>',
'input_value' => 123
]),
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/newStrategy"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"input_value\": 123\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": {
"strategy_id": "WuRnay0CF3P1oPRSdogj5",
"product_id": "1bRPI9xQHhE23KpAXViKW",
"user_id": "user_1",
"type": "stock",
"private": false,
"name": "Test strategy",
"description": "",
"categories": [],
"updated_at": "2024-10-22T20:44:42.391Z",
"created_at": "2024-10-22T20:44:42.391Z",
"price": 0,
"subscriber_count": "0",
"timeframes": [
{
"timeframe": "day",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
},
{
"timeframe": "week",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
},
{
"timeframe": "month",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
},
{
"timeframe": "year",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
},
{
"timeframe": "five_year",
"rank_performance": null,
"rank_popular": null,
"rank_trending": null,
"rank_top": null,
"max_drawdown": "0.000000000000000",
"past_value": "1.000000000000000"
}
]
}
}{
"success": false,
"response": "Request failed."
}{
"success": false,
"response": "Authentication failed."
}Headers
User API token.
Body
application/json
Strategy security type.
Available options:
stock, cryptocurrency Strategy name.
Relative starting balance.
Whether strategy is public or private.
Strategy description.
Monthly subscription price.
⌘I