Trading Objects represent real-world objects used in trading, the instrument object represents a tradeable market, the broker represents the broker who takes your orders, etc.
Blox Basic scripts use the Trading Objects to access information and to affect the trading simulation.
The Trading Objects used in Trading Blox Builder are:
Object Names: |
Description: |
---|---|
Alternate Objects are created for accessing data outside of the range of a system's normal context or object range. |
|
represents the current Trading Block and is generally only used for debugging purposes |
|
Broker methods are used to enter orders with their stops when protective exit prices are used, and exiting positions.
Broker Entry order call the Unit Sizing script, which is followed by the Can Add Unit script. Both entry and exit orders are processed by the Can Fill Order script. |
|
used to create custom charts |
|
used to send emails from scripting |
|
used to read and write files |
|
Represents a given market, or a tradeable instrument to access pricing, position, and other information that is useful for influencing system orders and positions. |
|
contains information about the order used in the Can Fill Order script |
|
used to access custom user scripts |
|
represents the system itself and is used to access system-level information such as the total equity |
|
represents the test and is used to obtain test-level information like the start and end dates |
All data instruments with a price record have a for each record and have the values to create a displayed price-bar. Each daily, weekly and monthly price bars have a records that shows the Open, High, Low, Close prices for the time period. This price bar is what is displayed on a chart as a vertical bar on a chart display.
This approach is also true for Intraday data where the same date and time of day value is used for building a series of price records. The same (Open, High, Low, Close) values show the different transaction times for an Intraday price bar. It is also used for instrument records where less than four price records show the open, high, low and close or last price of a price record.
When looking back through a series of price records, or through a series of date records, the most current record is referenced with a series offset value of zero. This is how the most current price record is indexed (i.e. instrument.date[0]).
During a system test, the previous data file's index record can be accessed by adding a value of one to what had been a value of zero when it was the current date record being accessed.
All instrument data records are automatically indexed during a test. In a test of a data file that has one-hundred records, the current date will always be zero. To access the previous record, the index value must be one. To access the record of four days ago, that record is accessed using an index value of three: instrument.date[3].
At the end of the data, that
just a test to see an indicator, the index value increase is value. For example, if today's price uses an index of instrument.date[0], the previous price record is identified by adding a "1" to its previous index, instrument.date[1]. To go back two-days, the reference would be: instrument.date[2].
is the current instrument record for any symbol. This offset method is also true to reference the property value of a property like Total Equity. For example test.totalEquity[0] is the current equity value made available at the end of the current test day. Test information that can be access previous values created during test simulation are contained in an array. An array is a series of values and property and instrument information that allows access to previous information is known as a series because of values that were created earlier in a test.
Users can create a series for storing earlier information in either a BPV or an IPV data type. Series in both data types can be auto-index or they can be manual. Auto-index series automatically get size with the required number of array elements. Manual series must be sized and indexed by the programmer creating a manual series. Manual series have the require functions to handle sizing, referencing, and sorting in two different ways and directions. Auto-indexed BPV series are aligned to test.currentDay values. Auto-indexed IPV values are aligned to each instrument’s price record.
All Trading Blox default properties that are kept in a series are automatically created and kept current by Trading Blox. User created series must be first created and then their values must be maintained serviced by code the programmer creates to keep each element in the series useful.
To reference other price bars or equity values that are preserved in a series use this reference to help you understand what is being referenced:
Current |
1-bar ago |
2-bars ago |
3-bars ago |
4-bars ago, etc… |
test.totalEquity[0] |
test.totalEquity[1] |
test.totalEquity[2] |
test.totalEquity[3] |
test.totalEquity[4] |
Bar Indexing Examples: |
---|
Previously Trading Blox provided constants today and yesterday to use. These are no longer supported.
Properties listed with a '[ ]' must now be indexed using an offset number: ' Test Total Equity from 4-bars ago is assigned to the variable equity. ' A value of 1 references date record just before this date. |
Syntax Colors: |
---|
Trading Blox Basic Editor will color various script element types with the colors set in the Syntax Colors section of the Blox Basic Preference section.
Professional coding editors by default use syntax coloring. Coloring various code elements in various ways helps the person writing the code to understand when the spelling is correct, and in the case of Trading Blox Basic Editor, they can also understand if the object element is in context in the script section where the object's element is being referenced. Coloring variation of different groups helps to make reading easier and faster when type types use different colors.
Trading Blox Basic Editor will also vary the color of object elements that have designated scripts where the that object is not normally in context. This means that the color of a object type will be the color designated in the Preference's Syntax Colors, but it will be a different color when it is in a script section where it is not normally in context in the script section. |
Edit Time: 10/28/2020 11:47:15 AM |
Topic ID#: 634 |