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.

Last updated