Local API Documentation

From Haasonline Software Wiki
Jump to: navigation, search

Examples: https://github.com/Haasonline


Contents

Authentication

  • Arrange the parameters in ascending alphabetical order
  • Combine them with &. Don't URL encode them.
  • Encode complete string to UTF8.
  • Create a SHA256 signature from the encoded string and the Local API token.
  • Remove - from the signature
  • Make sure the signature is upper case.
  • Add "&sig=signature" to the URL.

C#

public string CreateSignature(Dictionary<string, string> parameters, string privateKey)
{
    var parametersString = string.Empty;
    foreach (var parameter in parameters.OrderBy(c => c.Key))
        parametersString += $"&{parameter.Key}={parameter.Value}";

    parametersString = parametersString.TrimStart('&');
    var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(privateKey));
    var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(parametersString));
    var sig = BitConverter.ToString(hash).Replace("-", "");

    return sig;
}

Python

import hmac
import hashlib
import collections
from typing import Dict


    @staticmethod
    def generate_signature(parameters: Dict[str, str], privatekey: str):
        parameter_string = ""

        parameters = collections.OrderedDict(sorted(parameters.items()))

        for key, value in parameters.items():
            parameter_string += "&" + str(key) + "=" + str(value)

        parameter_string = parameter_string.replace("&", "", 1)

        key = bytes(privatekey, 'UTF-8')
        message = bytes(parameter_string, 'UTF-8')

        digester = hmac.new(key, message, hashlib.sha256)
        signature = digester.digest()
        signature = signature.hex().replace("-", "").upper()

        return parameter_string, signature

Bash

echo -n $parameters | iconv -f ascii -t utf8 | openssl sha256 -hmac "$key" | awk '{ print toupper($2) }'

FileMaker v17

HexEncode (CryptAuthCode ( "abc + UTF-8 ordered parameters in other words string"; "SHA256"; "local api key" ))

Response

Response Object

public class HaasonlineClientResponse<T>
{
    public EnumErrorCode ErrorCode { get; set; }
    public string ErrorMessage { get; set; }

    public T Result { get; set; }
}

Error Codes

100 Success
1001 InvalidRequest
1002 InvalidSignature
1003 InvalidBotGuid
1004 InvalidBotElementGuid
1005 InvalidAccountGuid
1006 InvalidMarket
1007 InvalidEnum
1008 InvalidParameter
1020 PriceSourceNotActive
1021 PriceMarketIsSyncing
1022 MissingParameter
2000 UnkownError

Software API

Get software details

Returns:

Object of `SoftwareInformation`

Example URL:

http://127.0.0.1:8050/GetSoftwareDetails

Market Data API

Get all price sources

Returns:

List of all available price sources

Example URL:

http://127.0.0.1:8050/GetAllPriceSources

Get enabled price sources

Example URL: Returns:

List of all enabled price sources

Example URL:

http://127.0.0.1:8050/GetEnabledPriceSources

Get price markets

Required input:

  • priceSourceName : string of EnumPriceSource

Returns:

List of 'Market'

Example URL:

http://127.0.0.1:8050/GetPriceMarkets?priceSourceName=Bitfinex

Get price ticker

Required input:

  • priceSourceName : string of EnumPriceSource
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • contractName : contract name of the market (optional)

Returns:

'PriceTick' object of the last tick.

Example URL:

http://127.0.0.1:8050/GetPriceTicker?priceSourceName=Bitfinex&primaryCoin=BTC&secondaryCoin=USD&contractName=
http://127.0.0.1:8050/GetPriceTicker?priceSourceName=BitMEX&primaryCoin=XBT&secondaryCoin=USD&contractName=

Get minute price ticker

Required input:

  • priceSourceName : string of EnumPriceSource
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • contractName : contract name of the market (optional)

Returns:

'PriceTick' object of the last minute tick.

Example URL:

http://127.0.0.1:8050/GetMinutePriceTicker?priceSourceName=Bitfinex&primaryCoin=BTC&secondaryCoin=USD&contractName=

Get last trades

Required input:

  • priceSourceName : string of EnumPriceSource
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • contractName : contract name of the market (optional)

Returns:

List of 'Trade'

Example URL:

http://127.0.0.1:8050/GetLastTrades?priceSourceName=Bitfinex&primaryCoin=BTC&secondaryCoin=USD&contractName=

Get orderbook

Required input: Required input:

  • priceSourceName : string of EnumPriceSource
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • contractName : contract name of the market (optional)

Returns:

'Orderbook' object.

Example URL:

http://127.0.0.1:8050/GetOrderbook?priceSourceName=Bitfinex&primaryCoin=BTC&secondaryCoin=USD&contractName=

Get history

Required input:

  • priceSourceName : string of EnumPriceSource
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • contractName : contract name of the market (optional)
  • interval : number,
  • depth : number

Returns:

List of 'PriceTick' objects

Example URL:

http://127.0.0.1:8050/GetHistory?priceSourceName=Bitfinex&primaryCoin=BTC&secondaryCoin=USD&contractName=&interval=1&depth=100


Account Data API

All the account data endpoints require a signature

Get accounts

Returns:

A dictionary where the keys are the account guid and the values are the account names.

Example URL:

http://127.0.0.1:8050/GetEnabledAccounts

Get all accounts details

Returns:

A dictionary where the keys are the account guid and the values are objects of `AccountInformation`.

Example URL:

http://127.0.0.1:8050/GetAllAccountDetails

Get account details

Required input:

  • accountGuid : the guid of the account

Returns:

Object of `AccountInformation`.

Example URL:

http://127.0.0.1:8050/GetAccountDetails?accountGuid=06c09cbf-a7fe-49c2-9be5-4e59b93b5121

Adjust wallet of simulated account

Required input:

  • accountGuid : the guid of the account
  • coin : the coin to adjust
  • amount : the new amount. Set on 0 to remove the coin from the wallet.

Returns:

Object of `Wallet`.

Example URL:

http://127.0.0.1:8050/SimulatedAccountAddOrAdjustCoinAmount?accountGuid=06c09cbf-a7fe-49c2-9be5-4e59b93b5121&coin=BTC&amount=12

Clear wallet of simulated account

Required input:

  • accountGuid : the guid of the account

Returns:

Object of `Wallet`.

Example URL:

http://127.0.0.1:8050/SimulatedAccountClearWallet?accountGuid=06c09cbf-a7fe-49c2-9be5-4e59b93b5121

Get wallet

Required input:

  • accountGuid : the guid of the account

Returns:

A `Wallet` object.

Example URL:

http://127.0.0.1:8050/GetWallet?accountGuid=06c09cbf-a7fe-49c2-9be5-4e59b93b5121

Get open orders

Required input:

  • accountGuid : the guid of the account

Returns:

A `OrderContainer` object.

Example URL:

http://127.0.0.1:8050/GetOpenOrders?accountGuid=06c09cbf-a7fe-49c2-9be5-4e59b93b5121

Get available order templates

Returns:

A dictionary where the keys are the template guid and the values are the template names.

Example URL:

http://127.0.0.1:8050/GetOrderTemplates


Trade API

All the trade endpoints require a signature

Execute

Place spot order

Required input:

  • account : the guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • price : the price on which the order is placed. Use 0 for market order.
  • amount : the amount of the order is the base currency.
  • timeout : order timeout in seconds (optional)
  • templateGuid : the guid of the template executed (optional).
  • userGuid : custom guid (optional)

Returns:

The executing template guid.

Example URL:

http://127.0.0.1:8050/PlaceSpotBuyOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&priceSourceName=Bittrex&primaryCoin=BTC&secondaryCoin=USDT&price=100&amount=1
http://127.0.0.1:8050/PlaceSpotSellOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&priceSourceName=Bittrex&primaryCoin=BTC&secondaryCoin=USDT&price=100&amount=1

Place margin/leverage order

Required input:

  • accountGuid : the guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • contractName : contract name of the market
  • price : the price on which the order is placed. Use 0 for market order.
  • amount : the amount of the order is the base currency.
  • leverage : the leverage of the order.
  • timeout : order timeout in seconds (optional)
  • templateGuid : the guid of the template executed (optional).
  • userGuid : custom guid (optional)

Returns:

The executing template guid.

Example URL:

http://127.0.0.1:8050/PlaceLeverageEnterLongOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageEnterShortOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100000&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageExitLongOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageExitShortOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100000&amount=1&leverage=1

Cancel

Cancel template

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

A boolean indicating if the cancel is started.

Example URL:

http://127.0.0.1:8050/CancelTemplate?templateGuid=ea25296b-2c83-4e88-b0ff-680394a22f0f

Cancel order

Required input:

  • accountGuid : the account guid on which the order is active.
  • orderGuid : the order returned in GetOpenOrders()

Returns:

`EnumOrderStatus`

Example URL:

http://127.0.0.1:8050/CancelOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&orderGuid=ea25296b-2c83-4e88-b0ff-680394a22f0f

Status

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

`EnumOrderStatus`

Example URL:

http://127.0.0.1:8050/GetTemplateStatus?templateGuid=02264ffa-ac1f-4976-8228-8227a1a09298

Advanced Order API

All the trade endpoints require a signature

Get Advanced Orders

Required input:

Returns:

object with the guid as key and `AdvancedOrderBase` as value.

Example URL:

