# haasomeapi.apis.CustomBotApi模块
## 功能
```
class haasomeapi.apis.CustomBotApi.CustomBotApi(connectionstring:str,privatekey:str )
Bases: haasomeapi.apis.ApiBase.ApiBase
```
Custom Bot API类,提供对Custom Bot api端点的访问
| 参数 |类型 |说明|
|---|---|---|
| connectionstring | str | Connection String Formatted Ex. [http://127.0.0.1:9000](http://127.0.0.1:9000/) |
|privatekey |str|Private Key Set In The Haas Settings|
```
activate_custom_bot(botguid:str,withextra:bool )
```
激活自定义机器人
| 参数 |类型 |说明|
|---|---|---|
| botguid | str |Custom 机器人guid|
| withextra | bool|with extra|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result bool:如果激活成功|
```
add_advanced_index_bot_index(botguid:str,index:haasomeapi.dataobjects.custombots.dataobjects.AdvancedIndexBotIndexSaveObject.AdvancedIndexBotIndexSaveObject,realocatebalance:bool,raisebalance:bool )
```
Addes a index to preexiting advanced index bot :param botguid: str: Custom bot guid :param index: AdvancedIndexBotIndexSaveObject Index to add :param reallocatebalance: bool: reallocate current index balance :param raisebalance: bool: increase current index balance
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result AdvancedIndexBot: 代币指数机器人对象|
```
add_crypto_index_bot_index(botguid:str,index:haasomeapi.dataobjects.custombots.dataobjects.CryptoIndexBotIndexSaveObject.CryptoIndexBotIndexSaveObject,realocatebalance:bool,raisebalance:bool )
```
Addes a index to preexiting crypto index bot :param botguid: str: Custom bot guid :param index: [CryptoIndexBotIndexSaveObject](https://www.kancloud.cn/zbb1025/mmmm/780679) Index to add :param reallocatebalance: bool: reallocate current index balance :param raisebalance: bool: increase current index balance
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result [CryptoIndexBot](https://www.kancloud.cn/zbb1025/pppp/780732): 代币指数机器人对象|
```
add_order_bot_order(botguid:str,dependson:str,dependsonnotexecuted:str,amount:float,price:float,triggerprice:float,templateguid:str,direction:haasomeapi.enums.EnumOrderType.EnumOrderType,triggertype:haasomeapi.enums.EnumOrderBotTriggerType.EnumOrderBotTriggerType )
```
向订单机器人添加订单
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
|dependson |str |这个顺序取决于订单模板guid|
|dependsonnotexecuted |str |这取决于不执行命令guid|
|**amount** | float|交易金额|
| price |float |订单的价格|
|**triggerprice** | float |订单的触发价格|
|templateguid | str|订单模板,用于使用guid|
|**direction** | [EnumOrderType](https://www.kancloud.cn/zbb1025/cccc/780202)|订单方向(买/卖)|
|**triggertype** | [EnumOrderBotTriggerType](https://www.kancloud.cn/zbb1025/cccc/780202)|触发类型|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result [OrderBot](https://www.kancloud.cn/zbb1025/mmmm/780679): Order bot object|
```
backtest_custom_bot(botguid:str,minutestotest:int )
```
回测自定义机器人(注意:此功能将向交易所发出请求,所以不要经常使用)
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| minutestotest |int|过去测试的分钟数|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result [BaseCustomBot](https://www.kancloud.cn/zbb1025/mmmm/780679): BaseCustomBot of the bot that was backtested|
```
backtest_custom_bot_on_market(accountguid:STR,botguid:STR,minutestotest:INT,primarycoin:STR,secondarycoin:STR,contractname:STR )
```
在指定的市场上测试自定义机器人(注意:此功能不会调用交换机可以根据需要使用。)
| 参数 |类型 |说明|
|---|---|---|
| accountguid | str |The account guid|
|**botguid** |str |自定义机器人guid|
|**minutestotest** |int |过去测试的分钟数|
|primarycoin |str |基础代币 Ex. 如果BNB / BTC然后将其设置为BNB|
| secondarycoin|str |计价代币 Ex. 如果BNB / BTC然后将其设置为BTC|
|**contractname** |str |合同名称(可选)|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result [BaseCustomBot](https://www.kancloud.cn/zbb1025/mmmm/780679): BaseCustomBot of the bot that was backtested|
```
backtest_custom_bot_unix_time(botguid:str,startunix:int,endunix:int )
```
回测自定义机器人(注意:此功能会向交易所发出请求,所以不要经常使用)
| 参数 |类型 |说明|
|---|---|---|
|**botguid** |str |自定义机器人guid|
|**startunix** |int |以unix时间表示开始的时间|
|**endunix** |int |以unix时间表示结束的时间|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result [BaseCustomBot](https://www.kancloud.cn/zbb1025/mmmm/780679): BaseCustomBot of the bot that was backtested|
```
clear_custom_bot(botguid:str )
```
清除自定义机器人历史记录并返回BaseCustomBot对象
| 参数 |类型 |说明|
|---|---|---|
|**botguid** |str |自定义机器人guid|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result [BaseCustomBot](https://www.kancloud.cn/zbb1025/mmmm/780679): BaseCustomBot of the bot that was cleared|
```
clear_custom_bot_specific(botguid:str,bottype:haasomeapi.enums.EnumCustomBotType.EnumCustomBotType )
```
清除自定义机器人历史记录并返回特定的custom bot对象
| 参数 |类型 |说明|
|---|---|---|
|**botguid** |str |自定义机器人guid|
|**bottype** | [EnumCustomBotType](https://www.kancloud.cn/zbb1025/cccc/780202)|返回自定义机器人类型|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result any:指定的自定义机器人对象|
```
clone_custom_bot(accountguid: str, botguid: str, bottype: haasomeapi.enums.EnumCustomBotType.EnumCustomBotType, botname: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float)
```
克隆自定义机器人
| 参数 |类型 |说明|
|---|---|---|
| accountguid | str |The account guid|
|**botguid** |str |自定义机器人guid|
|**bottype** | [EnumCustomBotType](https://www.kancloud.cn/zbb1025/cccc/780202) |要创建的bottype|
|**botname** |str |新自定义机器人的名称|
|primarycoin |str |基础代币 Ex. 如果BNB / BTC然后将其设置为BNB|
| secondarycoin|str |计价代币 Ex. 如果BNB / BTC然后将其设置为BTC|
|**contractname** |str |**合同**名称(选项)|
|leverage |float |杠杆百分比|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result any:指定的自定义机器人对象|
```
clone_custom_bot_simple(accountguid:str,botguid:str,botname:str )
```
克隆一个简化的自定义机器人
| 参数 |类型 |说明|
|---|---|---|
| accountguid | str |The account guid|
|**botguid** |str |自定义机器人guid|
|**botname** |str |新自定义机器人的名称|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
|In.[BaseCustomBot](https://www.kancloud.cn/zbb1025/mmmm/780679).result:BaseCustomBot of the bot that was backtested|
```
deactivate_custom_bot(botguid:str,withextra:bool )
```
停用自定义机器人
| 参数 |类型 |说明|
|---|---|---|
|**botguid** |str |自定义机器人guid|
|**withextra** |bool |with extra|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result bool: 如果停用成功|
```
edit_order_bot_order(botguid:str,orderguid:str,dependson:str,dependsonnotexecuted:str,amount:float,price:float,triggerprice:float,templateguid:str,direction:haasomeapi.enums.EnumOrderType.EnumOrderType,triggertype:haasomeapi.enums.EnumOrderBotTriggerType .EnumOrderBotTriggerType )
```
在订单机器人上编辑订单
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| **orderguid** | str |编辑命令的指导|
|dependson |str |这个顺序取决于订单模板guid|
|dependsonnotexecuted |str |这取决于不执行命令guid|
|**amount** | float|交易金额|
| price |float |订单的价格|
|**triggerprice** | float |订单的触发价格|
|templateguid | str|订单模板,用于使用guid|
|**direction** | [EnumOrderType](https://www.kancloud.cn/zbb1025/cccc/780202)|订单方向(买/卖)|
|**triggertype** | [EnumOrderBotTriggerType](https://www.kancloud.cn/zbb1025/cccc/780202)|触发类型|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In .result [OrderBot](https://www.kancloud.cn/zbb1025/mmmm/780679): Order bot object|
```
flash_crash_bot_add_buy_order(botguid:str )
```
快速调用将买单添加到正在运行的flash crash_bot
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In.result [FlashCrashBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Flash Crash bot对象|
```
flash_crash_bot_add_sell_order(botguid:str )
```
快速调用以向正在运行的flash crash_bot添加卖单
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回 |
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) |
| In.result [FlashCrashBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Flash Crash bot对象|
```
flash_crash_bot_live_edit(botguid:str,isbuyorder:bool,addorder:bool )
```
为正在运行的flash crash(闪电崩盘)添加订单
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| **isbuyorder** |bool |是添加买单的订单|
| **addorder** |bool |我们应该添加订单还是删除订单
| 返回 |
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [FlashCrashBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Flash Crash bot|
```
flash_crash_bot_quck_start(botguid:str )
```
Flash Crash快速启动(不要替换订单)
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
In .result bool: 如果快速启动成功|
```
flash_crash_bot_quick_start_all(botguid:str )
```
Flash Crash快速启动(替换订单丢失)
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
In .result bool: 如果快速启动成功|
```
flash_crash_bot_remove_buy_order(botguid:str )
```
快速调用将买单移至正在运行的flash crash_bot
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [FlashCrashBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Flash Crash bot对象|
```
flash_crash_bot_remove_sell_order(botguid:str )
```
快速调用将卖单移至正在运行的flash crash_bot
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [FlashCrashBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Flash Crash bot对象|
```
flip_accumulation_bot(botguid:str )
```
翻转 Accumulation bot从买到卖或卖到买
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In .result bool: 如果翻转成功|
```
get_all_custom_bots()
```
返回创建的所有自定义机器人
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
|In .result List[ [BaseCustomBot](https://www.kancloud.cn/zbb1025/mmmm/780679)]|
```
get_custom_bot(botguid:str,bottype:haasomeapi.enums.EnumCustomBotType.EnumCustomBotType )
```
返回自定义机器人匹配机器人guid
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| bottype |[EnumCustomBotType](https://www.kancloud.cn/zbb1025/cccc/780202)|要返回的bot类型
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result any:指定的bottype对象|
```
include_advanced_index_bot_index(botguid:str,coin:str )
```
Includes a excluded index from the advanced index bot :param botguid: str: Custom bot guid :param coin: std: Coin to include from index
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result AdvancedIndexBot: Crypto Index bot object|
```
new_custom_bot(accountguid:STR,bottype:haasomeapi.enums.EnumCustomBotType.EnumCustomBotType,botname:STR,primarycoin:STR,secondarycoin:STR,contractname:STR )
```
创建一个新的自定义机器人
| 参数 |类型 |说明|
|---|---|---|
| accountguid | str |The account guid|
|**bottype** | [EnumCustomBotType](https://www.kancloud.cn/zbb1025/cccc/780202) |要创建的bottype|
|**botname** |str |新自定义机器人的名称|
|primarycoin |str |基础代币 Ex. 如果BNB / BTC然后将其设置为BNB|
| secondarycoin|str |计价代币 Ex. 如果BNB / BTC然后将其设置为BTC|
|**contractname** |str |**合同**名称(选项)|
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result any:指定的bot类型对象|
```
new_custom_bot_from_market(accountguid:str,bottype:haasomeapi.enums.EnumCustomBotType.EnumCustomBotType,botname:str,market:haasomeapi.dataobjects.marketdata.Market.Market )
```
从市场对象创建一个新的自定义bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid | str |The account guid|
|**bottype** | [EnumCustomBotType](https://www.kancloud.cn/zbb1025/cccc/780202) |要创建的bottype|
|**botname** |str |新自定义机器人的名称|
|Parama市场| [Market](https://www.kancloud.cn/zbb1025/xxxx/780573)|使用市场对象
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result any:指定的bot类型对象|
```
rebalance_advanced_index_bot_index(botguid:str )
```
Rebalance a advanced index bot :param botguid: str: Custom bot guid
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result AdvancedIndexBot:Crypto Index bot object|
```
remove_advanced_index_bot_index(botguid:str,coin:str,lowerbalance:bool )
```
Removes a index from preexiting advanced index bot :param botguid: str: Custom bot guid :param coin: std: Coin to remove from index :param lowerbalance: bool: Reduce the index balance
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result AdvancedIndexBot:Crypto Index bot object|
```
remove_all_order_bot_order(botguid:str )
```
从订单机器人中删除所有订单
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result中[OrderBot](https://www.kancloud.cn/zbb1025/mmmm/780679):order bot object|
```
remove_crypto_index_bot_index(botguid:str,coin:str,lowerbalance:bool )
```
Removes a index from preexiting crypto index bot :param botguid: str: Custom bot guid :param coin: std: Coin to remove from index :param lowerbalance: bool: Reduce the index balance
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [CryptoIndexBot](https://www.kancloud.cn/zbb1025/pppp/780732): Crypto Index bot object|
```
remove_custom_bot(botguid:str )
```
删除(删除)自定义bot
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result bool:如果删除成功|
```
remove_order_bot_order(botguid:str,orderguid:str )
```
删除(删除)订单机器人上的订单
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
|orderguid|str|命令guid
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result中[OrderBot](https://www.kancloud.cn/zbb1025/mmmm/780679):order bot object|
```
reset_order_bot_order(botguid:str,orderguid:str )
```
重置订单机器人的订单
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
|orderguid|str|命令guid
| 返回|
|---|
| [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result中[OrderBot](https://www.kancloud.cn/zbb1025/mmmm/780679):order bot object|
```
set_mad_hatter_indicator_parameter(botguid:str,type:haasomeapi.enums.EnumMadHatterIndicators.EnumMadHatterIndicators,fieldNo:int,value:any )
```
修改Mad Hatter指标参数
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
|type | [EnumMadHatterIndicators](https://www.kancloud.cn/zbb1025/cccc/780202)|要修改的指标类型
| fieldNo|int|要修改的字段
|value|any|字段的值
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [MadHatterBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Mad Hatter bot对象|
```
set_mad_hatter_safety_parameter(botguid:str,type:haasomeapi.enums.EnumMadHatterSafeties.EnumMadHatterSafeties,value:any )
```
修改Mad hatter安全参数
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
| type |[EnumMadHatterSafeties](https://www.kancloud.cn/zbb1025/cccc/780202)|要修改的安全类型
|value |any|安全值
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [MadHatterBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Mad Hatter bot对象|
```
setup_accumulation_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, stoptype: haasomeapi.enums.EnumAccumulationBotStopType.EnumAccumulationBotStopType, stoptypevalue: float, randomordersizex: float, randomordersizey: float, randomordertimex: int, randomordertimey: int, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, triggeronprice: bool, triggerwhenhigher: bool, triggervalue: float)
```
修改Accumulation bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
|stoptype|[EnumAccumulationBotStopType](https://www.kancloud.cn/zbb1025/cccc/780202)|停止类型
| stoptypevalue| float|与停止类型关联的停止值
| randomordersizex|float|随机订单大小开始
|randomordersizey| float|随机订单大小结束
| randomordertimex |int|以秒为单位的随机排序时间
| randomordertimey | int|以秒为单位的随机顺序时间
| direction| [EnumOrderType](https://www.kancloud.cn/zbb1025/cccc/780202)|订单方向(买/卖)
| triggeronprice |bool|按特定价格触发
|triggerwhenhigher |bool|当标记价格高于触发价格时触发
| triggervalue | float|触发价格
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [AccumulationBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Accumulation bot对象|
```
setup_advanced_index_bot(accountguid:str,botguid:str,botname:str,templateguid:str,basecoin:str,totalIndexValue:float,rebalanceInterval:int,rebalanceType:haasomeapi.enums.EnumAdvancedIndexBotRebalanceType.EnumAdvancedIndexBotRebalanceType,allocateProfits:bool,preserveBaseIndexPrecentage:bool,index:List [haasomeapi.dataobjects.custombots.dataobjects.AdvancedIndexBotIndexSaveObject.AdvancedIndexBotIndexSaveObject] )
```
修改Crypto Index bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| templateguid|str|使用订单模板guid
|basecoin|str|index bot 的计价代币 比如BTC
|totalIndexValue|float|index应使用的总值。
|rebalanceInterval | int|重新平衡的频率
|allocateprofits| bool|执行利润分配
|preserveBaseIndexPercentage|bool|确保index 百分比永远不会低于开始百分比
|index| List [AdvancedIndexBotIndexSaveObject]|AdvancedIndexBotIndexSaveObject构造index的列表。
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result AdvancedIndexBot: Crypto Index bot object|
```
setup_crypto_index_bot(accountguid:str,botguid:str,botname:str,templateguid:str,basecoin:str,totalIndexValue:float,individualgrowth:bool,allocateprofits:bool,index:List [haasomeapi.dataobjects.custombots.dataobjects.CryptoIndexBotIndexSaveObject.CryptoIndexBotIndexSaveObject] )
```
修改Crypto Index bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| templateguid|str|使用订单模板guid
|basecoin|str|index bot 的计价代币 比如BTC
|totalIndexValue|float|index应使用的总值
| individualgrowth|bool|使用个人成长算法
|allocateprofits | bool|执行利润分配
|index | List [ [CryptoIndexBotIndexSaveObject](https://www.kancloud.cn/zbb1025/mmmm/780679)]|[CryptoIndexBotIndexSaveObject](https://www.kancloud.cn/zbb1025/mmmm/780679)构造index的列表。
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [CryptoIndexBot](https://www.kancloud.cn/zbb1025/pppp/780732): Crypto Index bot object|
```
setup_email_bot(accountguid:str,botguid:str,botname:str,primarycoin:str,secondarycoin:str,contractname:str,leverage:float,amountType:haasomeapi.enums.EnumBotTradeAmount.EnumBotTradeAmount,tradeamount:float,fee:float,templateguid:str ,position:str,actions:list [haasomeapi.dataobjects.custombots.dataobjects.EmailBotAction.EmailBotAction],stoploss:float,minchangetobuy:float,minchangetosell:float )
```
修改电子邮件机器人
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
|contractname |str|合同名称(可选)
|leverage|float|杠杆百分比使用(可选)
| amountType |EnumBotTradeAmount|交易金额类型
|tradeamount |float|要使用的机器人的交易金额
lfee|float|计算中使用的费用百分比
|templateguid | str|要使用的订单模板
|position |str|Position bot should start in EX. For BNB/BTC if you have no BNB set to BTC
|actions |List [ [EmailBotAction](https://www.kancloud.cn/zbb1025/mmmm/780679)]|[EmailBotAction](https://www.kancloud.cn/zbb1025/mmmm/780679)从中构建电子邮件机器人的列表
|stoploss |float|止损百分比
| minchangetobuy| float|Min Change To Buy insurance setting
|minchangetosell |float|Min Change To Sell Insurance setting
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [EmailBot](https://www.kancloud.cn/zbb1025/mmmm/780679):电子邮件bot对象|
```
setup_flash_crash_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, fee: float, baseprice: float, priceSpreadType: haasomeapi.enums.EnumFlashSpreadOptions.EnumFlashSpreadOptions, pricespread: float, percentageboost: float, minpercentage: float, maxpercentage: float, amounttype: haasomeapi.enums.EnumCurrencyType.EnumCurrencyType, amountspread: float, buyamount: float, sellamount: float, refilldelay: int, safetyenabled: bool, safetytriggerlevel: float, safetymoveinout: bool, followthetrend: bool, followthetrendchannelrange: int, followthetrendchanneloffset: int, followthetrendtimeout: int)
```
修改Flash Crash bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
fee|float|计算中使用的费用百分比
|baseprice |float|Base price for FCB to start at
|priceSpreadType| [EnumFlashSpreadOptions](https://www.kancloud.cn/zbb1025/cccc/780202) |FCB 价差类型
|pricepread |float |价差价值
|percentageboost|float |Percentage boost value to be set with PercentageBoost spread type.
|minpercentage| float|Min Percentage value to be used with percentage spread type
|maxpercentage|float|Max Percentage value to be used with percentage spread type
|amounttype| [EnumCurrencyType](https://www.kancloud.cn/zbb1025/cccc/780202)|代币类型
amountpread| float|当前金额价差
buyamount| float|买单数量
sellamount | float|卖单数量
refilldelay |int|以分钟为单位的补充订单延迟
safetyenabled| bool|启用安全性
safetytriggerlevel | float|价格值安全应该激活
safetymoveinout| bool|安全移出价值
followthetrend |bool|激活跟随趋势
followthetrendchannelrange | int|遵循趋势通道范围
followthetrendchanneloffset| int|跟随趋势通道偏移
followthetrendtimeout |int|遵循趋势超时值
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [FlashCrashBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Flash Crash bot对象|
```
setup_intellibot_alice(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, amountType: haasomeapi.enums.EnumBotTradeAmount.EnumBotTradeAmount, tradeamount: float, fee: float)
```
修改Intelli Bot Alice bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
|contractname |str|合同名称(可选)
|leverage|float|杠杆百分比使用(可选)
| amountType |EnumBotTradeAmount|交易金额类型
|tradeamount |float|要使用的机器人的交易金额
lfee|float|计算中使用的费用百分比
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In .result [BaseCustomBot](https://www.kancloud.cn/zbb1025/mmmm/780679)::BaseCustomBot对象|
```
setup_inter_exchange_arbitrage_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, accountguid2: str, primarycoin2: str, secondarycoin2: str, tradeamount: float, triggerlevel: float, templateguid: str, maxamount: float, maxtrades: int)
```
Modify Inter Exchange Arbitrage bot :param accountguid: str: Account guid :param botguid: str: Custom bot guid :param botname: str: Name for the new custom bot :param primarycoin: str: Primary currency Ex. If BNB/BTC then set this to BNB :param secondarycoin: str: Secondary currency Ex. If BNB/BTC then set this to BTC :param accountguid2: str: Seoncdary Account Guid :param primarycoin2: str: Primary currency of the second account Ex. If BNB/BTC then set this to BNB :param secondarycoin2: str: Secondary currency of the second account Ex. If BNB/BTC then set this to BTC :param tradeamount: float: Trade amount to use :param triggerlevel: float: Trigger level for trades in percentage :param templateguid: str: Order template to use Guid :param maxamount: float: Max amount to trade a day :param maxtrades: int: Max trades to execute a day
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [InterExchangeArbitrageBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Inter Exchange Arbitrage bot(搬砖套利机器人)|
```
setup_mad_hatter_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, templateguid: str, position: str, fee: float, amountType: haasomeapi.enums.EnumBotTradeAmount.EnumBotTradeAmount, tradeamount: float, useconsensus: bool, disableafterstoploss: bool, interval: int, includeincompleteinterval: bool)
```
修改Mad Hatter bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
| templateguid|str|使用订单模板guid
|position |str|Position bot should start in EX. For BNB/BTC if you have no BNB set to BTC
lfee|float|计算中使用的费用百分比
| amountType |EnumBotTradeAmount|交易金额类型
tradeamount | float| 交易金额
useconsensus | bool| 启用共识模式
disableafterstoploss| bool| 在止损后禁用机器人
interval | int| Price Ticker Minute Interval。1,2,3,,5,15,30等
includeincompleteinterval | bool| Allow a incomplete price ticker
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [MadHatterBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Mad Hatter bot对象|
```
setup_market_making_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, tradeamount: float, fee: float, offset: float, resettimeout: int, usedsecondorder: bool, secondoffset: float)
```
修改做市商机器人
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
| tradeamount |float|交易金额
fee | float|计算中使用的费用百分比
offset | float|一阶偏移值
resettimeout | int|以分钟为单位重置超时
usedsecondorder| bool|使用第二个订单
secondoffset | float|二阶偏移量
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [MarketMakingBot](https://www.kancloud.cn/zbb1025/mmmm/780679):做市商机器人对象|
```
setup_order_bot(accountguid:STR,botguid:STR,botname:STR,primarycoin:STR,secondarycoin:STR )
```
修改order 机器人
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result中[OrderBot](https://www.kancloud.cn/zbb1025/mmmm/780679):order bot object|
```
setup_ping_pong_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, contractbame: str, leverage: float, amountType: haasomeapi.enums.EnumBotTradeAmount.EnumBotTradeAmount, tradeamount: float, position: str, fee: float)
```
修改Ping Pong bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
|contractname |str|合同名称(可选)
|leverage|float|杠杆百分比使用(可选)
| amountType |EnumBotTradeAmount|交易金额类型
|tradeamount |float|要使用的机器人的交易金额
position |str |Position bot should start in EX. For BNB/BTC if you have no BNB set to BTC
|fee |float |计算中使用的费用百分比
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [BaseCustomBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Ping Pong is just a BaseCustomBot BaseCustomBot object|
```
setup_scalper_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, templateguid: str, contractname: str, leverage: float, amountType: haasomeapi.enums.EnumBotTradeAmount.EnumBotTradeAmount, tradeamount: float, position: str, fee: float, targetpercentage: float, safetythreshold: float)
```
修改Scalper bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
|templateguid| str|使用Guid的订单模板
|contractname |str|合同名称(可选)
|leverage|float|杠杆百分比使用(可选)
| amountType |EnumBotTradeAmount|交易金额类型
|tradeamount |float|要使用的机器人的交易金额
position |str |Position bot should start in EX. For BNB/BTC if you have no BNB set to BTC
|fee |float |计算中使用的费用百分比
|targetpercentage |float|
|safetythreshold | float|
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [ScalperBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Scalper bot对象|
```
setup_script_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, templateguid: str, contractbame: str, leverage: float, tradeamount: float, position: str, fee: float, scriptid: str)
```
修改脚本机器人
参数:
accountguid str:帐户guid
botguid str:自定义机器人guid
botname str:新自定义机器人的名称
primarycoin str:基础代币Ex。如果BNB / BTC然后将其设置为BNB
secondarycoin str:计价代币Ex。如果BNB / BTC然后将其设置为BTC
:param templateguid :str: Order template to use Guid :param contractbame: str: Contract name (Optional) :param leverage: float: Leverage percentage to use (Optional) :param tradeamount: float: Trade amount to use :param position: str: Position bot should start in EX. For BNB/BTC if you have no BNB set to BTC :param fee: float: Fee percentage to be used in calculations :param scriptid: str: Script Id for bot to use
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [ScriptBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Script Bot Object|
```
setup_script_bot_parameters(botguid:str,fieldno:int,value:any )
```
修改脚本bot参数
| 参数 |类型 |说明|
|---|---|---|
| **botguid** | str |自定义机器人guid|
fieldno | int | 要修改的字段编号
value | any | 字段的值
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [ScriptBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Script Bot Object|
```
setup_zone_recovery_bot(accountguid: str, botguid: str, botname: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, tradeamount: float, maxtradeamount: float, factorlong: float, factorshort: float, targetprofit: float, zone: float)
```
修改zone_recovery_bot
| 参数 |类型 |说明|
|---|---|---|
| accountguid|str|帐户guid
|botguid|str|自定义机器人guid
|botname| str|新自定义机器人的名称
| primarycoin |str|基础代币。EX:如果BNB / BTC然后将其设置为BNB
| secondarycoin| str|计价代币。EX:BNB / BTC然后将其设置为BTC
|contractname |str|合同名称(可选)
|leverage|float|杠杆百分比使用(可选)
|tradeamount |float|要使用的机器人的交易金额
maxtradeamount |float|最大交易金额
factorlong|float|Factor long value
factorhort|float|Factor short value
targetprofit| float|目标利润百分比
zone | float|区域值
| 返回|
|---|
|[HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189)|
| In.result [ZoneRecoveryBot](https://www.kancloud.cn/zbb1025/mmmm/780679):Zone Recovery bot对象|