Update Bot

This endpoint allows you to create a bot from a rental bot template. Please note that each Marketplace bot is known as a rental bot template.

Update existing bot

POST https://api.aitrade.com/api/bots/{bot_id}

Request Body

Name
Type
Required
Description

exchange_pair_id

integer

stock_code

string

Stock symbol

initial_fund

float

Fund allocation for the bot

frequency

integer

options are, 1,5,15,60,240,1440

base_order_type

string

Options static, dynamic. Static will always use the same Base Order Limit set, regardless of the bots performance. Dynamic allows the bot to use profits from it’s previous trades for it’s next trade or lowers the base order if it has encountered a loss previously

order_type

string

Options are limit,market . Limit order is normally used to ensure price level especially when your take profit level is small. Market order is typically used when you need to ensure immediate Filled condition

base_order_percentage

integer

Base order limt

profit

float

take profit percentage

stop_loss

float

Stop loss percentage

name

string

A name to identify the bot created

bot_indicators

Object

indicator_triggers_entry

integer

Number of entry indicators

indicator_triggers_exit

integer

Number of exit indicators

category

string

manual, marketplace, marketplace_custom

Bot Indicator Parameter Sample

Both exit and entry indicators are send together as an array of an object . To get the default available indicators please refer to Indicators API

Several indicators support settings that require more than two values. In such cases, utilize value3, value4, value5, and value6 accordingly. If a setting does not apply to a specific indicator, pass null

   {
        "id": null, // Id null when creating new and is returned after creating bot. Has to pass id when updating 
        "name": "EMA",
        "description": null,
        "period_num": 50,
        "value2": 9,
        "value3": null, // null if there is no values for the indicator setting
        "value4": null,
        "value5": null,
        "value6": null,
        "updated_at": null,
        "created_at": null,
        "indicator_id": 2, // should match the id of the indicator from indicator api. 
        "type": "entry"
    },
    {
        "id": null,
        "name": "Stochastic RSI",
        "description": null,
        "period_num": 14,
        "value2": 18.5,
        "value3": 81.5,
        "value4": 1,
        "value5": 18.5,
        "value6": 81.5,
        "updated_at": null,
        "created_at": null,
        "indicator_id": 3,
        "type": "exit"
    }
]

Responses:

  • Success (200): Returns the details of the bot that has been created or updated. Details include ID, name, status, and other specific settings.

  • Failure (401): Unauthenticated, indicating you're not logged in or lack permission to carry out the request.

  • Failure (500): Server error.

{
    "code": 200,
    "message": "Success",
    "bot": {
        "id": 13331,
        "user_id": 1,
        "name": "New Bot",
        "status": "active",
        "frequency": 15,
        "exchange_pair_id": 2,
        "strategy": "Long",
        "initial_fund": 1000,
        "base_order_percentage": 50,
        "base_order_type": "static",
        "extra_order_percentage": 25,
        "stop_loss": 0,
        "updated_at": "2024-03-26 16:13:59",
        "created_at": "2024-03-26 16:13:59",
        "pair_id": 1,
        "order_type": "market",
        "indicators":[],
        "category":"manual",
    }
}

Last updated