http://127.0.0.1:8040/GetAdvancedOrders

Activate Advanced Order

Required input:

  • guid : the guid of the advanced order

Returns:

`AdvancedOrderBase`

Example URL:

http://127.0.0.1:8040/ActivateAdvancedOrder?guid=74b0673d-b6d5-4769-b3d7-49f432ad21a8

Deactivate Advanced Order

Required input:

  • guid : the guid of the advanced order

Returns:

`AdvancedOrderBase`

Example URL:

http://127.0.0.1:8040/DeactivateAdvancedOrder?guid=74b0673d-b6d5-4769-b3d7-49f432ad21a8

Remove Advanced Order

Required input:

  • guid : the guid of the advanced order

Returns:

boolean

Example URL:

http://127.0.0.1:8040/RemoveAdvancedOrder?guid=74b0673d-b6d5-4769-b3d7-49f432ad21a8

Add Stop Order

Required input:

  • 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 order
  • name : the name of the advanced order
  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`
  • amount : number
  • triggerPrice : the stop price
  • executionPrice : the price on which to place the order when the stop has triggered
  • executingTemplateGuid : the template guid which is used to place the order once the stop has triggered.
  • activate : boolean
  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.
  • startOrderPrice : the price on which to place the start order.
  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`StopTakeProfitOrder`

Example URL:

http://127.0.0.1:8040/AddStopOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=False&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&executionPrice=3000&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&triggerPrice=10000

Setup Stop Order

Required input:

  • guid : the guid of the advanced order
  • 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 order
  • name : the name of the advanced order
  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`
  • amount : number
  • triggerPrice : the stop price
  • executionPrice : the price on which to place the order when the stop has triggered
  • executingTemplateGuid : the template guid which is used to place the order once the stop has triggered.
  • activate : boolean
  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.
  • startOrderPrice : the price on which to place the start order.
  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`StopTakeProfitOrder`

Example URL:

http://127.0.0.1:8040/SetupStopOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=False&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&executionPrice=3000&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&triggerPrice=10000


Add Take Profit Order

Required input:

  • 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 order
  • name : the name of the advanced order
  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`
  • amount : number
  • triggerPrice : the take profit price
  • executionPrice : the price on which to place the order when the take profit has triggered
  • executingTemplateGuid : the template guid which is used to place the order once the take profit has triggered.
  • activate : boolean
  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.
  • startOrderPrice : the price on which to place the start order.
  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`StopTakeProfitOrder`

Example URL:

http://127.0.0.1:8040/AddTakeProfitOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=False&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&executionPrice=3000&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&triggerPrice=10000

Setup Take Profit Order

Required input:

  • guid : the guid of the advanced order
  • 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 order
  • name : the name of the advanced order
  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`
  • amount : number
  • triggerPrice : the take profit price
  • executionPrice : the price on which to place the order when the take profit has triggered
  • executingTemplateGuid : the template guid which is used to place the order once the take profit has triggered.
  • activate : boolean
  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.
  • startOrderPrice : the price on which to place the start order.
  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`StopTakeProfitOrder`

Example URL:

http://127.0.0.1:8040/SetupTakeProfitOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=False&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&executionPrice=3000&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&triggerPrice=10000


Add Trailing Stop

Required input:

  • 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 order
  • name : the name of the advanced order
  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`
  • amount : number
  • trailingStopPercentage : the trailing stop percentage
  • executingTemplateGuid : the template guid which is used to place the order once the take profit has triggered.
  • activate : boolean
  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.
  • startOrderPrice : the price on which to place the start order.
  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`TrailingStop`

Example URL:

http://127.0.0.1:8040/AddTrailingStopOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=True&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&trailingStopPercentage=18.5

Setup Take Profit Order

Required input:

  • guid : the guid of the advanced order
  • 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 order
  • name : the name of the advanced order
  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`
  • amount : number
  • trailingStopPercentage : the trailing stop percentage
  • executingTemplateGuid : the template guid which is used to place the order once the take profit has triggered.
  • activate : boolean
  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.
  • startOrderPrice : the price on which to place the start order.
  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`TrailingStop`

Example URL:

http://127.0.0.1:8040/SetupTrailingStopOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=True&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&trailingStopPercentage=18.5


Trade Bot API

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:

http://127.0.0.1:8050/SetupSpotBotTradeAmount?botGuid=1b180c86-f737-4e14-b08a-1db215f6cbff&coinPosition=Sold&tradeAmount=0.8&lastBuyPrice=123&lastSellPrice=234&buyTemplateId=buyTemplateId&sellTemplateId=sellTemplateId&highSpeedEnabled=True&allIn=False&orderTimeout=99&templateTimeout=123&maxTradeAmount=True&limitOrderType=PlaceOnFirstOrder&useHiddenOrders=True&fee=0.234

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:

http://127.0.0.1:8050/SetupLeverageBotTradeAmount?botGuid=1d2fa841-925e-4ffc-9595-b11b378bca83&fundsPosition=Long&tradeAmount=2&lastLongPrice=123&lastShortPrice=234&enterTemplateId=enterTemplateGuid&exitTemplateId=exitTemplateGuid&highSpeedEnabled=True&allIn=False&orderTimeout=99&templateTimeout=123&maxTradeAmount=True&limitOrderType=PlaceOnFirstOrder&useHiddenOrders=True&fee=0.234


Add indicator

Required input:

  • botGuid : the guid of the bot.
  • indicatorType : string of 'EnumIndicator'

Returns:

`TradeBot` object.

Example URL:

http://127.0.0.1:8050/AddIndicator?botGuid=feba7016-8b81-4e6d-9ad3-7485043ff613&indicatorType=Aroon

Add insurance

Required input:

  • botGuid : the guid of the bot.
  • insuranceType : string of 'EnumInsurance'

Returns:

`TradeBot` object.

Example URL:

http://127.0.0.1:8050/AddInsurance?botGuid=0905204b-742f-428c-877c-7fc4dced195a&insuranceType=AbsolutePriceChange

Add safety

Required input:

  • botGuid : the guid of the bot.
  • safetyType : string of 'EnumSafety'

Returns:

`TradeBot` object.

Example URL:

http://127.0.0.1:8050/AddSafety?botGuid=072b4b8e-f2b4-453c-8327-9721666d0985&safetyType=StopLossDynamic

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:

http://127.0.0.1:8050/SetupTradeBot?botGuid=dd386251-43fd-4568-baa0-e8ea02dd3a06&botName=RenamedBot&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&contractName=&leverage=4&groupId=TestGroupId&useConsensus=False&copyMarketToElements=True

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:

http://127.0.0.1:8050/SetupTradeBotIndicator?botGuid=8f5f227c-d478-4458-9ae5-bb4264e816ff&elementGuid=bfca868c-8597-461c-a06e-19a294a720b8&priceSourceName=Bittrex&primaryCoin=ETH&secondaryCoin=BTC&contractName=&interval=60&delay=60&priceChartType=HeikinAshi

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:

http://127.0.0.1:8050/SetupTradeBotIndicatorSpotSignals?botGuid=ea2ebcfe-c023-47f5-81be-712674b5bf2f&elementGuid=4f2a6fe5-20e6-4496-a920-404b5d25c4c4&useBuySignal=False&useSellSignal=False&reverseSignals=True&standAlone=True

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:

http://127.0.0.1:8050/SetupTradeBotIndicatorLeverageSignals?botGuid=f72bda0b-88cf-4e1e-9b41-6823e0c38683&elementGuid=6ed3da80-4b14-4fd6-a3fa-9b8a99a2fe1c&useLongSignals=False&useNoPositionSignals=False&useShortSignals=False&reverseSignals=True&standAlone=True&mappedLongSignal=Short&mappedShortSignal=Long

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'

Returns:

`TradeBot` object.

Example URL:

http://127.0.0.1:8050/SetupTradeBotSafety?botGuid=5a5e2cbc-6964-4953-aa7c-83ff22030abf&elementGuid=61f68eb4-e198-46e8-91a2-226fa22e4536&priceSourceName=Bittrex&primaryCoin=ETH&secondaryCoin=BTC&contractName=&mappedBuySignal=Short&mappedSellSignal=Long

Clean Trade Bot

Required input:

  • botGuid : the guid of the bot.

Returns:

`TradeBot` object.

Example URL:

http://127.0.0.1:8050/CleanTradeBot?botGuid=32774185-dcdc-48da-b783-4bdc90600c75

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:

http://127.0.0.1:8050/CloneIndicator?botGuid=d896e230-dd69-4984-bd55-59d3e3cae7e3&elementGuid=1983681d-d188-4210-b8e8-f6f6bd19ee3e&toBotGuid=d896e230-dd69-4984-bd55-59d3e3cae7e3

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:

http://127.0.0.1:8050/CloneInsurance?botGuid=38831011-0779-4615-ae01-d0117e7dbb2d&elementGuid=1d9d8dfe-6e51-4387-84be-a6591ae38c54&toBotGuid=38831011-0779-4615-ae01-d0117e7dbb2d

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:

http://127.0.0.1:8050/CloneSafety?botGuid=072b4b8e-f2b4-453c-8327-9721666d0985&elementGuid=3b1a4729-ec3f-4ed4-b50b-a18394c511f7&toBotGuid=072b4b8e-f2b4-453c-8327-9721666d0985

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:

