💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 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](https://www.kancloud.cn/zbb1025/gggg/780189) | | In .result [AdvancedOrderBase](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/zbb1025/gggg/780189) | | In .result StopTakeProfitOrder| ``` deactivate_advanced_order(guid:str ) ``` 停用高级订单 | 参数 |类型 |说明| |---|---|---| | **guid** | str |高级订单GUID| | 返回 | |---| | [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) | | In .result [AdvancedOrderBase](https://www.kancloud.cn/zbb1025/tttt/780628)| ``` get_advanced_orders() ``` 检索当前创建的高级订单 | 返回 | |---| | [HaasomeClientResponse](https://www.kancloud.cn/zbb1025/gggg/780189) | | In.result Dict [[AdvancedOrderBase](https://www.kancloud.cn/zbb1025/tttt/780628)]| remove_advanced_order(guid:str ) 删除(删除)高级订单 | 参数 |类型 |说明| |---|---|---| | **guid** | str |高级订单GUID| | 返回 | |---| | [HaasomeClientResponse](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/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](https://www.kancloud.cn/zbb1025/gggg/780189) | | In .result StopTakeProfitOrder|