Creating a Global Suite System (GSS):

Suites can support more than one system.  It can be an added Global Suite System (GSS) to provide more access capabilities to  a suite of systems.    

 

Adding a GSS to a suite provides the ability to access one or all of the systems in the suite.  This added capability can happen in a manner that is harder to do in a Suite that only has a standard system.  

 

GSS Suite's can accesses each system's changes in a review of each system's same script name makes it simple to understand that script's changes.  

 

An example that might be needed in a suite of system where a GSS is active is to limit how many of the systems can take a position in the same market.  If the limit for the suite was to have only one crude oil in the suite, the other systems will know an order to enter crude oil is too many.  

 

In addition, the GSS can remove a pending order in the Before Order Execution script to prevent a second crude oil position.  Another example might be in how capital allocations can be adjusted by the system's demonstrated performance.  

 

Access to a system's performance in the After Trade Day script section provides updated access to each system's performance.  Suites that know how the systems are performing, enables an adjustment to a system's allocation, or a signal to change the risk exposure during the next trade day.

 

How is this possible?  Global Suites have access to many of the same script sections that are in a standard system.  The access by a GSS can be ahead of the system's access in some of the same name script section, or after each same name script section.  Not all of the script section supported by a standard system are available to a GSS, but there are enough of them to provide opportunity to make changes during the testing.

 

To understand which script sections can be support by a GSS, or to understand when some script sections execute ahead of , or after the standard system same name script sections, click this link: Global Script Timing table.

 


Creating a Global Suite System:

The name of a GSS systems must be the same as the Suite where it will be attached.  For example, the default Suite "Walk Forward", will automatically attach a GSS system named "Walk Forward."  All Global Suite Systems are assigned a system.index value of 0, and a system.name "Global Parameters".

 

The first standard system assigned to that suite is assigned a system index of one.  A second system assigned is given the system index of two, the third is given the value of three.  As each additional system is assigned to the same suite it will get the next incremental integer value.

 


GSS Parameter Access:

Any GSS System that has Parameters in a GSS blox, the parameters will be displayed at the bottom of the Suite Parameter Tab.  The parameters in the GSS blox will appear after the Equity Manager parameter section:

Click to Enlarge; Click to Reduce.

GSS Blox Parameters are in the Simulation Suite.  Global Blox are display as the last item in the Simulation Suite's Trading Blox options.

 


Using GSS Script Sections:

Not all the available scripts sections in Trading Blox Builder can be executed in a GSS.  

 

The GSS script sections that support Auto Context for instruments, are limited to:

Can Add Unit

Can Fill Order

Entry Order Filled

Exit Order Filled

 

Instruments can be accessed from the other script section when the LoadSymbol function provides Instrument Context.

 

A major purpose of the scripts in a GSS system is to influence one or more of the suite's systems, or to harvest information from the systems the GSS can analyze and make decisions that it can apply to a system.  Harvested and analyzed information 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 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-order 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 checks for an available order to access.

 

Use system.IsGlobalSuiteSystem property to check if the system is a Global Suite System when it is important to know an order is available.  

 

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.  However, a BPV and a IPV 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 to 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 whether or not the script is 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: 3/10/2022 12:43:59 PM


Topic ID#: 364

 

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