http://127.0.0.1:8050/CloneTradeBot?botGuid=ea1d7324-2fb2-4749-baaf-5653b0124605&botName=ClonedBot&accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&leverage=4&copySafeties=True&copyIndicators=True&copyInsurances=True&copyParameters=True&copyMarketToElements=True

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:

http://127.0.0.1:8050/EditTradeBotIndicatorSetting?botGuid=ddd45404-e153-4047-8156-e0f28b8dd641&elementGuid=47e2ade0-7d11-43cb-964a-643ed923fb2f&fieldNo=0&value=99

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:

http://127.0.0.1:8050/EditTradeBotInsuranceSetting?botGuid=0905204b-742f-428c-877c-7fc4dced195a&elementGuid=daf8cc25-19ff-4b14-82f3-30da34def1e4&fieldNo=0&value=99

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:

http://127.0.0.1:8050/EditTradeBotSafetySetting?botGuid=a2515ebe-44f7-4326-918d-43a4fa7b86fd&elementGuid=321331c2-8465-49f3-a832-33a4dbc192b8&fieldNo=0&value=99

Lock Trade Bot

Required input:

  • botGuid : the guid of the bot.
  • lockBot : boolean

Returns:

Boolean.

Example URL:

http://127.0.0.1:8050/LockTradeBot?botGuid=227f5c17-12e2-4e4e-9173-6e32b2acaab7&lockBot=False
http://127.0.0.1:8050/LockTradeBot?botGuid=227f5c17-12e2-4e4e-9173-6e32b2acaab7&lockBot=True

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:

http://127.0.0.1:8050/NewTradeBot?botName=LocalApiBot&accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&leverage=2&groupId=

Remove indicator

Required input:

  • botGuid : the guid of the bot.
  • elementGuid : the guid of the element

Returns:

`TradeBot` object of the bot.

Example URL:

http://127.0.0.1:8050/RemoveIndicator?botGuid=9c7ae522-b8c3-44cf-883b-7edfda520d0b&elementGuid=6e895853-e3c6-41c6-aa1e-04f7673d219c

Remove insurance

Required input:

  • botGuid : the guid of the bot.
  • elementGuid : the guid of the element

Returns:

`TradeBot` object of the bot.

Example URL:

http://127.0.0.1:8050/RemoveInsurance?botGuid=1bf22dad-8598-4755-9428-d0e92fe74716&elementGuid=8fff8c01-2b29-4548-961c-bc3524acf946

Remove safety

Required input:

  • botGuid : the guid of the bot.
  • elementGuid : the guid of the element

Returns:

`TradeBot` object of the bot.

Example URL:

http://127.0.0.1:8050/RemoveSafety?botGuid=66cd1c92-e1b1-4d1f-ab36-9dc73eecc4fb&elementGuid=57d9c0c0-bc77-422c-b34b-9e2bf0f78a4c

Remove Trade Bot

Required input:

  • botGuid : the guid of the bot.

Returns:

Boolean

Example URL:

http://127.0.0.1:8050/RemoveTradeBot?botGuid=072b4b8e-f2b4-453c-8327-9721666d0985

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:

http://127.0.0.1:8050/SwitchTradeBotCoinPositions?botGuid=f6e61295-bf40-40d6-86d0-fd6464422dd9&coinPosition=Sold

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:

http://127.0.0.1:8050/SwitchTradeBotFundsPositions?botGuid=d3d6a700-a09e-4ae7-a107-c6865a88d175&fundsPosition=Short

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:

http://127.0.0.1:8050/SwitchTradeBotCoinPositionsWithOrder?botGuid=bd568f21-45a1-44eb-bf73-503ef3e79061&templateGuid=LOCKEDLIMITORDERGUID


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:

http://127.0.0.1:8050/SwitchTradeBotFundsPositionsWithOrder?botGuid=fb9c8079-70aa-42cd-a57f-7f1715adacb9&templateGuid=LOCKEDLIMITORDERGUID&fundsPosition=Long


Custom Bot API

All the custom bot endpoints require a signature

Generic

Get all custom bots

Returns:

List of `BaseCustomBot` objects

Example URL:

http://127.0.0.1:8050/AllCustomBots

Get custom bot

Required input:

  • botGuid : the guid of the bot.

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/GetCustomBot?botGuid=fa6158c1-7a35-4688-91a4-ed0f94a4532b

New custom bot

Required input:

  • botType : string of 'EnumCustomBotType'
  • botName : string
  • accountGuid : guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • contractName : contract name of the market (optional)

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/NewCustomBot?botType=ZoneRecoveryBot&botName=LocalAPIBot&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=BTC&secondaryCoin=USDT&contractName=

Activate custom bot

Required input:

  • botGuid : guid of the bot
  • extra : boolean. Only relevant for the Crypto Index Box. When true, excessive balance will be reallocate.

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/ActivateCustomBot?botGuid=03f028e9-2c98-4028-9288-e21a1f08604c&extra=true

Deactivate custom bot

Required input:

  • botGuid : guid of the bot
  • extra : boolean. Relevant for the Flash Crash, Market Making, & Order bot. When true, all open orders will be canceled.

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/DeactivateCustomBot?botGuid=03f028e9-2c98-4028-9288-e21a1f08604c&extra=true

Remove custom bot

Required input:

  • botGuid : guid of the bot

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/RemoveCustomBot?botGuid=03f028e9-2c98-4028-9288-e21a1f08604c

Backtest custom bot

Required input:

  • botGuid : guid of the bot
  • minutesToTest : minutes to test

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/BacktestCustomBot?botGuid=1c3949e1-6144-47fc-8829-cf02dba35236&minutesToTest=120

Backtest custom bot specific dates

Required input:

  • startUnix : start unix time in seconds
  • endUnix : end unix time in seconds

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/BacktestCustomBotSpecific?botGuid=1c3949e1-6144-47fc-8829-cf02dba35236&startUnix=152961117&endUnix=1529622217

Backtest custom bot specific markets

This endpoint will clone the bot, adjust the market, run a backtest and destroy the bot. Use this to backtest on multiple markets without triggering the market tracking. Required input:

  • botGuid : guid of the bot
  • minutesToTest : minutes to test
  • 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)

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/BacktestCustomBotOnMarket?botGuid=1c3949e1-6144-47fc-8829-cf02dba35236&minutesToTest=120&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&contractName=

Clear custom bot

Required input:

  • botGuid : guid of the bot

Returns:

`BaseCustomBot` object of the bot.

Example URL:

http://127.0.0.1:8050/ClearCustomBot?botGuid=6bcc0aa4-c0da-498f-99f0-0942c1145704

Clone custom bot

Required input:

  • botGuid : guid of the bot
  • botName : 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 bot

Returns:

`TradeBot` object of the bot.

Example URL:

http://127.0.0.1:8050/CloneCustomBot?botGuid=1ac120fe-0cfc-47cf-af8f-1e7ec64874eb&botName=LocalAPIBot2&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&contractName=&leverage=1

Clone custom bot simple

Required input:

  • botGuid : guid of the bot
  • botName : name of the new bot
  • accountGuid : the guid of the account

Returns:

`TradeBot` object of the bot.

Example URL:

http://127.0.0.1:8050/CloneCustomBotSimple?botGuid=32320095-6921-41c8-9dbe-e2f8f9b1acc7&botName=LocalAPIBot2&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4

Setup

Setup Accumulation Bot

Required input:

  • botName : new name of the bot
  • botGuid : guid of the bot
  • accountGuid : the guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • stopTypeValue : number
  • randomOrderSizeX : number
  • randomOrderSizeY : number
  • randomOrderTimeX : number
  • randomOrderTimeY : number
  • triggerValue : number
  • triggerWhenHigher : bool
  • triggerOnPrice : number
  • stopType : string of 'EnumAccumulationBotStopType'
  • direction : string of 'EnumOrderType'

Returns:

`AccumulationBot` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupAccumulationBot?botName=RenamedLocalApi&botGuid=724e6582-8779-41c8-92b9-53c72779a8fd&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&stopTypeValue=20&randomOrderSizeX=10.5&randomOrderSizeY=20.5&randomOrderTimeX=30&randomOrderTimeY=40&triggerValue=10000&triggerWhenHigher=True&triggerOnPrice=True&stopType=Timer&direction=Sell

Setup Crypto Index Bot

Required input:

  • botName : new name of the bot
  • botGuid : guid of the bot
  • accountGuid : the guid of the account
  • templateGuid : string of the template guid to execute
  • baseCoin : string
  • totalIndexValue : number
  • individualGrowth : boolean
  • allocateProfits : boolean
  • index : list of 'CryptoIndexBotIndexSaveObject'

Returns:

`CryptoIndexBot` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupCryptoIndexBot?botGuid=384bb7b4-54df-4773-af40-205116f31a12&botName=RenamedLocalApi&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&templateGuid=LOCKEDMARKETORDERGUID&baseCoin=USDT&totalIndexValue=10000&individualGrowth=True&allocateProfits=True&index=[{"Coin":"ETH","Amount":50.0,"BuyThreshold":10.0,"SellThreshold":5.0,"StopLoss":30.0}]

Setup Email Bot

Required input:

  • botName : new name of the bot
  • botGuid : 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
  • position : primary or secondary currency for spot. long, short or noposition for margin/leverage
  • templateGuid : string of the template guid to execute
  • fee : number
  • leverage : number
  • tradeAmount : number
  • stopLoss : number
  • minChangeToBuy : number
  • minChangeToSell : number
  • emails : list of 'EmailBotAction' objects

