|
Instrument |
Top Previous Next |
|
All instrument data is specific to a particular instrument/system combo. Although prices are the same for an instrument over all systems, the positions and trades are different for an instrument over multiple systems. So the instrument object is specific to a particular instrument and system. This is why the LoadSymbol function takes a symbol and a system as the parameters.
For most common usage, in the Entry and Exit scripts for example, the instrument object is setup for the default instrument being processed, and for the test in which the script is executing.
BPV instrument objects can be defined in scripting, and will have access to the same functions and properties as the default instrument object.
If you want to save a value that is independent of instruments, use a Block Permanent Variable (see Variables and Types).
Instrument properties and functions can be accessed using the '.' syntax:
For example:
variable1 = instrument.date
or if myTempInstrument is defined as a BPV Instrument object:
variable1 = myTempInstrument.date |