Creating a Global Suite System (GSS):

A Global Suite System (GSS) is a special type of system.  It is created when a user creates a system name that is the same name as the suite name.  When this happens, the GSS system will automatically be attached to the suite, and any parameters in a blox attached to a GSS will be available to influence or monitor the testing of one or more of the suite's trading systems.  

 

When Trading Blox Builder finds a system with the same name, its display changes so that it looks different in the system list than a normal system.

 

GSS Parameter Access:

Any GSS System Parameters created in a blox attached to a GSS system  will be displayed below the Equity Manager parameters in the Suite Parameter tab area.

GSS Test Suite Selection Example

Not all the possible scripts sections in a normal system can be executed in a GSS.  Most of the script sections that are designed to execute are not scripts that normally support instrument and order context support.

 

A major purpose of the scripts in a GSS system are to influence one or more of the suite's systems, or to harvest information so that the GSS can analyze and send information to one or more of the suite's systems.  Information harvested, and shared can be used to monitor and adjust how the suite is performing.

 

The scripts sections in a blox that are selected to be used with as a GSS will be processed using different rules than those for normal systems.

For example,  some of the scripts sections in each blox in a GSS will execute ahead of the same name script sections, and some will execute after some of the same name script section.  To better understand how the GSS script sections are timed, review the information in this topic: Global Script Timing.

 

For the above "Order" scripts, the default system, default instrument and default order context is taken from the system that originated the order. This is different from the non orders scripts, for which the default system is the GSS, and the default instrument is null. The order object is null by default, but can be valid after a call to the alternateBroker function. Use the alternateSystem.OrderExists.  The '.orderExists' property will check if there is an order available for access.

 

All Global Suite Systems will be assigned a system index value of 0, and a system name "Global Parameters".

 

Use system.IsGlobalSuiteSystem property to check if the system is a Global Suite System, if this is important. Note that for order scripts, the system will be from the system originating the order, so this property will return false. In the non order scripts, the system is the actual GSS, so this property will return true. The GSS does not trade, so there is no instrument list, no positions, and no equity curve. But BPV's and IPV's can be created, and accessed using the SetAlternateSystem and SetAlternateInstrument functions. In this way the GSS can be used as a global storage location for overall control and computation of test level variables.

 

For cases where the physical location of the script, such as system, is important, use the Block object properties. An example might be when a block is used in both a GSS and regular system, and uses an order script to process orders. The order script will be called twice, once in originating system and once in the GSS. Checking if the block.systemIndex will indicate if the script is really in a GSS.

 

The Net Risk block in the Blox Marketplace is a good example of how to loop over all instruments, in all systems, and compute a suite level value for each market.

 

Example:

PRINT
PRINT test.currentDate
 
totalRisk = 0
 
'  Loop over all the instruments that are used in this test.

'  Includes all systems and all support forex conversion markets.
'  For Each instrument in the test,...
For testInstrumentIndex = 1 TO test.instrumentCount STEP 1
  '  Get the symbol name.
  PRINT "Getting instrument number", testInstrumentIndex
 
  '  Obtain the list of symbols in the test.
  suiteInstrumentSymbol = test.instrumentList[ testInstrumentIndex ]
  PRINT "Processing", suiteInstrumentSymbol
 
  '  Get the suite level instrument.
  If suiteInstrument.LoadSymbol( suiteInstrumentSymbol, 0 ) THEN
    '  Reset our net position to zero for this instrument.
     suiteInstrument.netRisk = 0
     
    '  Loop over all the systems in the test.
    For systemIndex = 1 TO test.systemCount STEP 1
        '  Set the alternate system so that we can use the name
        '  or other system properties.
        test.SetAlternateSystem( systemIndex )
       
        PRINT "Setting to system index", systemIndex
        PRINT "Processing for system", alternateSystem.name
       
        '  Load the instrument symbol combo.
        If systemInstrument.LoadSymbol( suiteInstrumentSymbol, systemIndex ) THEN
          PRINT "Loaded", systemInstrument.symbol
       
          '  If this instrument is in the portfolio for the
          '  system, then check the position.
          If systemInstrument.inPortfolio THEN
              PRINT "In portfolio for system", alternateSystem.name, _
                    "with risk of", systemInstrument.currentPositionRisk
             
              '  To get the net risk, we use positive for long risk '
              '  and negative For SHORT risk.
              If systemInstrument.position = LONG THEN
                '  Get instrument's current net risk
                 suiteInstrument.netRisk = suiteInstrument.netRisk _
                                            + systemInstrument.currentPositionRisk
                PRINT "Long net risk: ", suiteInstrument.netRisk
              ENDIF
             
              If systemInstrument.position = SHORT THEN
                '  Get instrument's current net risk
                 suiteInstrument.netRisk = suiteInstrument.netRisk _
                                            - systemInstrument.currentPositionRisk
                PRINT "Short net risk: ", suiteInstrument.netRisk
              ENDIF
          ELSE
              PRINT "Not in portfolio for system", alternateSystem.name
          ENDIF
        ELSE
          PRINT "Unable to load", suiteInstrumentSymbol
        ENDIF
    Next '  systemIndex
     
    '  Whether positive or negative, it's still risk.
     suiteInstrument.netRisk = Abs( suiteInstrument.netRisk )
 
    '  Update Total Risk
     totalRisk = totalRisk + suiteInstrument.netRisk      
 
    '  Print out the net risk & Total Risk for this instrument.
    PRINT "Net Risk   ", suiteInstrument.netRisk
    PRINT "Total Risk ", totalRisk
  ELSE
    PRINT "Unable to load", suiteInstrumentSymbol
  ENDIF
Next '  testInstrumentIndex
 
totalRisk = totalRisk / test.totalEquity * 100
PRINT "Total Risk All: ", totalRisk

Returns:

 

 

Links:

 

See Also:

 

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 364

 

 

Syntax:

 

 

Parameter:

Description:

 


 

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