Returns:

`EmailBot` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupEmailBot?botGuid=f4125396-7ec7-49e5-9b73-370806de0356&botName=RenamedLocalApi&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&contractName=&position=BTC&templateGuid=LOCKETMARKETORDERGUID&fee=0.3&leverage=2&tradeAmount=12.3&stopLoss=5.2&minChangeToBuy=0.3&minChangeToSell=0.4&emails=[{"Guid":"5683efd7-0d2b-4173-8e26-9343f37338be","ProviderGuid":"LOCKETMARKETORDERGUID","Messages":[{"Message":"Test-Message","LastReceivedTime":0}],"TimeoutInSeconds":100,"SpotAction":2,"LeverageAction":0}]

Setup Flash Crash Bot

Required input:

  • botName : new name of the bot
  • botGuid : guid of the bot
  • accountGuid : the guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • fee : number
  • basePrice : number
  • priceSpreadType : string of 'EnumFlashSpreadOptions'
  • priceSpread : number
  • percentageBoost : number
  • minPercentage : number
  • maxPercentage : number
  • amountType : number
  • amountSpread : string of 'EnumCurrencyType'
  • sellAmount : number
  • buyAmount : number
  • refillDelay : number
  • fttEnabled : boolean
  • fttOffset : number
  • fttRange : number
  • fttTimeout : number
  • safetyTriggerLevel : number
  • safetyEnabled : boolean
  • safetyMoveInOut : boolean

Returns:

`FlashCrashBot` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupFlashCrashBot?botName=RenamedLocalApi&botGuid=6927d0ac-ee3d-4c6b-ac9c-150e3da136c0&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=ETH&secondaryCoin=BTC&fee=0&basePrice=100&priceSpreadType=FixedAmount&priceSpread=5&percentageBoost=10&minPercentage=1&maxPercentage=5&amountType=Base&amountSpread=10&sellAmount=0&buyAmount=100&refillDelay=10&fttEnabled=True&fttOffset=10&fttRange=1&fttTimeout=100&safetyTriggerLevel=15&safetyEnabled=True&safetyMoveInOut=True

Setup Intellibot Alice

Required input:

  • botName : new name of the bot
  • botGuid : 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
  • position : primary or secondary currency for spot. long, short or noposition for margin/leverage
  • fee : number
  • tradeAmount : number

Returns:

`BaseCustomBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupIntellibotAlice?botGuid=5430b1eb-c0a0-4456-952c-a39e16883569&botName=RenamedLocalApi&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&contractName=&leverage=2&tradeAmount=12.13&position=BTC&fee=0.5

Setup InterExchange Arbitrage Bot

Required input:

  • botName : new name of the bot
  • botGuid : guid of the bot
  • accountGuid : the guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • accountGuid2 : the guid of the second account
  • primaryCoin2 : primary coin of the seconds market.
  • secondaryCoin2 : secondary coin of the seconds market.
  • tradeAmount : number
  • triggerLevel : number
  • templateGuid : string of the template guid to execute
  • maxAmount : number
  • maxTrades : number

Returns:

'InterExchangeArbitrageBot' object of the bot.

Example URL:

http://127.0.0.1:8050/SetupInterExchangeArbitrageBot?botGuid=703a2c45-11f7-4e55-af41-f5eb7cd402d6&botName=RenamedLocalApi&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&accountGuid2=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin2=ETH&secondaryCoin2=USDT&tradeAmount=12.13&triggerLevel=2.3&templateGuid=TESTLIMITORDERGUID&maxAmount=123.123&maxTrades=123

Setup MadHatter Bot

Required input:

  • botName : new name of the bot
  • botGuid : guid of the bot
  • accountGuid : the guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • position : primary or secondary currency for spot. long, short or noposition for margin/leverage
  • fee : number
  • tradeAmount : number
  • useTwoSignals : boolean
  • interval : number
  • disableAfterStopLoss : boolean
  • includeIncompleteInterval : boolean

Returns:

`MadHatterBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupMadHatterBot?botName=RenamedLocalApi&botGuid=354ab64c-d6df-4629-a275-4fefb0cc53b3&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&templateGuid=TESTORDERLIMITGUID&position=BTC&fee=0.5&tradeAmount=12.13&useTwoSignals=True&disableAfterStopLoss=True&includeIncompleteInterval=True&interval=15

Setup Market Making Bot

Required input:

  • botName : new name of the bot
  • botGuid : guid of the bot
  • accountGuid : the guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.
  • fee : number
  • tradeAmount : number
  • priceOffset : number
  • resetTimer : number
  • useSecondOrder : boolean
  • secondOrderPriceOffset : number

Returns:

`MarketMarkingBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupMarketMakingBot?botGuid=03f028e9-2c98-4028-9288-e21a1f08604c&botName=RenamedLocalApi&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&tradeAmount=12.13&fee=0.5&priceOffset=1.2&resetTimer=9&useSecondOrder=True&secondOrderPriceOffset=2.4

Setup Order Bot

Required input:

  • botName : new name of the bot
  • botGuid : guid of the bot
  • accountGuid : the guid of the account
  • primaryCoin : primary coin of the market.
  • secondaryCoin : secondary coin of the market.

Returns:

`OrderBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupOrderBot?botName=RenamedLocalApi&botGuid=074b9895-5bf8-4424-adf9-6566cc2ab9ad&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC

Setup PingPong Bot

Required input:

  • botName : new name of the bot
  • botGuid : 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)
  • position : primary or secondary currency for spot. long, short or noposition for margin/leverage
  • fee : number
  • tradeAmount : number
  • leverage : number

Returns:

`BaseCustomBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupPingPongBot?botGuid=f9a93739-93d8-4762-85b3-06c7255a54be&botName=RenamedLocalApi&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&contractName=&leverage=2&tradeAmount=12.13&position=BTC&fee=0.5

Setup Scalping Bot

Required input:

  • botName : new name of the bot
  • botGuid : 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
  • position : primary or secondary currency for spot. long, short or noposition for margin/leverage
  • fee : number
  • targetProc : number
  • safetyThreshold : number

Returns:

`ScalperBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupScalpingBot?botGuid=0f4c552a-ba7f-44b9-8fd4-f107a9744db9&botName=RenamedLocalApi&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&contractName=&leverage=2&tradeAmount=12.13&targetProc=5&safetyThreshold=6&position=BTC&templateGuid=LOCKEDLIMIT&fee=0.5

Setup Script Bot

Required input:

  • botName : new name of the bot
  • botGuid : 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)
  • templateGuid : string
  • leverage : number
  • position : primary or secondary currency for spot. long, short or noposition for margin/leverage
  • fee : number
  • tradeAmount : number
  • scriptId : string

Returns:

`ScriptBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupScriptBot?botName=RenamedLocalApi&botGuid=bbff7e69-b493-4027-8c9c-491dc4f90297&accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&primaryCoin=LTC&secondaryCoin=BTC&contractName=&templateGuid=BTC&leverage=2&tradeAmount=12.13&fee=0.5&position=LOCKEDLIMIT&scriptId=TestScript

Setup Zone Recovery Bot

Required input:

  • botName : new name of the bot
  • botGuid : 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
  • tradeAmount : number,
  • maxTradeAmount : number,
  • factorShort : number,
  • factorLong : number,
  • targetProfit : number,
  • zone : number,

Returns:

`ZoneRecoveryBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/SetupZoneRecoveryBot?botGuid=cbabfecd-5dab-49c7-a4f7-3b7cef4648e9&botName=RenamedLocalApi&accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&leverage=2&tradeAmount=10&maxTradeAmount=10&factorShort=20&factorLong=30&targetProfit=40&zone=10

Accumulation Bot Specific

Flip Accumulation Bot

Required input:

  • botGuid : guid of the bot

Returns:

Boolean

Example URL:

http://127.0.0.1:8050/FlipAccumulationBot?botGuid=724e6582-8779-41c8-92b9-53c72779a8fd

Flash Crash Bot Specific

Live Order Edit Flash Crash Bot

Required input:

  • botGuid : guid of the bot
  • isBuyOrder : true for buy order, false for sell order
  • addOrder : true to add a order, false to remove a order

Returns:

`FlashCrashBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/LiveOrderEditFlashCrashBot?botGuid=6cd94ed3-eeaf-4044-b94f-a27e0925329f&isBuyOrder=True&addOrder=False
http://127.0.0.1:8050/LiveOrderEditFlashCrashBot?botGuid=a231b8aa-18d0-4874-ba5f-039c3697015c&isBuyOrder=True&addOrder=True
http://127.0.0.1:8050/LiveOrderEditFlashCrashBot?botGuid=ae7d9c8f-efc6-4239-9539-b556f272acd4&isBuyOrder=False&addOrder=True
http://127.0.0.1:8050/LiveOrderEditFlashCrashBot?botGuid=fcc85901-f9cc-4e6c-b0b0-1ce36f238100&isBuyOrder=False&addOrder=False

Quick Start

Required input:

  • botGuid : guid of the bot. Not required for QuickStartAllFlashCrashBots

Returns:

`FlashCrashBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/QuickStartAllFlashCrashBots
http://127.0.0.1:8050/QuickStartFlashCrashBot?botGuid=21d690ea-c577-4e97-8e83-cd5aeab35f93

