Endpoint | Method | Description | Parameters |
---|---|---|---|
/api/login |
POST | Аутентификация и получение токена |
|
/api/submit_order |
POST | Отправить рыночную заявку Без указания цены. Заявка исполнится по лучшей доступной цене на бирже |
|
/api/trades |
GET | Получить свои сделки за сегодня | Можно посмотреть в раздле "My Trading" |
/api/positions |
GET | Получить свои открытые позиции | Можно посмотреть в раздле "My Trading" |
/api/bot_trade_limits |
GET | Получить информацию о лимитах торговли для своих ботов |
|
Есть ограничения на количество сделок:
/api/bot_trade_limits
для отслеживания лимитовПолучи токен и используй его во всех последующих запросах.
curl -X POST "https://arenago.ru/api/login" \
-H "Content-Type: application/json" \
-d '{
"nickname": "your_username",
"password": "your_password"
}'
import requests
url = "https://arenago.ru/api/login"
payload = {
"nickname": "your_username",
"password": "your_password"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
token = response.json().get("token")
print(f"Token: {token}")
{
"token": "your_authentication_token",
"message": "Authentication successful"
}
Используй токен аутентификации для отправки заявок на покупку или продажу доступных ценных бумаг.
curl -X POST "https://arenago.ru/api/submit_order" \
-H "Content-Type: application/json" \
-H "Authorization: your_token" \
-d '{
"direction": "B",
"secid": "SBER",
"position": 100,
"bot": "MyTradingBot"
}'
import requests
url = "https://arenago.ru/api/submit_order"
payload = {
"direction": "B", # "B" for Buy, "S" for Sell
"secid": "SBER", # Stock ticker
"position": 100, # Capital amount (1-100)
"bot": "MyTradingBot" # Your bot's name
}
headers = {
"Content-Type": "application/json",
"Authorization": "your_token"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
{
"success": true,
"message": "Trade submitted successfully",
"trade_limits": {
"bot_name": "MyTradingBot",
"trades_today": 251,
"max_trades": 1000,
"remaining_trades": 749
}
}
{"error": "ERROR: MARKET CLOSED"} - Trading hours: 07:00 - 15:40 MSK
{"error": "ERROR: NOT VALID SECID"} - Security ID not in allowed list
{"error": "ERROR: SUBMIT MAX COUNT LIMIT EXCEEDED"} - Reached max 1000 trades per day
{"error": "ERROR: BOT {bot_name} HAS REACHED DAILY TRADE LIMIT OF 1000"} - Bot specific trade limit reached
{"error": "ERROR: MAX POSITION EXCEEDED"} - Total position exceeds 100 limit
Проверяй, сколько сделок осталось у каждого бота на сегодня
import requests
url = "https://arenago.ru/api/bot_trade_limits"
headers = {"Authorization": "your_token"}
response = requests.get(url, headers=headers)
data = response.json()
print(f"Date: {data['date']}")
for bot in data['bot_limits']:
print(f"Bot: {bot['bot_name']}")
print(f" Trades Today: {bot['trades_today']}")
print(f" Remaining: {bot['remaining_trades']} of {bot['max_trades']}")
{
"date": "2025-04-14",
"bot_limits": [
{
"bot_name": "MyTradingBot",
"trades_today": 250,
"max_trades": 1000,
"remaining_trades": 750,
"last_updated": "2025-04-14T15:30:25.123456"
},
{
"bot_name": "AlphaTrader",
"trades_today": 520,
"max_trades": 1000,
"remaining_trades": 480,
"last_updated": "2025-04-14T15:45:12.654321"
}
]
}
Получи информацию о сделках и текущих позициях, чтобы отслеживать их эффективность
import requests
url = "https://arenago.ru/api/trades"
headers = {"Authorization": "your_token"}
response = requests.get(url, headers=headers)
trades = response.json()
for trade in trades:
print(f"{trade['tradedate']} {trade['tradetime']}: "
f"{trade['direction']} {trade['secid']} "
f"x{trade['position']} by {trade['bot']}")
import requests
url = "https://arenago.ru/api/positions"
headers = {"Authorization": "your_token"}
response = requests.get(url, headers=headers)
positions = response.json()
for pos in positions:
print(f"{pos['secid']}: {pos['position']} units "
f"(updated: {pos['updatetime']}, "
f"bot: {pos['bot']})")
Для торговли доступны 29 ценных бумаг:
Полные правила и подробности соревнования смотри на странице Arena Rules