LogoLogo
Back to HaasOnline.comSwitch to Developer API
4.x
4.x
  • Welcome
  • TradeServer Cloud
    • Overview
    • Security
    • Troubleshooting
  • TradeServer Enterprise
    • Overview
    • Updates
    • Security
    • Installation
      • Windows
      • MacOS
      • Linux
    • Configuration
      • License Key
      • Login credentials
      • Hosting
        • Linux VPS Hosting
    • Special features
      • Price history
      • Backups
      • Machine Learning
        • Built-in Machine Learning
        • Custom Machine Learning
      • Scripted Exchange API (Coming Soon)
      • Local API (Coming Soon)
    • Troubleshooting
  • Interface
    • General Interface
      • Left Menu
      • Upper Right Items
        • Account data
        • Execute trade
        • AI Chatbots
          • Chatbot Julia
          • Chatbot David
          • Chatbot Thomas
        • Notifications
        • Menu
          • Exchange accounts
          • Settings
          • License information
          • Change Logs
          • Logout
      • Status bar
        • Price tickers
    • Dashboard
    • Bots
      • Bot management
      • Bot templates
    • HaasScript
      • Web Editor
      • Backtest Lab
        • Lab test setup
      • Backtest History
      • Manage Scripts
      • Manage Signals
    • Tools
      • Marketview
      • Market intelligence
      • Exchange profiler
      • Markets explorer
      • News
    • Finance
      • Portfolio
      • External Wallet
  • Haasscript
    • About
      • Change Log
    • Tutorials
      • Bot building
        • Trade-bot building
        • Visual bot building
        • Scripted bot building
      • Usage
        • HaasScript
          • Interval
          • Markets
          • Input Fields
          • Memory Management
          • Signal Handling
          • Position Information
          • Positions Handling
            • Fee correction
          • Order Handling
          • Trading
          • Charting
          • Optimizations
        • Visual Editor
          • Blocks
          • Parameters
          • Flow Control
          • Interaction
        • Script Editor
          • Classes
        • Managed Trading
        • Unmanaged Trading
    • Commands
      • Trade Bots
        • TradeBot Containers
        • Easy Indicators
        • Easy Safeties
        • Easy Insurances
      • Helpers
        • Array Helpers
        • Custom Command Helpers
        • Enumerations
        • Equations
        • Mathematical
        • Memory Helpers
        • Signal Helpers
        • String Helpers
        • Miscellaneous
        • Technical Analysis Helpers
      • Input data
        • Bot Settings
        • Input fields
        • Price Market Information
        • Script Settings
        • Time Information
        • Trade Market Information
      • Prices
      • Technical Analysis
      • Charting
      • Trading
        • Managed Trade Commands
        • Unmanaged Trade Commands
        • Order Information
        • Order Handeling
        • Position Information
        • Position Price Information
        • Profit Information
        • Wallet Information
      • Social Media
    • Built-in Bots
      • Version 3 bots
        • C# Scripted Bot
        • Email bot
        • Trendline Bot
        • Triangle Arbitrage Bot
      • Accumulation Bot
      • Enhanced RSI bot
      • FlashCrash (Grid) Bot
      • Crypto Index Bot
      • Intellibot Alice
      • Inter Exchange Arbitrage Bot
      • MadHatter Bot
      • Market Making Bot
      • Order Bot
      • PingPong Bot
      • Scalper bot
      • Zone-Recovery Bot
    • Community Bots
      • Simple Grid Bot (SPOT)
      • Simple Grid Bot (FUTURES)
      • Simple Market Maker (SPOT)
      • Simple Market Maker (FUTURES)
  • Usage
    • First Usage
    • Setup Exchange
      • Adding an API to the Platform
      • Binance
      • Binance US
      • Bit2me
      • Bitfinex
      • Bitget
      • BitMEX
      • ❌Bitpanda
      • Bitstamp
      • ❌Bittrex
      • Bybit
      • ❌Cex.IO (Legacy API)
      • ❌Coinbase
      • ❌Crypto.com
      • Deribit
      • Gemini
      • Gleec
      • ❌HitBTC
      • Huobi
      • ❌Ionomy
      • Kraken
      • Kraken Futures
      • KuCoin
      • KuCoin Futures
      • LBank
      • ❌OKCoin
      • OKX
      • OKX-Futures
      • OKX-Swap
      • Phemex
      • Poloniex
      • Poloniex Futures
      • WooX
    • Setup Telegram Notification Bot
    • Setup Discord Notification Bot
    • Use Signals
  • 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
  • Comment Inputs
  • Account & Market
  • Pricesource & Price Market
  • Options Drop-down
  • Tables

Was this helpful?

  1. Haasscript
  2. Tutorials
  3. Usage
  4. HaasScript

Input Fields

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.

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.

PreviousMarketsNextMemory Management

Last updated 1 year ago

Was this helpful?