SetAlternateSystem

Top  Previous  Next

Sets the special built-in object "alternateSystem" with a new system by index. This is the only variable that can be a system object.

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.

 

Syntax

 

test.SetAlternateSystem( systemIndex )

 

Parameters

systemIndex

 

the index of the system

 

Example

' Loop over the systems in the test.

FOR systemindex = 1 TO test.systemCount

 

 ' Set the alternate system by index.

 test.SetAlternateSystem( systemIndex )

 

 ' Print each system name and available equity

 PRINT systemIndex, alternateSystem.name, alternateSystem.totalEquity

 

NEXT

 

 

 

Example of setting the alternate system, and using the alternateBroker object:

 

IF inst.LoadSymbol( "F:GC", 1 ) THEN

 

 test.SetAlternateSystem( 1 )

 

 IF inst.isPrimed AND inst.position = OUT THEN

         alternateBroker.EnterLongOnopen( inst.symbol )

         

         IF alternateSystem.OrderExists() THEN

                 order.SetQuantity( 10 )

         ENDIF

 ENDIF

 

ELSE

 PRINT "Unabled to load symbol"

 

ENDIF