|
Trading Blox Builder Architecture |
Top Previous Next |
|
Now that we've built a simple system lets look a little deeper into the architecture of Trading Blox.
Trading Blox has many different parts. This can be a bit overwhelming for a new user. Fortunately, if you examine each of the pieces one by one they are not hard to comprehend.
If you followed the previous examples, you've already used each of the following components:
Suites A test suite is a collection of specific settings for a particular set of systems. Let's say you were testing a Dual Moving Average system 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 the current Test Suite. To save these settings you can create a new Test Suite, calling it something like "Dual MA and RSI".
Suppose you wanted to work on a new system without disturbing your existing settings. You could create a new Test Suite for working on the new system. Later by simply switching to the "Dual MA and RSI" suite you can get back the exact same settings.
Suites can always be seen in the upper left of the Trading Blox Builder screen. You can create new suites or delete unused ones. You can also lock your suite when you are satisfied with it to keep from accidentally changing your settings. You must lock a suite in order to generate orders.
Systems A system is a collection of formulas and rules that define enties and exits for a set of markets. In Trading Blox Builder, systems are a collection of smaller components called Blox. If you own the Turtle 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. If you own Trading Blox Builder Builder, you can create your own Blox.
Trading Blox Systems consist of the following components:
Blox Blox encapsulate trading ideas. Blox are self-contained parts of a trading system that are designed to be connected with other Blox as part of a System.
The basic components of a trading idea are:
A Trading Block encapsulates these trading idea components into a package which can be easily connected to other Blox.
Blox can also be used in multiple systems at once. This is one of the most powerful features of Trading Blox Builder Builder.
Scripts 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.
The most important Trading Objects in Trading Blox Builder are the "Instrument" and "Broker" objects.
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:
instrument.close
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.
Variables 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 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 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.
Units 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, 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.
|