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
  • Basic Information
  • Sorting
  • Tooltip
  • Grouping
  • Comment Inputs
  • Input
  • InputInterval
  • InputOrderType
  • Account & Market
  • Pricesource & Price Market
  • Options Drop-down
  • ‌InputOptions
  • ‌InputConstant‌
  • Constant Helpers‌
  • Tables

Was this helpful?

  1. HaasScript
  2. Using HaasScript

Input Fields

PreviousIntervalNextPositions Handling

Last updated 5 years ago

Was this helpful?

Basic Information

With the input field command you can create dynamic input field for your script. The command will create an input field in the settings menu after the script is saved. Using input fields for dynamic values such indicator parameter makes your life easier when tuning the script.

Sorting

Inputs fields are automatically sorted alphabetically. You can influence the sorting by numbering the input field.

Tooltip

An input name should always be short but clear. Sometimes you need more room to explain the setting. Each input command has a tool-tip parameter which can be used to store and show additional information about the input.

Grouping

Grouping input fields is a way to have clear sections in the menu. You can do this in two ways. The first, and easier way, is the group parameter which every input command has. This will group all the inputs with the same group name and add a group header above them. Input fields without a group will be grouped under Other Settings.

The second grouping method only works in the script editor as used InputGroupHeader(). This will automatically group and sort all inputs defined after that, until a next InputGroupHeader() is used. Input fields above the first header are groped under Other Settings.

InputGroupHeader is not available in the visual editor.

Comment Inputs

Input

The most used input field command will be Input. This single command can create three types of input fields depending on the default value. The command supports numbers, text, and checkboxes. When there is no default value specified the default type will be a text field which can be used as a text or as a number input.

InputInterval

Creates a drop-down list with all available interval options. Can be used for multi-interval strategies.

InputOrderType

This creates a drop-down with the available order types. The result can be used in combination with SetOrderType or the PlaceOrder commands.

Account & Market

The InputAccount() command will create an account options drop-down. The return value is the account guid and can be used for every command containing an account or market parameter.

‌With InputMarket() you can create a market drop-down that is connected to the selected main account. The return value can be used for every command containing a market parameter.‌

InputAccountMarket() will create 2 or 3 drop-downs depending on the selected account. One drop-down for a secondary account and the second is a market drop-down related to that account. Possibly a third drop-down when the selected market is margin/leverage. The return value will be a concatenated string of the account, market, and leverage. This can be used for every command that contains an account, market or leverage parameter.

Pricesource & Price Market

InputPriceSource() will create a options list will the available price sources. With the return value and CreateMarket we can create market string of the main market and selected price source.

InputPriceSourceMarket() will create both a price source and market drop-down. The return value can be used for every command that requires or has an optional market parameter.

Options Drop-down

‌InputOptions

‌Creates a drop-down with custom values.

‌InputConstant‌

Create an options drop-down based on the default value. All the commands belonging to the same category will be listed in the drop-down.

Constant Helpers‌

There are also a few input commands that are designed for a specific category. Commands like InputMaType(), InputSignalType() and InputCdlType() create a drop-down with all the options in that category.

Tables

HaasScript also supports tables as input fields. Although the support is limited to the script editor and only number fields are available, this type of input is perfect for settings like a market-making script or crypto index bot.

‌The command returns an array with the row values. By using a simple for-loop we can loop over the rows and collect the parameters.

‌The first parameter of the InputTable() should always be the InputTableOptions(). This is where we define the table specifications like the name, fixed number of rows, max number of rows and group. When the fixed number of rows is anything other than 0, the table will have a fixed number of input rows that cannot be deleted or expanded. maxRows() allows for maximum numbers or rows without a minimum.

‌ The rest of the parameters for InputTable() are the InputTableColumn() commands. This defines the column header and possibly (recommended) default values.

Input Fields