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
  • Order Management
  • Cancelling orders
  • Open orders
  • Order Information
  • Order containers and collections
  • Cancelled amount
  • Filled amount
  • Order timestamp

Was this helpful?

  1. HaasScript
  2. Tutorials
  3. Unmanaged Trading Guide

Managing Orders

PreviousExecuting OrdersNextManaging Positions

Last updated 5 years ago

Was this helpful?

Order Management

Order management is crucial for the more advanced bots and trading systems.

With these commands you are able to:

  • Cancel all or specific orders

  • Check if orders are open or filled

Cancelling orders

To cancel a specific order, we use CancelOrder.

To cancell ALL orders, we use CancelAllOrders.

Open orders

There are multiple ways to check for open orders.

We can either do IsAnyOrderOpen, which checks for any open orders in the bot or a system. If the positionId parameter is not set, then the system will check for all orders that a bot or system has created.

This command also works for managed trading.

Or we can do IsOrderOpen to check for specific order.

Order Information

Gather order information to keep an eye on your orders and let your system know what it needs to do next. Using this category of commands you can check if an order is partially or fully filled, how much the fee costs are, when was the order opened and much more.

Order containers and collections

To get all possible information about partially filled and filled orders, we use GetAllFilledOrders. This command returns a collection of all (partially) filled orders executed by the bot.

Not available in Visual Editor. Use OrderContainer instead.

For open orders, we use GetAllOpenOrders. This command returns a collection of all open orders executed by the bot.a

Not available in Visual Editor. Use OrderContainer

For all order-specific information, we use OrderContainer. The returned value is an array that contains the information.

Cancelled amount

To get order's cancelled amount, we use GetOrderCancelledAmount. This amount is what was left unfilled when the order was cancelled, or the full amount when the order is completed.

Filled amount

To get the order's filled amount, we use GetOrderFilledAmount. This value tells how much of the order has been filled. The amount will be the same as the executed amount if the order is filled.

Order timestamp

To get the time when the order was created, we use GetOrderOpenTime. The returned value is presented as minutes.

Cancelling specific order
Cancelling all open orders
Cancelling all open orders