LogoLogo
Back to HaasOnline.comSwitch to Trade Platform
3.x
3.x
  • Welcome
  • Getting Started
    • Using Local API Server
    • Authentication
    • Response
      • Error Codes
  • HaasScript
    • Using HaasScript
      • HaasScript Facts
      • Charting
      • Order Handling
      • Interval
      • Input Fields
      • Positions Handling
        • Fee correction
      • Position Information
      • Memory Management
      • Optimizations
      • Signal Handling
      • Trading
    • Script Editor
      • Syntax
      • Parameters
      • Interaction
    • Visual Editor
      • Blocks
      • Parameters
      • Flow Control
      • Interaction
    • Custom Commands
    • Tutorials
      • Trade Bot Guide
        • Creating A Trade Bot
          • Visual Editor Guide
          • Script Editor Guide
          • Custom Containers
        • Customizing Indicators
        • Customizing Safeties
        • Customizing Insurances
        • Creating Easy Indicators
      • Unmanaged Trading Guide
        • Executing Orders
        • Managing Orders
        • Managing Positions
        • Managing Wallet
      • Script Editor
        • Classes
        • MadHatter BBands
        • Percentage Price Change
      • Visual Editor
        • Importing Scripts
        • SmoothRSI
        • Scalper Bot
    • Commands
      • Array Helpers
      • Charting
      • Constants
      • Custom Commands Helpers
      • Easy Indicators
      • Easy Insurances
      • Easy Safeties
      • Equations
      • Flow Control
      • Input Fields
      • Input Settings
      • Mathematical
      • Memory Helpers
      • Miscellaneous
      • Order Handling
      • Order Information
      • Position Information
      • Position Prices
      • Price Data
      • Price Market Information
      • Profit Information
      • Settings
      • Signal Helpers
      • String Helpers
      • Technical Analysis
      • Technical Analysis Helpers
      • Time Information
      • Trade Actions (Managed)
      • Trade Actions (Unmanaged)
      • Trade Bot
      • Trade Market Information
      • Wallet
  • API Endpoints
    • Software API
    • Market Data API
    • Account Data API
    • Trade Data API
    • Advanced Order API
    • Trade Bot API
    • Custom Trade Bot API
    • ENUMS
    • Data Objects
  • Examples
    • Script Bots (C#)
      • Scalper Trade Bot
      • Flash Crash Trade Bot
    • Script Indicators (C#)
      • Indicator Script
      • Technical Analysis Library
    • Pshai Scripts (C#)
      • BBands Ext
      • BBands Ext v2
      • Chaikin A/D Line
      • Calibrator
      • Pshai's RVI
    • Scripted Driver
  • Other Resources
    • YouTube
    • Guides & Tutorials
    • Questions & Answers
    • Community Projects
  • Need Help?
    • Ask on Discord
    • Submit Support Ticket
Powered by GitBook
On this page
  • Execute
  • Place spot order
  • Place margin/leverage order
  • Cancel
  • Cancel template
  • Cancel order
  • Status
  • Get Template Associated Order Guids
  • Get Template Associated Orders

Was this helpful?

  1. API Endpoints

Trade Data API

Execute trades on exchanges through HTS

All the trade endpoints require a signature

Execute

Place spot order

Required input:

  • accountGuid: the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • price : the price on which the order is placed. Use 0 for market order.

  • amount : the amount of the order is the base currency.

  • timeout : order timeout in seconds (optional)

  • templateGuid : the guid of the template executed (optional).

  • userGuid : custom guid (optional)

Returns:

The executing template guid.

Example URL:

http://127.0.0.1:8050/PlaceSpotBuyOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&priceSourceName=Bittrex&primaryCoin=BTC&secondaryCoin=USDT&price=100&amount=1
http://127.0.0.1:8050/PlaceSpotSellOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&priceSourceName=Bittrex&primaryCoin=BTC&secondaryCoin=USDT&price=100&amount=1

Place margin/leverage order

Required input:

  • accountGuid : the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market

  • price : the price on which the order is placed. Use 0 for market order.

  • amount : the amount of the order is the base currency.

  • leverage : the leverage of the order.

  • timeout : order timeout in seconds (optional)

  • templateGuid : the guid of the template executed (optional).

  • userGuid : custom guid (optional)

Returns:

The executing template guid.

Example URL:

http://127.0.0.1:8050/PlaceLeverageEnterLongOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageEnterShortOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100000&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageExitLongOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageExitShortOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100000&amount=1&leverage=1

Cancel

Cancel template

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

A boolean indicating if the cancel is started.

Example URL:

http://127.0.0.1:8050/CancelTemplate?templateGuid=ea25296b-2c83-4e88-b0ff-680394a22f0f

Cancel order

Required input:

  • accountGuid : the account guid on which the order is active.

  • orderGuid : the order returned in GetOpenOrders()

Returns:

`EnumOrderStatus`

Example URL:

http://127.0.0.1:8050/CancelOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&orderGuid=ea25296b-2c83-4e88-b0ff-680394a22f0f

Status

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

`EnumOrderStatus`

Example URL:

http://127.0.0.1:8050/GetTemplateStatus?templateGuid=02264ffa-ac1f-4976-8228-8227a1a09298

Get Template Associated Order Guids

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

List with order guids

Example URL:

http://127.0.0.1:8050/GetTemplateAssociatedOrderGuids?templateGuid=02264ffa-ac1f-4976-8228-8227a1a09298

Get Template Associated Orders

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

List with orders

Example URL:

http://127.0.0.1:8050/GetTemplateAssociatedOrders?templateGuid=02264ffa-ac1f-4976-8228-8227a1a09298

PreviousAccount Data APINextAdvanced Order API

Last updated 6 years ago

Was this helpful?