# 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](http://www.hmoore.net/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](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/mmmm/780679) Index to add :param reallocatebalance: bool: reallocate current index balance :param raisebalance: bool: increase current index balance
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [CryptoIndexBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202)|訂單方向(買/賣)|
|**triggertype** | [EnumOrderBotTriggerType](http://www.hmoore.net/zbb1025/cccc/780202)|觸發類型|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [OrderBot](http://www.hmoore.net/zbb1025/mmmm/780679): Order bot object|
```
backtest_custom_bot(botguid:str,minutestotest:int )
```
回測自定義機器人(注意:此功能將向交易所發出請求,所以不要經常使用)
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| minutestotest |int|過去測試的分鐘數|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [BaseCustomBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [BaseCustomBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [BaseCustomBot](http://www.hmoore.net/zbb1025/mmmm/780679): BaseCustomBot of the bot that was backtested|
```
clear_custom_bot(botguid:str )
```
清除自定義機器人歷史記錄并返回BaseCustomBot對象
| 參數 |類型 |說明|
|---|---|---|
|**botguid** |str |自定義機器人guid|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [BaseCustomBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202)|返回自定義機器人類型|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202) |要創建的bottype|
|**botname** |str |新自定義機器人的名稱|
|primarycoin |str |基礎代幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價代幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**contractname** |str |**合同**名稱(選項)|
|leverage |float |杠桿百分比|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189) |
|In.[BaseCustomBot](http://www.hmoore.net/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](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202)|訂單方向(買/賣)|
|**triggertype** | [EnumOrderBotTriggerType](http://www.hmoore.net/zbb1025/cccc/780202)|觸發類型|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [OrderBot](http://www.hmoore.net/zbb1025/mmmm/780679): Order bot object|
```
flash_crash_bot_add_buy_order(botguid:str )
```
快速調用將買單添加到正在運行的flash crash_bot
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In.result [FlashCrashBot](http://www.hmoore.net/zbb1025/mmmm/780679):Flash Crash bot對象|
```
flash_crash_bot_add_sell_order(botguid:str )
```
快速調用以向正在運行的flash crash_bot添加賣單
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In.result [FlashCrashBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [FlashCrashBot](http://www.hmoore.net/zbb1025/mmmm/780679):Flash Crash bot|
```
flash_crash_bot_quck_start(botguid:str )
```
Flash Crash快速啟動(不要替換訂單)
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
In .result bool: 如果快速啟動成功|
```
flash_crash_bot_quick_start_all(botguid:str )
```
Flash Crash快速啟動(替換訂單丟失)
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
In .result bool: 如果快速啟動成功|
```
flash_crash_bot_remove_buy_order(botguid:str )
```
快速調用將買單移至正在運行的flash crash_bot
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [FlashCrashBot](http://www.hmoore.net/zbb1025/mmmm/780679):Flash Crash bot對象|
```
flash_crash_bot_remove_sell_order(botguid:str )
```
快速調用將賣單移至正在運行的flash crash_bot
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [FlashCrashBot](http://www.hmoore.net/zbb1025/mmmm/780679):Flash Crash bot對象|
```
flip_accumulation_bot(botguid:str )
```
翻轉 Accumulation bot從買到賣或賣到買
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In .result bool: 如果翻轉成功|
```
get_all_custom_bots()
```
返回創建的所有自定義機器人
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
|In .result List[ [BaseCustomBot](http://www.hmoore.net/zbb1025/mmmm/780679)]|
```
get_custom_bot(botguid:str,bottype:haasomeapi.enums.EnumCustomBotType.EnumCustomBotType )
```
返回自定義機器人匹配機器人guid
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| bottype |[EnumCustomBotType](http://www.hmoore.net/zbb1025/cccc/780202)|要返回的bot類型
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/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](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202) |要創建的bottype|
|**botname** |str |新自定義機器人的名稱|
|primarycoin |str |基礎代幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價代幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**contractname** |str |**合同**名稱(選項)|
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202) |要創建的bottype|
|**botname** |str |新自定義機器人的名稱|
|Parama市場| [Market](http://www.hmoore.net/zbb1025/xxxx/780573)|使用市場對象
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/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](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result AdvancedIndexBot:Crypto Index bot object|
```
remove_all_order_bot_order(botguid:str )
```
從訂單機器人中刪除所有訂單
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result中[OrderBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [CryptoIndexBot](http://www.hmoore.net/zbb1025/pppp/780732): Crypto Index bot object|
```
remove_custom_bot(botguid:str )
```
刪除(刪除)自定義bot
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result bool:如果刪除成功|
```
remove_order_bot_order(botguid:str,orderguid:str )
```
刪除(刪除)訂單機器人上的訂單
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
|orderguid|str|命令guid
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result中[OrderBot](http://www.hmoore.net/zbb1025/mmmm/780679):order bot object|
```
reset_order_bot_order(botguid:str,orderguid:str )
```
重置訂單機器人的訂單
| 參數 |類型 |說明|
|---|---|---|
| **botguid** | str |自定義機器人guid|
|orderguid|str|命令guid
| 返回|
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result中[OrderBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202)|要修改的指標類型
| fieldNo|int|要修改的字段
|value|any|字段的值
| 返回|
|---|
|[HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [MadHatterBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202)|要修改的安全類型
|value |any|安全值
| 返回|
|---|
|[HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [MadHatterBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/cccc/780202)|停止類型
| stoptypevalue| float|與停止類型關聯的停止值
| randomordersizex|float|隨機訂單大小開始
|randomordersizey| float|隨機訂單大小結束
| randomordertimex |int|以秒為單位的隨機排序時間
| randomordertimey | int|以秒為單位的隨機順序時間
| direction| [EnumOrderType](http://www.hmoore.net/zbb1025/cccc/780202)|訂單方向(買/賣)
| triggeronprice |bool|按特定價格觸發
|triggerwhenhigher |bool|當標記價格高于觸發價格時觸發
| triggervalue | float|觸發價格
| 返回|
|---|
|[HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [AccumulationBot](http://www.hmoore.net/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](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/mmmm/780679)]|[CryptoIndexBotIndexSaveObject](http://www.hmoore.net/zbb1025/mmmm/780679)構造index的列表。
| 返回|
|---|
|[HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [CryptoIndexBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/mmmm/780679)]|[EmailBotAction](http://www.hmoore.net/zbb1025/mmmm/780679)從中構建電子郵件機器人的列表
|stoploss |float|止損百分比
| minchangetobuy| float|Min Change To Buy insurance setting
|minchangetosell |float|Min Change To Sell Insurance setting
| 返回|
|---|
|[HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [EmailBot](http://www.hmoore.net/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](http://www.hmoore.net/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](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [FlashCrashBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In .result [BaseCustomBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [InterExchangeArbitrageBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [MadHatterBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [MarketMakingBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result中[OrderBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [BaseCustomBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [ScalperBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [ScriptBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [ScriptBot](http://www.hmoore.net/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](http://www.hmoore.net/zbb1025/gggg/780189)|
| In.result [ZoneRecoveryBot](http://www.hmoore.net/zbb1025/mmmm/780679):Zone Recovery bot對象|