Trading Blox Architecture


A test Suite is a collection of systems, the system parameters, and the suite parameters.  Let's say you were testing a Dual Moving Average system along with an RSI system and you had a certain portfolio and certain parameter settings that you liked. Your settings for these two systems including the system allocations for the Dual MA and RSI system are stored in a suite. Changes are saved automatically.


Suppose you wanted to work on a new system without disturbing your existing settings. You could create a new test suite and select the desired system. Later by simply switching to the "Dual MA and RSI" suite you can get back the original settings.


Suites can always be seen in the upper left corner of the Trading Blox Builder main menu screen.  Controls available to  Suites will create new suites, copy or rename existing and remove suites.  Suite structures can be locked, and unlocked.  Locking prevents parameters from being changed. It does not prevent the blox or systems from being changed.

Suite Name List Examples

Suite Name List Examples


A system is a collection blox.  Each block contains indicators, parameters, variables, and scripts.  If you own the Basic version of Trading Blox Builder, you can use the built in systems that are provided.  If you own the Pro version, you can assemble your own systems using the build-in Blox or ones that you  download or purchase from others.  Traders who have Trading Blox Builder Builder versions can create your own Blox.

Trading Blox Systems Types:

System Component

Corresponding Block Type

What to Trade

Portfolio Manager

When to Trade

Entry Blox

Whether to Trade

Risk Manager

How Much to Trade

Money Manager

When to get out

Exit Blox

User ideas



Blox Modules:

Blox are system modules that encapsulate trading ideas. Most of the Blox are self-contained parts of a trading system designed to be connected with other Blox as a component part of a trading system method.  Some Blox can access data outside of their module, and outside of their system when their scope settings are set for external access.


The basic components of a trading idea are:

Parameters: - used by indicators to determine their specific computation result, for example: the number of days in a moving average.  Not all Blox require parameters when the numerical basis for internal calculations is coded into the scripted code.

Indicators: - used by the rules as indicators of market conditions, moving averages, RSI, ADX, etc.  Many indicators are available within the Indicator section of a Blox.  Those not available in that area can be created by entering the source code required for an indicator calculation result.

Rules: - used to determine when to enter or exit; how much to buy or sell, or how much risk is too much, buy on moving average crossover, what instruments to allow and other ideas.  A rule can be as simple as Buy If RSI > 55 etc.

By encapsulating trading ideas into a stand-alone Blox module, a package is created that can easily be linked to one or more systems that need the trading idea contained within the Blox.  Blox are trading objects, and while these objects only need to be created once, they can be many times by other systems to simplify the creation of different system methods.


The same Blox can also be used in multiple systems at once because the parameter setting values of the system's blox are is restricted to the system they are assigned.  Blox are one of the most powerful features of the Trading Blox Builder Builder versions because it support the concept that makes features created in one blox to be used in many systems at the same time.


Just like a director and actors in a movie use scripts to coordinate action, Trading Blox Builder uses scripts to coordinate trading and to implement a system's rules. Scripts are more powerful than simple rules and they can even be used to implement sophisticated risk and portfolio management algorithms.


Trading Blox Builder defines script types which are run at specific times during the simulation which correspond with specific times during the test and trading day. Some scripts have a specific function (such as adjusting stops for the day) while others are simply place holders for tasks that need to be performed regularly like end of day calculations, keeping track of risk, etc.


Trading Blox Builder is quite smart about when it executes scripts in system.  For instance, the "Entry Order Filled" script in an Entry Block only gets run when a trade is entered because an entry order's conditions were satisfied by the market. This is one of the reasons that Trading Blox Builder is so fast.


For more information on the Scripts available in Trading Blox Builder, see the Script Reference section.

Trading Objects:

Since Trading Blox Builder simulates real trading as closely as possible to enable you to implement trading systems that are as realistic as possible, we use concepts called Trading Objects in our scripts with correspond with the real world trading things (or objects) like brokers, instruments, etc.


Scripts use the instrument object to get information about the current stock or futures market (i.e. instrument). So a script might access the current stock's close using the following code fragment:




This shows a "property" of the "Instrument" trading object called "close". Properties are used to access data associated with a trading object.


A script might also tell the broker to enter a stop order using a code fragment like this:


broker.EnterLongOnStop( entryPrice, protectStopPrice )


this tells the broker to enter a Buy Stop to initiate a long position at the price represented by "entryPrice" with an exit stop to be entered at the price represented by "protectStop" in the event that the entry stop is filled.


"EnterLongOnStop" is an example of a "function" of the "Broker" trading object. Functions change the way a simulation behaves or change the state of test data. Functions affect the outcome of a test directly.


For more information on the Trading Objects used in Trading Blox Builder, see the Trading Object Referennce section towards the end of this manual.


The last example used two Script constructs known by programmers the world over as "variables".


Variables are simply a name which represents a value or series of values. If you have used a spreadsheet then you have used variables. For example, in a spreadsheet column B row 4 might be the total sales for the month. In Excel you could name this cell to something like "monthlySales" then in other cells you could refer to that variable (cell) as either B4 or "monthlySales".


In Blox Basic you can create variables which have names and can hold values just like a spreadsheet cell can.


So the name "entryPrice" in the above script fragment is a place holder for the value which corresponds with the entry price, while the name "protectStopPrice" is a place holder for the value which corresponds with the stop price which should be used to exit the position.


For more information on using Variables in  Trading Blox Builder, see the Variables Reference section.


Parameters are a special type of variable which can be stepped using the Trading Blox Builder parameter stepping features. You should define a parameter instead of using a fixed constant value in the trading rules for a system.


Parameters are also often used to define indicators.


Indicators are another special type of variable which can be displayed on the trade chart.Trading Blox Builder includes most of the common indicators, Moving Averages, MACD, ATR, RSI, ADX, etc. Many trading systems are built using indicators.


The concept of units is used throughout this manual. Units refer to concurrent positions taken in the same instrument as part of the same trade. When you enter a position direction for the first time, for example you enter long when you were previously short or out, this new position is the first unit. If you then enter long again, that would be the second unit. In this way you can pyramid your positions, by entering multiple units at different prices and different quantities. You can also exit these positions separately, or all at once.


Edit Time: 1/5/2018 2:54:30 PM

Topic ID#: 633


Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software