haasomeapi.apis.AdvancedOrderApi module

Functions

class haasomeapi.apis.AdvancedOrderApi.AdvancedOrderApi(connectionstring: str, privatekey: str)

Bases: haasomeapi.apis.ApiBase.ApiBase

The Advanced Order API Class. Gives access to the advanced order endpoints

Parameters:
  • connectionstring – str: Connection String Formatted Ex. http://127.0.0.1:9000
  • privatekey – str: Private Key Set In The Haas Settings
activate_advanced_order(guid: str)

Activates an advanced order

Parameters:guid – str: advanced order guid
Returns:HaasomeClientResponse
Returns:In .result AdvancedOrderBase
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)

Create a stop order for a spot market

Parameters:
  • accountguid – str: The account guid
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • direction – EnumOrderType: Order Direction (Buy / Sell)
  • executingtemplateguid – str: Executing Template To Use
  • triggerprice – float: Trigger price to execute the stop
  • executionprice – float: Price for the order to be placed at
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Create a stop order for a leverage/margin market

Parameters:
  • accountguid – str: The account guid
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • contractname – str: Name of the contract (Options)
  • leverage – float: Leverage percentage
  • direction – EnumOrderType: Order Direction (Long/Short)
  • executingtemplateguid – str: Executing Template To Use
  • triggerprice – float: Trigger price to execute the stop
  • executionprice – float: Price for the order to be placed at
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Createa take profit order for a spot market

Parameters:
  • accountguid – str: The account guid
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • direction – EnumOrderType: Order Direction (Buy / Sell)
  • executingtemplateguid – str: Executing Template To Use
  • triggerprice – float: Trigger price to execute the stop
  • executionprice – float: Price for the order to be placed at
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Create a take profit order for a leverage/margin market

Parameters:
  • accountguid – str: The account guid
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • contractname – str: Name of the contract (Options)
  • leverage – float: Leverage percentage
  • direction – EnumOrderType: Order Direction (Long/Short)
  • executingtemplateguid – str: Executing Template To Use
  • triggerprice – float: Trigger price to execute the stop
  • executionprice – float: Price for the order to be placed at
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Create trailing stop order for a leverage/margin market

Parameters:
  • accountguid – str: The account guid
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • contractname – str: Name of the contract (Options)
  • leverage – float: Leverage percentage
  • direction – EnumOrderType: Order Direction (Long/Short)
  • executingtemplateguid – str: Executing Template To Use
  • trailingstoppercentage – float: Percentage for trailing top to follow
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Create a trailing stop order for a spot market

Parameters:
  • accountguid – str: The account guid
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • direction – EnumOrderType: Order Direction (Buy / Sell)
  • executingtemplateguid – str: Executing Template To Use
  • trailingstoppercentage – float: Percentage for trailing top to follow
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

In .result StopTakeProfitOrder

deactivate_advanced_order(guid: str)

Deactivates an advanced order

Parameters:guid – str: advanced order guid
Returns:HaasomeClientResponse
Returns:In .result AdvancedOrderBase
get_advanced_orders()

Retrieves the current created advanced orders

Returns:HaasomeClientResponse
Returns:In .result Dict[AdvancedOrderBase]
remove_advanced_order(guid: str)

Removes (deletes) advanced order

Parameters:guid – str: advanced order guid
Returns:HaasomeClientResponse
Returns: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)

Modify a stop order for a spot market

Parameters:
  • accountguid – str: The account guid
  • orderguid – str: The advanced order guid to modify
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • direction – EnumOrderType: Order Direction (Buy / Sell)
  • executingtemplateguid – str: Executing Template To Use
  • triggerprice – float: Trigger price to execute the stop
  • executionprice – float: Price for the order to be placed at
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Modify a stop order for a leverage/margin market

Parameters:
  • accountguid – str: The account guid
  • orderguid – str: The advanced order guid to modify
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • contractname – str: Name of the contract (Options)
  • leverage – float: Leverage percentage
  • direction – EnumOrderType: Order Direction (Long/Short)
  • executingtemplateguid – str: Executing Template To Use
  • triggerprice – float: Trigger price to execute the stop
  • executionprice – float: Price for the order to be placed at
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Modify take profit order for a spot market

Parameters:
  • accountguid – str: The account guid
  • orderguid – str: The advanced order guid to modify
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • direction – EnumOrderType: Order Direction (Buy / Sell)
  • executingtemplateguid – str: Executing Template To Use
  • triggerprice – float: Trigger price to execute the stop
  • executionprice – float: Price for the order to be placed at
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Modify a take profit order for a leverage/margin market

Parameters:
  • accountguid – str: The account guid
  • orderguid – str: The advanced order guid to modify
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • contractname – str: Name of the contract (Options)
  • leverage – float: Leverage percentage
  • direction – EnumOrderType: Order Direction (Long/Short)
  • executingtemplateguid – str: Executing Template To Use
  • triggerprice – float: Trigger price to execute the stop
  • executionprice – float: Price for the order to be placed at
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Modify trailing stop order for a leverage/margin market

Parameters:
  • accountguid – str: The account guid
  • orderguid – str: The advanced order guid to modify
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • contractname – str: Name of the contract (Options)
  • leverage – float: Leverage percentage
  • direction – EnumOrderType: Order Direction (Long/Short)
  • executingtemplateguid – str: Executing Template To Use
  • trailingstoppercentage – float: Percentage for trailing top to follow
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

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)

Modify a trailing stop order for a spot market

Parameters:
  • accountguid – str: The account guid
  • orderguid – str: The advanced order guid to modify
  • name – str: Name of the advanced order
  • primarycoin – str: Primary currency Ex. If BNB/BTC then set this to BNB
  • secondarycoin – str: Secondary currency Ex. If BNB/BTC then set this to BTC
  • direction – EnumOrderType: Order Direction (Buy / Sell)
  • executingtemplateguid – str: Executing Template To Use
  • trailingstoppercentage – float: Percentage for trailing top to follow
  • amount – float: Trade Amount
  • startorderonactivation – bool: Start the adavnced order only on activation
  • startorderprice – float: What price to start the order
  • starttemplateguid – str: The template guid to use for the order
  • activate – bool: Activate the order.
Returns:

HaasomeClientResponse

Returns:

In .result StopTakeProfitOrder