Companion function to the software's System Object. It is used to allow access to scripts and values in systems other than the system in which this function is being executed. Most often this function is used in a Suite where a GSS system (a system with the same name as the Suite name) that is intended to access information in other systems in the Suite.
It gets access to the information in other systems in the Suite when it is called using the index of the system where it wants to access information. It gets access to information by bringing that system into context so the system executing this function can access information using the "alternateSystem" object prefix. When a system is brought into context any of the functions or properties of that system become available from within a system where SetAlternateSystem is being used. Property and function names used are identical to those listed in the System Object.
Global Suite System (GSS) are where this function is handy so as to allow information to pass between the system running in the GSS container.
Syntax: |
---|
test.SetAlternateSystem( systemIndex ) |
Parameter: |
Description: |
---|---|
systemIndex |
System index number. When this function is executed it sets the special built-in object "alternateSystem" with a new system by its System Index.
System index number is assigned by the order in which systems are added to a Suite. Index numbers for system begins at zero, which is reserved for the Suite's GSS system, and the index values assigned end at the number value that represents the number of non-GSS systems in the Suite.
Trading Blox allows a specific number of scripts for use in a GSS module. To see which scripts are available, and to understand the order of when those scripts will execute review the Global Script Timing Table. |
Example - Alternate System Access: |
---|
' Loop over the systems in the test. |
Return - Alternate System Access: |
---|
Out will display the system's suite index, its system-name, and its total-equity amount. |
Example - Alternate system with the alternateBroker: |
---|
IF inst.LoadSymbol( "F:GC", 1 ) THEN |
Return - Alternate system with the alternateBroker: |
---|
Sets the special built-in object "alternateBroker" with a new system by index. The alternateBroker object can then be used to place orders for other systems. |
function to access instruments in other systems in the suite:
Example - Alternate system with the LoadSymbol: |
---|
' ============================================================== |
Result - Alternate system with the LoadSymbol: |
---|
When the above Alternate System Access Example is executed, it will generate a table similar to how this next image displays its PRINT OUTPUT information in a spreadsheet. ![]() Alternate System Access Example |
Links: |
---|
See Also: |
Edit Time: 9/21/2020 3:56:30 PM |
Topic ID#: 531 |