MadHatter Bot Specific

Set Indicator Parameter

Required input:

  • botGuid : guid of the bot
  • type : string of 'EnumMadHatterIndicators'
  • fieldNo : the index value of the property
  • value : the new value of the property.

Returns:

`MadHatterBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/MadHatterSetIndicatorParameter?botGuid=354ab64c-d6df-4629-a275-4fefb0cc53b3&type=Bbands&fieldNo=2&value=22
http://127.0.0.1:8050/MadHatterSetIndicatorParameter?botGuid=73bdf47c-839b-4bda-ab23-59f3b2066a98&type=Rsi&fieldNo=2&value=22
http://127.0.0.1:8050/MadHatterSetIndicatorParameter?botGuid=ac42b0de-1127-4b16-aa6f-91edf30aa17a&type=Macd&fieldNo=2&value=22

Set Safety Parameter

Required input:

  • botGuid : guid of the bot
  • type : string of 'EnumMadHatterSafeties'
  • value : the new value of the property.

Returns:

`MadHatterBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/MadHatterSetSafetyParameter?botGuid=61e3e238-023b-4442-a9fb-3f751862ae34&type=StopLoss&value=22
http://127.0.0.1:8050/MadHatterSetSafetyParameter?botGuid=64e68e8d-d61e-46d0-b6a5-df5ce98ec8bd&type=PriceChangeToBuy&value=22
http://127.0.0.1:8050/MadHatterSetSafetyParameter?botGuid=f7226d29-d970-41fe-bd59-9f77d83bdfd1&type=PriceChangeToSell&value=22

Order Bot Specific

Add Order

Required input:

  • botGuid : guid of the bot
  • dependsOn : order id of other pre order
  • dependsOnNotExecuted : order id of other pre order
  • amount : number
  • price : number
  • orderTemplate :string of the template guid to execute
  • orderType : string of 'EnumOrderType'
  • triggerPrice : number (default 0)
  • triggerType : the new value of the property.

Returns:

`OrderBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/OrderBotAddOrder?botGuid=431b5902-fbb2-4102-a370-d0b226804bdf&dependsOn=1&dependsOnNotExecuted=2&amount=12.5&price=123.123&triggerPrice=100.4&orderTemplate=LIMITORDER&orderType=Buy&triggerType=HigherThan

Edit Order

Required input:

  • botGuid : guid of the bot
  • orderGuid : order id of the order.
  • dependsOn : order id of other pre order
  • dependsOnNotExecuted : order id of other pre order
  • amount : number
  • price : number
  • orderTemplate :string of the template guid to execute
  • orderType : string of 'EnumOrderType'
  • triggerPrice : number (default 0)
  • triggerType : the new value of the property.

Returns:

`OrderBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/OrderBotEditOrder?botGuid=fa6158c1-7a35-4688-91a4-ed0f94a4532b&orderGuid=5be5d122-883d-404f-b637-540047c113de&dependsOn=3&dependsOnNotExecuted=4&amount=102.5&price=1203.123&triggerPrice=99.5&orderTemplate=LIMITORDER2&orderType=Sell&triggerType=LowerThan

Remove Order

Required input:

  • botGuid : guid of the bot
  • orderGuid : order id of the order.

Returns:

`OrderBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/OrderBotRemoveOrder?botGuid=8a2b1745-da74-4937-96a4-d08f0abd9677&orderGuid=ca72abee-37db-4b8e-95ec-5d7a1d72b06a

Remove All Orders

Required input:

  • botGuid : guid of the bot

Returns:

`OrderBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/OrderBotRemoveAllOrders?botGuid=4808505c-6ec4-4019-ab92-01a25aa65063

Reset Order

Required input:

  • botGuid : guid of the bot
  • orderGuid : order id of the order.

Returns:

