The Extract Function can be used for the System object or Instrument Object.

 

Notes:

When used with an instrument object, it will export to a file the value for each series and indicator for that instrument, for each day in the test.

 

When used with a system object, it will export for all instrument in the system.

 

We recommend only running this once per instrument per test run, as a file is created each time the function is called.

 

By default, the extra file name will be “Daily Extract XXX.csv” where XXX is the symbol, and the extract will contain all available dates that have been loaded.

 

The file is placed at the top level of the Trading Blox Builder installation directory.

 

Caution:

Be careful with the system.Extract because each symbol in the portfolio will create an export file.  

This means to there are 1000’s or too many symbols in a portfolio the export function will create a file for each symbol, which might be more than what you intended.

 

Syntax:

'  Export optional parameters

instrument.extract([ExtractedFileName] [,StartingDate] [,EndingDate ])

 

OR

'  Use default settings
instrument.extract()

 

OR

'  Export all series data between 19990101 and 20060101, and use the default file name:
instrument.Extract(19990101, 20060101)

 

OR

'  Create a file named “My Custom Name XXX.csv” for each instrument,
'  and export all the series data between 19990101 and 20060101:
instrument.Extract( My Custom Name”, 19990101, 20060101 )

 

Parameter:

Description:

[ExtractedFileName]

Optional: Default file-name field is used when field is left empty.

[,StartingDate]

Optional: Beginning data date when start-date field is left empty.

[,EndingDate ]

Optional: Ending data date when end-date field is left empty.

 

Example:

'  Typical usage in the After Test script:
inst.LoadSymbol(“GC”)
inst.Extract()

 

OR

system.Extract()

 

OR

inst.LoadSymbol(“GC”)
If inst.Extract( "Output Series\\Symbol" ) THEN
  PRINT "Extract successful"
ELSE
  PRINT "Extract unsuccessful"
ENDIF

Returns:

The return value is TRUE if successful and FALSE if not. In this example, we output to a custom folder within the Trading Blox install directory. If this folder does not exist, the function will fail.

Click to Enlarge; Click to again Reduce.

Instrument.Extract Output Example from last script section above.

 

Links:

 

See Also:

Instrument Data Functions, System Functions

 


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


Topic ID#: 5

 

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