Script Basics
The Quadcode Script (QSC) is your efficient helper in creating and editing custom indicators.
The QCS is based on the Lua version 5.3, which means you are welcome to use its most popular features. The QCS takes into calculation the value of the trading instrument, and uses various data, such as current asset price data, historical data, and the settings you will indicate in the script.
You can use any code editor to write a script, but the easiest way is just to open the built-in code editor to create scripts right in the traderoom. It will help you see the outcome of your script in real time.
There are more than 100 indicators, working in the traderoom. We have chosen the most popular and efficient indicators out there, so you can start using them right away.
You can also tailor the script with your custom settings. For that, you just need to copy the existing script and paste it into the code editor of your choice.
More about Lua
The QC Script is based on the Lua language for a reason. The Lua language is fairly easy to learn, and is known for being lightweight and flexible. The basics you need to know about the Lua language:
- It runs quickly and doesn’t make the platform slow down while compiling scripts.
- As Lua was initially designed to be embedded in applications and other software, its flexibility allows you to create scripts with both Lua features and QCS custom functions easily.
- Lua is known for its efficiency as a script language, so the initial syntax of the language meets the majority of requirements for writing working and powerful scripts.
Useful Sources
Quadcode Script and Lua Interaction
The Quadcode Script uses the majority of Lua functions to create scripts which will work for the trading platform.
- Custom parameters. Through input functions, you can pass custom parameters in the script, such as colors, indicator’s periods, lines’ styles and width, etc.
- Indicator visibility. You can set the indicator’s display, whether it is an overlaying one or a separate indicator’s mini-chart.
- Predefined functions. You are welcome to include the predefined functions into your scripts, which can make calculations, on which the indicator is built, define overbought and oversold levels and many more.