Trade Bot API

Bot information and maintainces

All the trade bot endpoints require a signature

Get all Trade Bots

Returns:

List of `TradeBot` objects.

Example URL:

http://127.0.0.1:8050/AllTradeBots

Backtest Trade Bot

Required input:

  • botGuid : the guid of the bot.

  • startUnix : the unix start time in seconds

  • endUnix : the unix start time in seconds

Returns:

`TradeBot` object.

Example URL:

http://127.0.0.1:8050/BackTestTradeBot?botGuid=29a242a9-ac4b-4d55-bd16-7e7fcf1084d7&startUnix=1528111773&endUnix=1528118973

Setup trade amount (spot)

Required input:

  • botGuid : the guid of the bot.

  • coinPosition : string of 'EnumCoinsPosition'

  • tradeAmount : number

  • lastBuyPrice : number

  • lastSellPrice : number

  • buyTemplateId : string

  • sellTemplateId : string

  • highSpeedEnabled : boolean

  • allIn : boolean

  • orderTimeout : number

  • templateTimeout : number

  • maxTradeAmount : boolean

  • limitOrderType : number

  • useHiddenOrders : boolean

  • fee : number

Returns:

`TradeBot` object.

Example URL:

Setup trade amount (margin/leverage)

Required input:

  • botGuid : the guid of the bot.

  • fundsPosition : string of 'EnumFundsPosition'

  • tradeAmount : number

  • lastLongPrice : number

  • lastShortPrice : number

  • enterTemplateId : string

  • exitTemplateId : string

  • highSpeedEnabled : boolean

  • allIn : boolean

  • orderTimeout : number

  • templateTimeout : number

  • maxTradeAmount : boolean

  • limitOrderType : number

  • useHiddenOrders : boolean

  • fee : number

Returns:

`TradeBot` object.

Example URL:

Add indicator

Required input:

  • botGuid : the guid of the bot.

  • indicatorType : string of 'EnumIndicator'

Returns:

`TradeBot` object.

Example URL:

Add insurance

Required input:

  • botGuid : the guid of the bot.

  • insuranceType : string of 'EnumInsurance'

Returns:

`TradeBot` object.

Example URL:

Add safety

Required input:

  • botGuid : the guid of the bot.

  • safetyType : string of 'EnumSafety'

Returns:

`TradeBot` object.

Example URL:

Setup Trade Bot

Required input:

  • botGuid : the guid of the bot.

  • accountGuid : the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market (optional)

  • leverage : number,

  • groupId : string

  • useConsensus : boolean

  • copyMarketToElements : boolean

Returns:

`TradeBot` object.

Example URL:

Setup Trade Bot indicator

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

  • priceSourceName : string of 'EnumPriceSource'

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market (optional)

  • delay : number,

  • priceChartType : string of 'EnumPriceChartType'

Returns:

`TradeBot` object.

Example URL:

Setup Trade Bot indicator signals (spot)

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

  • useBuySignal : boolean

  • useSellSignal : boolean

  • reverseSignals : boolean

  • standAlone : boolean

Returns:

`TradeBot` object.

Example URL:

Setup Trade Bot indicator signals (leverage)

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

  • useLongSignals : boolean

  • useNoPositionSignals : boolean

  • useShortSignals : boolean

  • reverseSignals : boolean

  • standAlone : boolean

mappedLongSignal: string of EnumFundsPosition mappedShortSignal: string of EnumFundsPosition Returns:

`TradeBot` object.

Example URL:

Setup Trade Bot safety

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

  • priceSourceName : string of 'EnumPriceSource'

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market (optional)

  • mappedBuySignal : string of 'EnumFundsPosition'

  • mappedSellSignal : string of 'EnumFundsPosition'

  • validPositionSignal: string of `EnumSafetyPositionSignal`

Returns:

`TradeBot` object.

Example URL:

Clean Trade Bot

Required input:

  • botGuid : the guid of the bot.

Returns:

`TradeBot` object.

Example URL:

Clone indicator

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element to clone.

  • toBotGuid : the guid of the bot to which the element is cloned

Returns:

`TradeBot` object.

Example URL:

Clone insurance

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element to clone.

  • toBotGuid : the guid of the bot to which the element is cloned

Returns:

`TradeBot` object.

Example URL:

Clone safety

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element to clone.

  • toBotGuid : the guid of the bot to which the element is cloned

Returns:

`TradeBot` object.

Example URL:

Clone Trade Bot

Required input:

  • botGuid : the guid of the bot.

  • botName : the name of the new bot.

  • accountGuid : the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market (optional)

  • leverage : the leverage of the market.

  • copySafeties : boolean

  • copyIndicators : boolean

  • copyInsurances : boolean

  • copyParameters : boolean

  • copyMarketToElements : boolean

Returns:

`TradeBot` object of the new bot.

Example URL:

Edit Trade Bot indicator setting

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

  • fieldNo : the index value of the property

  • value : the new value of the property.

Returns:

`TradeBot` object of the bot.

Example URL:

Edit Trade Bot insurance setting

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

  • fieldNo : the index value of the property

  • value : the new value of the property.

Returns:

`TradeBot` object of the bot.

Example URL:

Edit Trade Bot safety setting

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

  • fieldNo : the index value of the property

  • value : the new value of the property.

Returns:

`TradeBot` object of the bot.

Example URL:

Lock Trade Bot

Required input:

  • botGuid : the guid of the bot.

  • lockBot : boolean

Returns:

Boolean.

Example URL:

New Trade Bot

Required input:

  • botName : the name of the new bot.

  • accountGuid : the guid of the account.

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market (optional)

  • leverage : the leverage of the market.

  • groupId : the guid of the group (optional)

Returns:

`TradeBot` object of the new bot.

Example URL:

Remove indicator

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

Returns:

`TradeBot` object of the bot.

Example URL:

Remove insurance

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

Returns:

`TradeBot` object of the bot.

Example URL:

Remove safety

Required input:

  • botGuid : the guid of the bot.

  • elementGuid : the guid of the element

Returns:

`TradeBot` object of the bot.

Example URL:

Remove Trade Bot

Required input:

  • botGuid : the guid of the bot.

Returns:

Boolean

Example URL:

Switch Trade Bot coin positions

Required input:

  • botGuid : the guid of the bot.

  • coinPosition : string of 'EnumCoinsPosition'

Returns:

`TradeBot` object of the bot.

Example URL:

Switch Trade Bot funds positions

Required input:

  • botGuid : the guid of the bot.

  • fundsPosition : string of 'EnumFundsPosition'

Returns:

`TradeBot` object of the bot.

Example URL:

Switch Trade Bot coin positions with order

Required input:

  • botGuid : the guid of the bot.

  • templateGuid : the guid of the template executed.

Returns:

`TradeBot` object of the bot.

Example URL:

Switch Trade Bot funds positions with order

Required input:

  • botGuid : the guid of the bot.

  • fundsPosition : string of 'EnumFundsPosition'

  • templateGuid : the guid of the template executed.

Returns:

`TradeBot` object of the bot.

Example URL:

Last updated

Was this helpful?