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
  • General information about HaasScript
  • Limitations
  • Syntax
  • Execution speed
  • Memory
  • Webhooks
  • Commands
  • HaasScript usage
  • HaasScript creation
  • Script conversion
  • HaasScript ownerschip

Was this helpful?

  1. Haasscript

About

General information about HaasScript

HaasScript is a powerful scripting language developed by HaasOnline for building trading bots. It was introduced in version 3 of the TradeServer and is now the primary bot programming core for the Cloud and Enterprise Edition.

One of HaasScript's strengths is its ability to access a wide range of market and bot information, which can be used to make informed trading decisions. It also offers both managed and unmanaged trading capabilities, giving users the flexibility to choose the level of control they want over their trading strategies.

In addition, HaasScript supports reading and trading in multiple markets, which makes it possible to execute arbitrage trades. This feature can be particularly valuable for experienced traders looking to take advantage of price differences across different markets.

Limitations

For safety reasons, HaasScript does not support the withdrawal of deposit capabilities. This is in place to help protect users' funds and prevent unauthorized access to their accounts. While this limitation may be inconvenient for some users, it ultimately helps to ensure the security and integrity of the trading platform.

Syntax

HaasScript is a case-sensitive language that is built on top of LUA. It includes custom commands that have been added specifically for HaasScript.

While HaasScript shares many similarities with LUA, there are some differences between the two languages. For example, certain LUA commands have been replaced with custom HaasScript commands. For instance, the print() command in LUA has been replaced with the Log() command in HaasScript.

This allows HaasScript users to take advantage of additional functionality that has been specifically designed for trading bots, while still maintaining some compatibility with the underlying LUA language.

Execution speed

By default, HaasScript is designed to execute on a per-minute basis. However, for users who require faster execution speeds, there are options available to increase the processing frequency.

For instance, if high-speed execution is enabled, HaasScript can run as frequently as every 10 seconds on the Cloud platform, and every 5 seconds on the Enterprise platform. This allows users to take advantage of real-time market data and execute trades quickly and efficiently.

Memory

HaasScript includes a memory feature that enables variables to be saved and retrieved using the Load() and Save() commands. This memory is session-based, meaning that it is only available during the runtime of a given script. Once the session ends, the memory is automatically cleared. This allows HaasScript to store and retrieve data as needed without overloading system resources or creating conflicts between different sessions.

Webhooks

HaasScript enables the use of webhooks signals through its GetRemoteSignal() command. This feature allows the script to receive external signals from various sources, such as TradingView, which can then be used to trigger actions within the bot. By leveraging webhooks, HaasScript provides a flexible and powerful way to integrate with external platforms and services.

Commands

HaasScript allows users to create and store their own custom commands for use in their scripts. This feature provides a high degree of flexibility and customization, as users can tailor the language to fit their specific needs and trading strategies. With the ability to create and use custom commands, HaasScript provides a powerful tool for bot development and automation.

HaasScript usage

HaasScript can be generated either through scripting or visual drawing. In the case of visual drawing, the created drawing is executed through HaasScript. There are three ways to create bots using HaasScript:

  1. Visually drawing trade-bots using basic indicators, insurances, and safeties

  2. Visually drawing or scripting bots using managed trading signals

  3. Scripting advanced bots using unmanaged trading.

Draw Trade Bots

For those who are new to HaasScript or those who are accustomed to the previous trade-bot, HaasOnline recommends using the draw trade bots feature.

A drawn trade bot consists of a TradeBotContainer, which is accompanied by three containers; IndicatorContainer, InsuranceContainer, and SafetyContainer. The IndicatorContainer contains Easy Indicators, the InsuranceContainer contains easy insurances, and the SafetyContainer contains easy safeties.

The Easy Indicators generate a signal, which is then evaluated by the insurances. If the signal is approved by the insurances, it is executed. On the other hand, the safeties stand by and monitor the activities, and if their signal is triggered, it immediately goes for execution. Therefore, while the insurances evaluate the signals from the indicators, the safeties can also override the signals from the indicators and insurances.

Managed Trading

Managed bots are intended for more experienced users who prefer to script their own bots while keeping things simple. With managed bots, executing a trade is as simple as calling on a few basic commands. The background engine handles the trade-amount details and order handling, allowing users to focus on the overall strategy of their bot.

Unmanaged Trading

Unmanaged bots are geared toward highly skilled users who require complete control over the entire order execution process. These users want to have complete autonomy when it comes to determining the trade amount and managing the ordering process. The unmanaged bots contain the full logic needed to accomplish this level of control.

HaasScript creation

HaasOnline does NOT provide a service to create custom HaasScripts on demand. However, the company offers a chatbot named Thomas that can generate script concepts upon request. Additionally, in the HaasOnline Discord community, there are individuals who offer their services to create HaasScripts based on specific requirements.

Script conversion

HaasOnline does NOT provide a service to convert scripts to HaasScripts on demand. However, the company offers a chatbot named Thomas, Thomas is able to covert scripts to HaasScript (and visa versa). Additionally, in the HaasOnline Discord community, there are individuals who offer their services to convert HaasScripts too.

HaasScript ownerschip

The creator of each HaasScript holds ownership over it, ensuring privacy and copyright protection.

PreviousExternal WalletNextChange Log

Last updated 1 year ago

Was this helpful?