TRADESIGNAL HOW TO 05.
EQUILLA BASICS.
PART 1: WITH EQUILLA TO TRADING SUCCESS.
If you want to enjoy the benefits of rule-based trading, you should be familiar with the programming of trading strategies. The translation of your own trading approach into programme code requires quite a lot of know-how. The first part of our new series on the formula-based language Equilla from Tradesignal is to show you how the language is structured and what options it offers to slowly create the basis for generating your own indicators and trading systems.
TABLE OF CONTENTS.
- Easy access due to formula-based language
- What is source code anyway?
- Functions form the basis for indicators
- How is the source code structured in Equilla?
- The first step has been done
NOTE: This paper was published in the German edition of the TRADERS’ magazine (issue 7/2014)
EASY ACCESS DUE TO FORMULA-BASED LANGUAGE.
Be honest: have you ever subjected your trading strategy to a back test and checked it for robustness? Do you know what the maximum draw down in the past has been, which loss series are „normal“ and what profit factor you can expect?
Answering these questions is a simple task for professional software. Nevertheless, many traders do not use this option because familiarisation with the world of programing is often very tedious and full of catches. With Tradesignal, valued by financial professionals, it doesn‘t have to be so hard.
BY THE WAY:
If you have already seen EasyLanguage™ by TradeStation® before, you will quickly find your way within Equilla. Almost any program code can be re-used in Equilla (copy & paste).
The in-house programming language Equilla is based on the wide-spread languages of Pascal and Visual Basic and forms the basis for all indicators and trading systems that Tradesignal includes by default. These can be simply and comfortably pulled into the chart by drag and drop and are thus ready for use at once.
The best thing is that the respective source code can be viewed openly (open source) and so offers the best opportunity to imagine how the formula-based language thinks and performs changes by altering the code. For newcomers, this is a particularly good opportunity to get ahead in “learning by doing”, to slowly generate their first own indicators and trading strategies. There is barely any limit to your imagination.
WHAT IS SOURCE CODE ANYWAY?
In programming, source code means the text of a computer programme that is legible for people and written in a programming language. For it to be translated into binary machine language by the computer and then also executed (this is done by the “compiler”) the source code must contain all instructions precisely and completely. According to proper syntax in “normal” languages, the source code therefore must be written under compliance with specific rules (called “syntax”). For traders this means: no matter if their programme is about entry into a position, exit or stop – everything must be defined 100 percent; the computer cannot handle “vague” rules. This is where many traders already notice that the strategy they believed to be clearly defined in fact contains many subjective elements. This is what must be eliminated if you want to trade 100 percent rule-based. Discipline is a prerequisite for performance – also when creating trading strategies.
The source code is generated in different ways, depending on software. Tradesignal offers two options: there is the Equilla Editor (see figure 1), which permits input of the programmme lines according to a simple text editor, as well as the trading system wizard which permits entire trading strategies to be generated using individual components. Our article series focuses on the editor.
FIGURE 1: USER INTERFACE IN TRADESIGNAL.
Tradesignal offers near-unlimited opportunities to generate indicators, chart patterns and entire trading systems with the formula-based language Equilla.
FUNCTIONS FORM THE BASIS FOR INDICATORS.
It is very simple to look “inside” the Equilla code. Right-click the trading system or the indicator in the chart. This shows you that every indicator, every chart pattern and all trading systems make use of functions. A function is a subordinate programme part into which calculations and programme instructions that need to be reused more often are outsourced.
A SIMPLE EXAMPLE:
Instead of programming the complete calculation of the standard deviation every time, it is “packed” in a function and applied with a name. By calling the name, the programmer will have the desired result available at any time without detours and will be able to reuse it within the source code. To calculate a moving average (MA), the function “AverageFC” is already predefined in Tradesignal.
Inputs:
Price( NumericSeries ),
Period( NumericSimple );
If Period > 0 Then
AverageFC = SummationFC( Price, Period ) / Period
Else
AverageFC = 0;
FIGURE 2: FUNCTION “AVERAGEFC”.
The function shown above calculates a simple moving average. Functions are the foundation for indicators, from which trading strategies can be created.
HOW IS THE SOURCE CODE STRUCTURED IN EQUILLA?
The results of the functions just described form the basis for the actual indicator. As an example, we show the “simple moving average” (SMA) in figure 3, which permits the MA on a price series to be displayed. The associated code is used to explain the basic programme structure and syntax of Equilla.
Meta:
Categories( "Trend Follower" ),
Synopsis( "This is the finished indicator, which calculates the Simple Moving Average. It is based on the functions AverageFC and SummationFC." ),
ShortCode( "SMA" ),
SubChart( False );
Inputs:
Price( Close ),
Period( 10, 1 );
DrawLine( AverageFC( Price, Period ), "SMA");
FIGURE 3: EQUILLA CODE FOR INDICATOR „SIMPLE MOVING AVERAGE“.
The code contains all parameters that can later be changed or optimised by the user in the input area. Then there is the command for the graphical illustration of the moving average in the chart (DrawLine).
Let us start with the header part of the code, which is always recognised by the term „Meta:“. Here, global (meta) information for the indicator is specified. In this specific case, the programmer has defined the following:
- Synopsis: A description of the indicator
- ShortCode: A short code with which the indicator can be quickly loaded into the chart via a keystroke
- SubChart: The instruction that the indicator is not to be displayed in a subchart (false), but the main chart
Next comes the input area. Here, the user-specific parameters called “inputs” are described, which can later comfortably be modified via the input mask of the software or optimised via an optimisation tool. In the specific case, the input “Price ( Close )”specifies that the SMA is to be calculated at the closing price.
The input “Period ( 200, 1 )” is used to enter the period number. The standard setting here is specified with the value 200. Then number 1 after the comma means that 1 is the smallest possible input value.
Another important task is met by variables, which serve as a kind of “container” within the source code. They save results and make them accessible for further processing and later use. This indicator code contains no such variables. In the second part of our Equilla series, we will deal in detail with their description and use in the scope of a trading system.
Let us now come to the next part of the programme. This is all about calculation. In this specific example, the MA must be calculated for each period. This is done by the function “AverageFC” that has already been mentioned. If the calculated indicator value is to be output in a visual form, only the right closing command is needed after this. With the expression “DrawLine”, the software is instructed to draw a line.
The attentive reader will have noticed here that the use of commas and semicolons plays an important role when programming. Generally, a comma is used in each case to specify inputs and variables. Only the end of the last instruction needs to use a semicolon so that the code can later be translated (“compiled”) properly. In Tradesignal, compiling can be started by pushing F7. The software does the rest.
BY THE WAY:
In the Equilla editor named above, parts of the source code are highlighted in colour according to their functions (e.g. “DrawLine”). This makes it easier to read the code. Additionally, the visual structure helps in finding errors that – if present – will be displayed automatically in the editor with a precise line reference.
Particularly for new users, it is helpful to right-click the blue terms for detailed information and example applications. While writing code, small help windows also provide valuable advice on the proper use of a term.

FIGURE 4: HIGHLIGHTING PROVIDES FURTHER INFORMATION.
For detailed information and example applications it is helpful to right-click the blue terms.
THE FIRST STEP HAS BEEN DONE.
All readers who have stayed with us until here have completed the first step towards programming. Congratulations! Figure 5 summarises the components with which a complete trading system is made up and what role functions and indicators play for the construction of trading systems in this in a chart.
In the next part of our Equilla series, you will learn how the SMA indicator presented here can be used to generate a trading system. Crosses of the price with the MA are used to close long or short positions. We will also deal with the meaning of loops within an Equilla code and deal with the implementation of a stop.

FIGURE 5: SCHEMATIC STRUCTURE OF A TRADING SYSTEM.
The interaction of indicators, patterns and so on, as well as the respective conditions that activate specific commands on demand is the basis of a rule-based trading system. For questions about Tradesignal we are always happy to help.
If you are not yet a Tradesignal customer, we will gladly provide you with a trial version.
That’s it for today. Take care, take profit and auf Wiedersehen.
(Copyright notice: EasyLanguage™ is a registered trademark of TradeStation Technologies, Inc.)