# haasomeapi.apis.AdvancedOrderApi模塊
## 功能
```
class haasomeapi.apis.AdvancedOrderApi.AdvancedOrderApi(connectionstring:str,privatekey:str )
Bases: haasomeapi.apis.ApiBase.ApiBase
```
高級訂單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_advanced_order(guid:str )
```
激活高級訂單
| 參數 |類型 |說明|
|---|---|---|
| **guid** | str |高級訂單GUID |
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [AdvancedOrderBase](http://www.hmoore.net/zbb1025/tttt/780628)|
```
add_stop_order(accountguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
為現貨市場創建止損單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**direction** |EnumOrderType |訂單方向(買/賣)|
|**executemplateguid** |str |執行要使用的模板|
|**triggerprice** | float |執行止損的觸發價格|
|**executionprice** | float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
add_stop_order_leverage(accountguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
為杠桿/保證金市場創建止損單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**contractname** |str |**合同**名稱(選項)|
|leverage |float |杠桿百分比|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice** | float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
add_take_profit_order(accountguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
創建現貨市場的獲利訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice** | float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
add_take_profit_order_leverage(name: str, accountguid: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
為杠桿/保證金市場創建獲利訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**contractname** |str |**合同**名稱(選項)|
|leverage |float |杠桿百分比|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice** | float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
add_trailing_stop_leverage(accountguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, trailingstoppercentage: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
為杠桿/保證金市場創建立追蹤止損訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**contractname** |str |**合同**名稱(選項)|
|leverage |float |杠桿百分比|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**trailingstoppercentage** | float|trailing stop百分比|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
add_trailing_stop_order(accountguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, trailingstoppercentage: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
為現貨市場創建追蹤止損訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**trailingstoppercentage** | float|trailing stop百分比|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
deactivate_advanced_order(guid:str )
```
停用高級訂單
| 參數 |類型 |說明|
|---|---|---|
| **guid** | str |高級訂單GUID|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result [AdvancedOrderBase](http://www.hmoore.net/zbb1025/tttt/780628)|
```
get_advanced_orders()
```
檢索當前創建的高級訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In.result Dict [[AdvancedOrderBase](http://www.hmoore.net/zbb1025/tttt/780628)]|
remove_advanced_order(guid:str )
刪除(刪除)高級訂單
| 參數 |類型 |說明|
|---|---|---|
| **guid** | str |高級訂單GUID|
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result bool if success|
```
setup_stop_order(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
修改現貨市場的止損訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**orderguid** |str |要修改的高級訂單guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice**| float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
setup_stop_order_leverage(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
修改杠桿/保證金市場的止損訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**orderguid** |str |要修改的高級訂單guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**contractname** |str |**合同**名稱(選項)|
|**leverage** | float |杠桿百分比|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice**| float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
setup_take_profit_order(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
修改現貨市場的獲利訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**orderguid** |str |要修改的高級訂單guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice**| float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
setup_take_profit_order_leverage(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, triggerprice: float, executionprice: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
修改杠桿/保證金市場的獲利訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**orderguid** |str |要修改的高級訂單guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**contractname** |str |**合同**名稱(選項)|
|**leverage** | float |杠桿百分比|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice**| float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
setup_trailing_stop_leverage(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, contractname: str, leverage: float, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, trailingstoppercentage: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
修改杠桿/保證金市場的追蹤止損訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**orderguid** |str |要修改的高級訂單guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|**contractname** |str |**合同**名稱(選項)|
|**leverage** | float |杠桿百分比|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice**| float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|
```
setup_trailing_stop_order(accountguid: str, orderguid: str, name: str, primarycoin: str, secondarycoin: str, direction: haasomeapi.enums.EnumOrderType.EnumOrderType, executingtemplateguid: str, trailingstoppercentage: float, amount: float, startorderonactivation: bool, startorderprice: float, starttemplateguid: str, activate: bool)
```
修改現貨市場的追蹤止損訂單
| 參數 |類型 |說明|
|---|---|---|
| accountguid | str |The account guid|
|**orderguid** |str |要修改的高級訂單guid|
|**name** |str |高級訂單的名稱|
|primarycoin |str |基礎貨幣 Ex. 如果BNB / BTC然后將其設置為BNB|
| secondarycoin|str |計價貨幣 Ex. 如果BNB / BTC然后將其設置為BTC|
|direction | EnumOrderType |訂單方向(多頭/空頭)|
|**executemplateguid**| str|執行要使用的模板|
|**triggerprice** | float|執行止損的觸發價格|
|**executionprice**| float|訂單的價格|
|**amount** | float|交易金額|
|**startorderonactivation** |bool|僅在激活時啟動高級訂單|
|**startorderprice** | float|開始訂單的價格是多少|
|**starttemplateguid** |str|用于訂單的模板guid|
|**activate** | bool|激活訂單
| 返回 |
|---|
| [HaasomeClientResponse](http://www.hmoore.net/zbb1025/gggg/780189) |
| In .result StopTakeProfitOrder|