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
  • Get Advanced Orders
  • Activate Advanced Order
  • Deactivate Advanced Order
  • Remove Advanced Order
  • Add Stop Order
  • Setup Stop Order
  • Add Take Profit Order
  • Setup Take Profit Order
  • Add Trailing Stop
  • Setup Take Profit Order

Was this helpful?

  1. API Endpoints

Advanced Order API

Execute stop, take profit or trailing stop orders on every exchange

All the trade endpoints require a signature

Get Advanced Orders

Required input:

Returns:

object with the guid as key and `AdvancedOrderBase` as value.

Example URL:

http://127.0.0.1:8040/GetAdvancedOrders

Activate Advanced Order

Required input:

  • guid : the guid of the advanced order

Returns:

`AdvancedOrderBase`

Example URL:

http://127.0.0.1:8040/ActivateAdvancedOrder?guid=74b0673d-b6d5-4769-b3d7-49f432ad21a8

Deactivate Advanced Order

Required input:

  • guid : the guid of the advanced order

Returns:

`AdvancedOrderBase`

Example URL:

http://127.0.0.1:8040/DeactivateAdvancedOrder?guid=74b0673d-b6d5-4769-b3d7-49f432ad21a8

Remove Advanced Order

Required input:

  • guid : the guid of the advanced order

Returns:

boolean

Example URL:

http://127.0.0.1:8040/RemoveAdvancedOrder?guid=74b0673d-b6d5-4769-b3d7-49f432ad21a8

Add Stop 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 (optional)

  • leverage : the leverage of the order

  • name : the name of the advanced order

  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`

  • amount : number

  • triggerPrice : the stop price

  • executionPrice : the price on which to place the order when the stop has triggered

  • executingTemplateGuid : the template guid which is used to place the order once the stop has triggered.

  • activate : boolean

  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.

  • startOrderPrice : the price on which to place the start order.

  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`StopTakeProfitOrder`

Example URL:

http://127.0.0.1:8040/AddStopOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=False&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&executionPrice=3000&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&triggerPrice=10000

Setup Stop Order

Required input:

  • guid : the guid of the advanced order

  • accountGuid : the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market (optional)

  • leverage : the leverage of the order

  • name : the name of the advanced order

  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`

  • amount : number

  • triggerPrice : the stop price

  • executionPrice : the price on which to place the order when the stop has triggered

  • executingTemplateGuid : the template guid which is used to place the order once the stop has triggered.

  • activate : boolean

  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.

  • startOrderPrice : the price on which to place the start order.

  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`StopTakeProfitOrder`

Example URL:

http://127.0.0.1:8040/SetupStopOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=False&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&executionPrice=3000&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&triggerPrice=10000

Add Take Profit 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 (optional)

  • leverage : the leverage of the order

  • name : the name of the advanced order

  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`

  • amount : number

  • triggerPrice : the take profit price

  • executionPrice : the price on which to place the order when the take profit has triggered

  • executingTemplateGuid : the template guid which is used to place the order once the take profit has triggered.

  • activate : boolean

  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.

  • startOrderPrice : the price on which to place the start order.

  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`StopTakeProfitOrder`

Example URL:

http://127.0.0.1:8040/AddTakeProfitOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=False&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&executionPrice=3000&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&triggerPrice=10000

Setup Take Profit Order

Required input:

  • guid : the guid of the advanced order

  • accountGuid : the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market (optional)

  • leverage : the leverage of the order

  • name : the name of the advanced order

  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`

  • amount : number

  • triggerPrice : the take profit price

  • executionPrice : the price on which to place the order when the take profit has triggered

  • executingTemplateGuid : the template guid which is used to place the order once the take profit has triggered.

  • activate : boolean

  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.

  • startOrderPrice : the price on which to place the start order.

  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`StopTakeProfitOrder`

Example URL:

http://127.0.0.1:8040/SetupTakeProfitOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=False&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&executionPrice=3000&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&triggerPrice=10000

Add Trailing Stop

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 (optional)

  • leverage : the leverage of the order

  • name : the name of the advanced order

  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`

  • amount : number

  • trailingStopPercentage : the trailing stop percentage

  • executingTemplateGuid : the template guid which is used to place the order once the take profit has triggered.

  • activate : boolean

  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.

  • startOrderPrice : the price on which to place the start order.

  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`TrailingStop`

Example URL:

http://127.0.0.1:8040/AddTrailingStopOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=True&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&trailingStopPercentage=18.5

Setup Take Profit Order

Required input:

  • guid : the guid of the advanced order

  • accountGuid : the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market (optional)

  • leverage : the leverage of the order

  • name : the name of the advanced order

  • orderDirection : string of `EnumOrderType` or string of `EnumFundsPosition`

  • amount : number

  • trailingStopPercentage : the trailing stop percentage

  • executingTemplateGuid : the template guid which is used to place the order once the take profit has triggered.

  • activate : boolean

  • startOrderOnActivation : boolean. When true a order will be placed to get into the position.

  • startOrderPrice : the price on which to place the start order.

  • startTemplateGuid : the template guid which is used to place the start order

Returns:

`TrailingStop`

Example URL:

http://127.0.0.1:8040/SetupTrailingStopOrder?accountGuid=6d2ff412-03ac-43ab-9dc6-47100a2fd266&activate=True&amount=1&executingTemplateGuid=LOCKEDLIMITORDERGUID&leverage=0&name=Test-Order&orderDirection=0&primaryCoin=BTC&secondaryCoin=USD&startOrderOnActivation=False&startOrderPrice=0&startTemplateGuid=LOCKEDLIMITORDERGUID&trailingStopPercentage=18.5
PreviousTrade Data APINextTrade Bot API

Last updated 6 years ago

Was this helpful?