`OrderBot`` object of the bot.

Example URL:

http://127.0.0.1:8050/OrderBotResetOrder?botGuid=431b5902-fbb2-4102-a370-d0b226804bdf&orderGuid=021d5ab3-08e3-452e-a1d6-3e56c5d5ed4a

Enums

EnumAccumulationBotStopType

    public enum EnumAccumulationBotStopType
    {
        Timer = 0,
        MaxTotalAmount = 1
    }

EnumBotTradeResult

    public enum EnumBotTradeResult { 
        Stay = 0, 
        Buy = 1, 
        Sell = 2 
    }

EnumBotType

    public enum EnumBotType { 
        TradeBot = 0, 
        MarginBot = 1, 
        LeverageBot = 2 
    }

EnumCoinsPosition

    public enum EnumCoinsPosition { 
        Bought = 0, 
        Sold = 1 
    }

EnumCurrencyType

    public enum EnumCurrencyType { 
        Base = 0, 
        Quote = 1
    }

EnumCustomBotType

    public enum EnumCustomBotType
    {
        MarketMakingBot = 1,
        PingPongBot = 2,
        ScalperBot = 3,
        OrderBot = 4,
        FlashCrashBot = 6,
        InterExchangeArbitrage = 8,
        IntellibotAlice = 9,
        ZoneRecoveryBot = 12,
        AccumulationBot = 13,
        TrendLinesBot = 14,
        MadHatterBot = 15,
        ScriptBot = 16,
        CryptoIndexBot = 17,
        EmailBot = 19
    }

EnumFlashSpreadOptions

    public enum EnumFlashSpreadOptions
        {
        FixedAmount = 0,
        Percentage = 1,
        PercentageWithBoost = 2,
        Exponential = 3
    }

EnumFundsMovingPosition

    public enum EnumFundsMovingPosition { 
        EnterShort = 0, 
        ExitShort = 1, 
        EnterLong = 2, 
        ExitLong = 3 
    }

EnumFundsPosition

    public enum EnumFundsPosition { 
        NoPosition = 0, 
        Short = 1, 
        Long = 2 
    }

EnumIndicator

    public enum EnumIndicator
    {
        Aroon = 0,
        AroonOscillator = 1,
        AwesomeOscillator = 2,
        Blind = 3,
        BOP = 4,
        BBands = 5,
        BBandsB = 6,
        BBandsW = 7,
        BuyLowSellHighFixed = 8,
        BuyLowSellHighDynamic = 9,
        BBandsPshai = 51,
        CCI = 11,
        CMO = 12,
        CoppockCurve = 13,
        CRSI = 14,
        CandlePattern = 15,
        DEMA = 16,
        DEMA_New = 52,
        DonchianChannels = 17,
        DPO = 18,
        EMA = 19,
        EMA_New = 53,
        Elliot = 20,
        FastRSI = 21,
        Fibonacci = 22,
        Fractial = 23,
        IchimokuClouds = 24,
        KeltnerChannels = 26,
        KAMA = 27,
        KAMA_New = 54,
        KeltnerChannels_New = 55,
        MACD = 28,
        MACD_New = 69,
        MFI = 29,
        Momentum = 70,
        ROC = 30,
        ROCAlt = 31,
        RSI = 32,
        RSI_New = 59,
        RegressionSlobe = 33,
        SAR = 34,
        SlowRSI = 35,
        SMA = 36,
        StochRSI = 37,
        StochRSI_New = 62,
        Stochastic = 38,
        Stochastic2 = 39,
        SmallFractial = 40,
        ScriptIndicator = 41,
        TEMA = 42,
        TEMA_New = 63,
        TRIX = 43,
        TRIX_New = 64,
        TRIMA = 44,
        TRIMA_New = 65,
        TD = 71,
        TimedBlind = 49,
        UltimateOscillator = 46,
        UltimateOscillator_New = 66,
        WMA = 47,
        WilliamsW = 48,
        WilliamsR_New = 67,
        HaasScriptIndicator = 50
    }

EnumInsurances

    public enum EnumInsurances
    {
        AbsolutePriceChange = 0,
        BeProfitableInXTrades = 1,
        DisableOnLosses = 2,
        NeverSellCheaper = 3,
        NeverBuyHigher = 11,
        OvercomeFee = 4,
        OvercomeDoubleFee = 5,
        PercentagePriceChange = 6,
        ScriptInsurance = 7,
        StableTrendOnly = 8,
        StayProfitable = 9,
        TrendingTrendOnly = 10,
        HaasScriptInsurance = 12,
        WaitAfterOrder = 13
    }

EnumLimitOrderPriceType

    public enum EnumLimitOrderPriceType { 
        BeFirstOrder = 0, 
        PlaceOnFirstOrder = 1 
    }


EnumMadHatterIndicators

    public enum EnumMadHatterIndicators { 
        Macd = 0, 
        Rsi = 1, 
        Bbands = 2
    }


EnumMadHatterSafeties

    public enum EnumMadHatterSafeties { 
        StopLoss = 0, 
        PriceChangeToBuy = 1, 
        PriceChangeToSell = 2 
    }


EnumOrderBotTriggerType

    public enum EnumOrderBotTriggerType { 
        LowerThan = 0, 
        HigherThan = 1, 
        Normal = 2
    }


EnumOrderStatus

    public enum EnumOrderStatus { 
        UnKnown = 0, 
        Open = 3, 
        Completed = 5, 
        Canceled = 7 
    }

EnumOrderType

    public enum EnumOrderType { 
        Sell = 0, 
        Buy = 1 
    }

EnumPlatformType

    public enum EnumPlatformType { 
        SpotTrading = 0,
        MarginTrading = 1,
        LeverageTrading = 2
    }

EnumPriceChartType

    public enum EnumPriceChartType {
        Candlestick = 0,
        CandlestickHLC = 1,
        HeikinAshi = 2,
        OHLC = 3,
        HLC = 4,
        Line = 5,
        Mountain = 6,
        RedBlack = 7,
        Spread = 8
    }

EnumPriceSource

    public enum EnumPriceSource
    {
        Bitfinex = 1,
        BTCe = 4,
        CexIO = 5,
        OKCoinCOM = 8,
        OKCoinFutures = 9,
        Bitstamp = 10,
        Poloniex = 11,
        Coinbase = 12,
        Bittrex = 13,
        NovaExchange = 14,
        Kraken = 15,
        BitMEX = 17,
        ScriptedDriver = 18,
        CCex = 19,
        Gemini = 20,
        Binance = 21,
        HitBTC = 22,
        OKEX = 23,
        Huobi = 26,
        KuCoin = 27,
    }

EnumSafety

    public enum EnumSafety
    {
        CloseBeforeSettlement = 0,
        ClosePositionWithLoss = 14,
        ClosePositionWithProfit = 15,
        DeactivateBotAfterBuy = 12,
        DeactivateBotAfterSell = 13,
        DeavtivateBotAfterXTrades = 18,
        DeactiveBotAfterXIdleMinutes = 21,
        DeactiveBotAfterXActiveMinutes = 22,
        TradeOnTrendLines = 20,
        ForceToBoughtLong = 7,
        ForceToSoldShort = 8,
        PricePump = 16,
        PriceDump = 17,
        RoofInDynamic = 1,
        RoofInFixed = 2,
        RoofOutDynamic = 3,
        RoofOutFixed = 4,
        ResetBuyPrice = 10,
        ResetSellPrice = 11,
        StopLossFixed = 5,
        StopLossDynamic = 6,
        ScriptSafety = 9,
        HaasScriptSafety = 19
    }

EnumSlotType

    public enum EnumSlotType { 
        Buy = 0, 
        Sell = 1, 
        Empty = 2, 
    }

EnumTradeType

    public enum EnumTradeType { 
        Buy = 1, 
        Sell = 2 
    }


Data Objects

Market Data

Market

    public class Market
    {
        public EnumPriceSource PriceSource { get; set; }
        public string PrimaryCurrency { get; set; }
        public string SecondaryCurrency { get; set; }
        public string ContractName { get; set; }

        public string DisplayName { get; set; }
        public string ShortName { get; set; }

        public int AmountDecimals { get; set; }
        public int PriceDecimals { get; set; }
        public decimal MinimumTradeAmount { get; set; }
        public decimal MinimumTradeVolume { get; set; }

        public decimal TradeFee { get; set; }
        public int SettlementDate { get; set; }
    }

Orderbook

    public class Orderbook
    {
        public DateTime Timestamp { get; set; }
        public long UnixLastUpdate { get; set; }

        public Market PriceMarket { get; set; }
        public List<OrderbookRecord> Bid { get; set; }
        public List<OrderbookRecord> Ask { get; set; }
    }

Orderbook

    public class OrderbookRecord
    {
        public decimal Price { get; set; }
        public decimal Amount { get; set; }
    }

PriceTick

    public class PriceTick
    {
        public DateTime Timestamp { get; set; }
        public long UnixTimestamp { get; set; }

        public decimal Open { get; set; }
        public decimal HighValue { get; set; }
        public decimal LowValue { get; set; }
        public decimal Close { get; set; }
        public decimal Volume { get; set; }

        public decimal CurrentBuyValue { get; set; }
        public decimal CurrentSellValue { get; set; }
    }

Trade

    public class Trade
    {
        public DateTime Timestamp { get; set; }
        public long UnixTimestamp { get; set; }

        public EnumTradeType TradeType { get; set; }
        public decimal Price { get; set; }
        public decimal Amount { get; set; }
    }

TradeContainer

    public class TradeContainer
    {
        public DateTime Timestamp { get; set; }
        public long UnixTimestamp { get; set; }

        public List<Trade> LastTrades { get; set; }
    }

Account Data

AccountInformation

    public class AccountInformation
    {
        public string Guid { get; set; }
        public string Name { get; set; }
        public EnumPlatformType PlatformType { get; set; }
        public EnumPriceSource ConnectedPriceSource { get; set; }

        public bool IsSimulatedAccount { get; set; }
        public Dictionary<string, string> AvailableOrderTemplates { get; set; }
    }

Wallet

    public class Wallet
    {
        public Dictionary<string, decimal> Coins { get; set; }
        public Dictionary<string, Position> Positions { get; set; }
    }

Position

    public class Position
    {
        [JsonProperty("Position")]
        public EnumFundsPosition Side { get; set; }
        public decimal UsedMargin { get; set; }
        public decimal Amount { get; set; }
        public decimal Leverage { get; set; }
        public Market PriceMarket { get; set; }
        public decimal InvestmentPrice { get; set; }
        public decimal ProfitLossRatio { get; set; }
        public decimal ProfitLossNow { get; set; }
        public decimal MarginCallPrice { get; set; }
        public string AmountLabel { get; set; }
        public string ProfitLabel { get; set; }
    }

OrderContainer

    public class OrderContainer
    {
        [JsonProperty("ExchangeOrderList")]
        public Dictionary<string, BaseOrder> SpotOrders { get; set; }

        [JsonProperty("MarginOrderList")]
        public Dictionary<string, BaseOrder> MarginOrders { get; set; }

        [JsonProperty("LeverageOrderList")]
        public Dictionary<string, BaseOrder> LeverageOrders { get; set; }
    }

BaseOrder

    public class BaseOrder
    {
        public Market Market { get; set; }
        public string OrderId { get; set; }
        public EnumOrderStatus OrderStatus { get; set; }

        public EnumOrderType OrderType { get; set; }
        public EnumFundsMovingPosition FundsMovement { get; set; }

        public decimal Price { get; set; }
        public decimal Amount { get; set; }
        public decimal AmountFilled { get; set; }

        public DateTime AddedTime { get; set; } 
        public int UnixAddedTime { get; set; }
    }


Trade Bot Data

Trade Bot

    public class TradeBot
    {
        public EnumBotType BotType { get; set; }
        public string GUID { get; set; } 

        public string Name { get; set; } 
        public string AccountId { get; set; } 

        public bool Activated { get; set; }
        public decimal CurrentTradeAmount { get; set; }
        public decimal CurrentFeePercentage { get; set; }

        public EnumCoinsPosition CoinsPosition { get; set; }
        public EnumFundsPosition FundsPosition { get; set; }

        public decimal LastBuyPrice { get; set; } 
        public decimal LastSellPrice { get; set; }

        public decimal LastLongPrice { get; set; }
        public decimal LastShortPrice { get; set; }

        public bool AdjustAmountDown { get; set; } 
        public EnumLimitOrderPriceType LimitOrderType { get; set; }

        public int OpenOrderTimeout { get; set; }
        public int TemplateTimeout { get; set; }
        public bool GoAllIn { get; set; }

        public List<string> IssuedOrders { get; set; }
        public List<BaseOrder> CompletedOrders { get; set; } 

        public decimal ROI { get; set; }
        public decimal TotalFeeCosts { get; set; }
        public decimal TotalProfits { get; set; }

        public decimal LastPriceUpdate { get; set; }
        public decimal ContractValue { get; set; }
        public string GroupName { get; set; } 

        public TradeBotSignals BotSignals { get; set; } 

        public List<string> BotLogBook { get; set; }

        public Market PriceMarket { get; set; }
        public decimal Leverage { get; set; }

        public int UnixSettlementDate { get; set; }

        public bool HighFrequencyUpdates { get; set; }
        public bool UseHiddenOrders { get; set; }

        public string BuyOrderTemplateId { get; set; }
        public string SellOrderTemplateId { get; set; }

        public string EnterPositionOrderTemplateId { get; set; }
        public string ExitPositionOrderTemplateId { get; set; }

        public string ProfitLabel { get; set; }

        public string Notes { get; set; }
        public bool Locked { get; set; }
        public uint ActivatedSince { get; set; }
        public uint DeactivatedSince { get; set; }
        public bool ConsensusMode { get; set; }

        public Dictionary<string, Safety> Safeties { get; set; }
        public Dictionary<string, Indicator> Indicators { get; set; }
        public Dictionary<string, Insurance> Insurances { get; set; }
    }

TradeBotSignals

    public class TradeBotSignals
    {
        public bool PriceSourceConnected { get; set; }

        public bool AccountConnected { get; set; } 
        public bool TradeAmountOk { get; set; }
        public bool OpenOrdersOk { get; set; }
        public bool InBenchmark { get; set; }
        public bool IsSafetySignalNow { get; set; }

        public decimal MaxLongAmount { get; set; } 
        public decimal MaxNoPositionAmount { get; set; }
        public decimal MaxShortAmount { get; set; }

        public decimal MaxBuyAmount { get; set; } 
        public decimal MaxSellAmount { get; set; } 

        public int BotBuySellSignal = 50;  
        public int BotLongShortSignal = 50; 

        public DateTime LastPollMoment { get; set; } 
        public int UnixLastPollMoment { get; set; }

        public EnumBotTradeResult BuySellResult { get; set; } 
        public EnumFundsPosition LongShortResult { get; set; }
    }

Custom Bots

AccumulationBot

    public class AccumulationBot : BaseCustomBot
    {
        public int AmountDecimals { get; set; }
        public int PriceDecimals { get; set; }

        public long NextOrderTime { get; set; }

        public EnumOrderType OrderType { get; set; }
        public decimal AccumulatedSoFar { get; set; }

        public EnumAccumulationBotStopType StopType { get; set; }
        public decimal StopTypeValue { get; set; } = 0.0M;

        public int RandomOrderTimeX { get; set; } = 1;
        public int RandomOrderTimeY { get; set; } = 60;

        public decimal RandomOrderSizeX { get; set; } = 1;
        public decimal RandomOrderSizeY { get; set; } = 60;

        public bool TriggerOnPrice { get; set; }
        public bool TriggerWhenHigher { get; set; }
        public decimal TriggerValue { get; set; }
    }

BaseCustomBot

    public class BaseCustomBot
    {
        public EnumCustomBotType BotType { get; set; }
        public bool IsBacktesting { get; set; }
        public string GUID { get; set; }
        public string Name { get; set; }
        public string AccountId { get; set; }
        public Market PriceMarket { get; set; }
        public decimal Leverage { get; set; }

        public EnumCoinsPosition CoinPosition { get; set; }
        public EnumFundsPosition FundsPosition { get; set; }


        public decimal CurrentTradeAmount { get; set; }
        public decimal CorrectedTradeAmount { get; set; }

        public decimal LastBuyPrice { get; set; }
        public decimal LastSellPrice { get; set; }


        public decimal CurrentFeePercentage { get; set; } 
        public int SettlementDate { get; set; }
        public virtual string ProfitLabel { get; set; }
        public bool Activated { get; set; }
        public uint ActivatedSince { get; set; }
        public uint DeactivatedSince { get; set; }
        public bool StatusPriceSourceOk { get; set; }
        public bool StatusAccountOk { get; set; }
        public bool OpenOrdersOk { get; set; }
        public bool WalletOk { get; set; }

        public string OpenOrderId { get; set; }
        public decimal TotalFeeCosts { get; set; }
        public decimal TotalProfits { get; set; }
        public decimal ROI { get; set; }

        public decimal LastPriceUpdate { get; set; }
        public decimal ContractValue { get; set; }
        public long LastUpdateTime { get; set; }

        public string GroupName { get; set; }
        public string Notes { get; set; }

        public virtual string CustomTemplate { get; set; }

        public List<string> BotLogBook { get; set; }
        public List<BaseOrder> CompletedOrders { get; set; }
    }

CryptoIndexBot

    public class CryptoIndexBot : BaseCustomBot
    {
        public string BaseCoin { get; set; }
        public decimal CurrentTradeAmount { get; set; }
        public List<CryptoIndexBotIndex> Index { get; set; }

        public decimal TotalExtraBuy { get; set; }
        public decimal TotalExtraSell { get; set; }

        public bool IndividualCoinGrowth { get; set; } 
        public bool AllocateProfits { get; set; }
        public DateTime LastOrderTimestamp { get; set; }

        public Dictionary<string, decimal> MappendIndexes { get; set; }
        public Dictionary<string, CryptoIndexBotIndexResult> IndexResult { get; set; }
    }

EmailBot

    public class EmailBot : BaseCustomBot
    {
        public List<EmailBotAction> Actions { get; set; }
        public decimal StopLoss { get; set; }
        public decimal StopLossPrice { get; set; }

        // On leverage this is the minimum profit
        public decimal PriceChangeToBuy { get; set; }

        // On leverage this is the stop loss
        public decimal PriceChangeToSell { get; set; }
        public decimal PriceChangeTarget { get; set; }

        public decimal MaximumLossOnPosition
        {
            get { return PriceChangeToBuy; }
            set { }
        }

        public decimal MinimumProfitOnPosition
        {
            get { return PriceChangeToBuy; }
            set { }
        }

    }

FlashCrashBot

    public class FlashCrashBot : BaseCustomBot
    {
        public Dictionary<int, SlotObject> Slots { get; set; }
        public int BaseKey { get; set; }

        public decimal TotalBuyAmount { get; set; }
        public decimal TotalSellAmount { get; set; }

        public decimal BasePrice { get; set; }
        public bool IsStopping { get; set; }

        public EnumFlashSpreadOptions PriceSpreadType { get; set; }
        public decimal PriceSpread { get; set; }
        public decimal PercentageBoost { get; set; }

        public decimal AmountSpread { get; set; }
        public int AmountDecimals { get; set; }
        public int PriceDecimals { get; set; }

        public EnumCurrencyType AmountType { get; set; }
        public EnumFlashSpreadOptions AmountSpreadType { get; set; }
        public int RefillDelay { get; set; }

        public decimal MinPercentage { get; set; }
        public decimal MaxPercentage { get; set; }

        public bool QuickRestartPossible { get; set; }

        public bool FollowTheTrend { get; set; }
        public int FollowTheTrendTimeout { get; set; }
        public int FollowTheTrendChannelRange { get; set; }
        public int FollowTheTrendChannelOffset { get; set; }

        public bool SafetyEnabled { get; set; }
        public decimal SafetyTriggerLevel { get; set; }

        public bool SafetyMoveInOut { get; set; }
        public decimal SafetyMoveInOutTarget { get; set; }
    }

InterExchangeArbitrageBot

     public class InterExchangeArbitrageBot : BaseCustomBot
    {
        public decimal CurrentFeePercentage2 { get; set; }
        public decimal CurrentTradeAmount { get; set; }
        public string AccountId2 { get; set; }

        public Market PriceMarket2 { get; set; }

        public decimal TriggerLevel { get; set; }
        public bool MainAccountIsBought { get; set; }

        public PriceTick LastTick { get; set; }
        public PriceTick LastTick2 { get; set; }

        public int PriceDecimals1 { get; set; }
        public int PriceDecimals2 { get; set; }

        public string OpenOrderIDMain { get; set; }
        public string OpenOrderIDSecondairy { get; set; }

        public decimal TotalTradesSoFar { get; set; }
        public decimal MaxTradeAmount { get; set; }
        public int MaxTradesPerDay { get; set; }
    }

MadHatterBot

    public class MadHatterBot : BaseCustomBot
    {
        public int Interval { get; set; }

        public decimal StopLoss { get; set; }
        public decimal StopLossPrice { get; set; }
        public bool DisableAfterStopLoss { get; set; }

        public decimal PriceChangeToBuy { get; set; }
        public decimal PriceChangeToSell { get; set; }
        public decimal PriceChangeTarget { get; set; }

        public Indicator Macd { get; set; }
        public Indicator BBands { get; set; }
        public Indicator Rsi { get; set; }
        public bool UseTwoSignals { get; set; }
    }

MarketMarkingBot

    public class MarketMarkingBot : BaseCustomBot
    {
        public decimal TradeAmount { get; set; }
        public decimal CustomFee { get; set; }

        public MarketMarkingBotSlot FirstOrder { get; set; }
        public MarketMarkingBotSlot SecondOrder { get; set; }

        public decimal FirstOffset { get; set; }
        public decimal SecondOffset { get; set; }

        public bool UseSecondOrder { get; set; }
        public int ResetTimeout { get; set; }

        public PriceTick LastTick { get; set; }
    }

OrderBot

    public class OrderBot : BaseCustomBot
    {
        public List<OrderBotPreOrder> PreOrders { get; set; }
    }

ScalperBot

    public class ScalperBot : BaseCustomBot
    {
        public decimal MinimumTargetChange { get; set; }
        public decimal MaxAllowedReverseChange { get; set; }
    }

ScriptBot

    public class ScriptBot : BaseCustomBot
    {
        public Dictionary<string, ScriptBotOrder> OpenOrders { get; set; }

        public List<string> FinishedOrders { get; set; }
        public List<string> CancelledOrders { get; set; }
        public Dictionary<string, string> AvailableScript { get; set; }

        public string ScriptId { get; set; }
        public string FullScriptName { get; set; }

        public List<IndicatorOption> BotSettings { get; set; }
        public bool ScriptStatusOk { get; set; }
        public string LocalScriptPath { get; set; }

        public decimal LastLongBuyPrice { get; set; }
        public decimal LastShortBuyPrice { get; set; }
        public decimal LastLongSellPrice { get; set; }
        public decimal LastShortSellPrice { get; set; }
    }

ZoneRecoveryBot

    public class ZoneRecoveryBot : BaseCustomBot
    {
        public decimal FactorShort { get; set; }
        public decimal FactorLong { get; set; }
        public decimal ZoneFactor { get; set; }
        public decimal TargetPercentage { get; set; }
        public decimal TradeAmount { get; set; }
        public decimal MaxTradeAmount { get; set; } 

        public decimal TriggerLevel { get; set; }
        public bool UseMarketOrders { get; set; }
        public bool RoundAmount { get; set; }

        public decimal BasePrice { get; set; }
        public EnumFundsPosition FirstAction { get; set; }

        public List<ZoneDefinition> CalculatedZones { get; set; }
        public decimal TakeLongPrice { get; set; }
        public decimal GoLongPrice { get; set; }
        public decimal GoShortPrice { get; set; }
        public decimal TakeShortPrice { get; set; }
        public List<OpenRecoveryPositionDefinition> TakenPositions { get; set; }
    }


Custom Bot Data Objects

CryptoIndexBotIndex

    public class CryptoIndexBotIndex
    {
        public string Coin { get; set; }
        public decimal Amount { get; set; }

        public decimal StartPrice { get; set; }
        public decimal ConversionRate { get; set; }

        public decimal BuyThreshold { get; set; }
        public decimal SellThreshold { get; set; }

        public bool NeedsRebalancing { get; set; }
        public bool HasOpenOrder { get; set; }

        public bool IsStopLossActive { get; set; }
        public decimal StopLoss { get; set; }
    }

CryptoIndexBotIndexResult

    public class CryptoIndexBotIndexResult
    {
        public string Coin { get; set; } 
        public decimal InWallet { get; set; }
        public decimal IndexValue { get; set; }

        public bool Deactivated { get; set; } = false;
        public decimal TargetPercentage { get; set; }
        public decimal CurrentPercentage { get; set; }
    }

CryptoIndexBotIndexSaveObject

    public class CryptoIndexBotIndexSaveObject
    {
        public string Coin { get; set; }
        public decimal Amount { get; set; }

        public decimal BuyThreshold { get; set; }
        public decimal SellThreshold { get; set; }
        public decimal StopLoss { get; set; }
    }

EmailBotAction

    public class EmailBotAction
    {
        public string Guid { get; set; } 
        public string ProviderGuid { get; set; }
        public List<EmailBotActionMessage> Messages { get; set; }

        public int TimeoutInSeconds { get; set; }

        public EnumBotTradeResult SpotAction { get; set; }
        public EnumFundsMovingPosition LeverageAction { get; set; }
    }

EmailBotActionMessage

    public class EmailBotActionMessage
    {
        public string Message { get; set; }
        public long LastReceivedTime { get; set; }
    }

FlashCrashBotSaveObject

    public class FlashCrashBotSaveObject
    {
        public string BotName { get; set; }
        public string BotGuid { get; set; }
        public string AccountId { get; set; }
        public decimal Fee { get; set; }
        public Market PriceMarket { get; set; }

        public decimal BasePrice { get; set; }
        public EnumFlashSpreadOptions PriceSpreadType { get; set; }
        public decimal PriceSpread { get; set; }
        public decimal PercentageBoost { get; set; }
        public decimal MinPercentage { get; set; }
        public decimal MaxPercentage { get; set; }

        public EnumCurrencyType AmountType { get; set; }
        public decimal AmountSpread { get; set; }
        public decimal BuyAmount { get; set; }
        public decimal SellAmount { get; set; }
        public int RefillDelay { get; set; }

        public bool SafetyEnabled { get; set; }
        public decimal SafetyTriggerLevel { get; set; }
        public bool SafetyMoveInOut { get; set; }

        public bool FollowTheTrend { get; set; }
        public int FollowTheTrendChannelRange { get; set; }
        public int FollowTheTrendChannelOffset { get; set; }
        public int FollowTheTrendTimeout { get; set; }
    }

Indicator

    public class Indicator
    {
        public string GUID { get; set; }
        public EnumIndicator IndicatorType { get; set; }

        public string IndicatorName { get; set; }
        public List<IndicatorOption> IndicatorInterface { get; set; }

        public string IndicatorTypeShortName { get; set; }
        public string IndicatorTypeFullName { get; set; }

        public Market PriceMarket { get; set; }
        public EnumPriceChartType ChartType { get; set; }
        public int Timer { get; set; }
        public int Deviation { get; set; }


        public bool UseBuySignals { get; set; }
        public bool UseSellSignals { get; set; }
        public bool UseLongSignals { get; set; }
        public bool UseNoPositionSignals { get; set; }
        public bool UseShortSignals { get; set; }

        public virtual bool ReverseSignals { get; set; }
        public bool StandAlone { get; set; }

        public EnumBotTradeResult BuySellResult { get; set; }
        public EnumFundsPosition ShortLongResult { get; set; }

        public EnumFundsPosition MappedLongSignal { get; set; }
        public EnumFundsPosition MappedShortSignal { get; set; }
    }

IndicatorOption

    public class IndicatorOption
    {
        public string Title { get; set; }
        public string Value { get; set; }
        public List<object> Options { get; set; }
    }

Insurance

    public class Insurance
    {
        public string GUID { get; set; }
        public EnumInsurances InsuranceType { get; set; }

        public string InsuranceTypeShortName { get; set; }
        public string InsuranceTypeFullName { get; set; }
        public bool AgreeToTrade { get; set; }
        public string InsuranceName { get; set; }
        public List<IndicatorOption> InsuranceInterface { get; set; }
    }

MarketMarkingBotSlot

    public class MarketMarkingBotSlot
    {
        public MarketMarkingBotSlotObject BuyOrder { get; set; }
        public MarketMarkingBotSlotObject SellOrder { get; set; }
        public decimal Offset { get; set; }
        public bool Active { get; set; }
    }

MarketMarkingBotSlotObject

    public class MarketMarkingBotSlotObject
    {
        public string OrderID { get; set; }
        public decimal Price { get; set; }
        public decimal TempAmount { get; set; }
        public DateTime Timestamp { get; set; }
        public bool Locked { get; set; }
    }

OpenRecoveryPositionDefinition

    public class OpenRecoveryPositionDefinition
    {
        public decimal Amount { get; set; }
        public decimal Price { get; set; }
        public decimal TargetPrice { get; set; }
        public string PositionId { get; set; }
    }

OrderBotPreOrder

    public class OrderBotPreOrder : BaseOrder
    {
        public EnumOrderBotTriggerType Trigger { get; set; }
        public decimal TriggerPrice { get; set; }
        public string CustomTemplate { get; set; }
        public string DependsOn { get; set; }
        public string DependsOnNotExecuted { get; set; } 

    }

Safety

    public class Safety
    {
        public string GUID { get; set; }
        public EnumSafety SafetyType { get; set; }

        public string SafetyName { get; set; }
        public string SafetyTypeShortName { get; set; }
        public string SafetyTypeFullName { get; set; }

        public Market PriceMarket { get; set; }

        public EnumBotTradeResult BuySellResult { get; set; }
        public EnumFundsPosition ShortLongResult { get; set; }

        public EnumFundsPosition MapBuySignal { get; set; }
        public EnumFundsPosition MapSellSignal { get; set; }

        public List<IndicatorOption> SafetyInterface { get; set; }
    }

ScriptBotOrder

    public class ScriptBotOrder
    {
        public string Guid { get; set; }
        public decimal Price { get; set; }
        public decimal Amount { get; set; }
        public EnumOrderType OrderType { get; set; }
        public EnumFundsMovingPosition FundsMovement { get; set; }
    }

SlotObject

    public class SlotObject
    {
        public string OrderID { get; set; }
        public decimal Price { get; set; }
        public decimal Amount { get; set; }
        public bool InUse { get; set; } 
        public bool ActiveSlot { get; set; }
        public EnumSlotType Type { get; set; }
        public bool WaitingForExecuting { get; set; }
        public DateTime LockTimeStamp { get; set; }
        public List<string> OrderIDs { get; set; } 
    }

SoftwareInformation

    public class SoftwareInformation
    {
        public bool IsBeta { get; set; }
        public string VersionNumber { get; set; }
        public EnumSoftwareLicence LicenceType { get; set; }
    }

ZoneDefinition

    public class ZoneDefinition
    {
        public decimal Amount { get; set; }
        public decimal Price { get; set; }
        public decimal TargetPrice { get; set; }

        public decimal ExposureNow { get; set; }
        public decimal TakenProfit { get; set; } 
        public decimal TakenLosses { get; set; } 
        public decimal Exit { get; set; } 
        public decimal FeeCosts { get; set; }
    }

Advanced Orders Objects

AdvancedOrderBase

    public class AdvancedOrderBase
    {
        public EnumPlatform PlatformType { get; set; }

        public string Guid { get; set; }
        public string Name { get; set; }
        public bool Activated { get; set; }

        public string AccountGuid { get; set; } = "";
        public Market Market { get; set; } = new Market();
        public decimal Leverage { get; set; }

        public decimal Amount { get; set; }
        public decimal CorrectedAmount { get; set; }
        
        public int OrderDirection { get; set; }

        public bool StartOrderOnActivation { get; set; }
        public decimal StartOrderPrice { get; set; }
        public string StartTemplateGuid { get; set; }

        public bool IsPlacingStartOrder { get; set; }
        public bool IsTracking { get; set; }

        public virtual string TemplateGuid { get; set; }

        public List<BaseOrder> CompletedOrders { get; set; }
    }

StopTakeProfitOrder

    public class StopTakeProfitOrder : AdvancedOrderBase
    {
        /// <summary>
        /// When this price is breached, a order will be executed
        /// </summary>
        public decimal TriggerPrice { get; set; }

        /// <summary>
        /// When a order is executed, this price will be used.
        /// </summary>
        public decimal ExecutionPrice { get; set; }
    }

TrailingStop

public class TrailingStop : AdvancedOrderBase
    {
        public decimal TrailingStopPercentage { get; set; }
        public decimal RecordedPrice { get; set; }
    }