Script.InstrumentLoop
Similar to Script.Execute, runs a custom script for each enabled instrument in the portfolio. Sets the default instrument object.
Typically used in script with no instrument context, like the Before Trading Day or After Trading Day scripts, to loop over the portfolio instruments.
Example code in a custom script called “instrumentloopscript”
PRINT instrument.date, instrument.symbol
Example code in the Before Trading Day script:
script.InstrumentLoop( "instrumentloopscript" )
Syntax: |
---|
script.InstrumentLoop( "instrumentloopscript" ) |
Parameter: |
Description: |
---|---|
"CustomScriptName" |
Custom script's given name when it was created. |
parameterlist |
Optional: Parameters values custom script will require to execute correctly. |
Returns: |
---|
Custom scripts can return a value, but it isn't required.
Custom scripts that create a new function for processing information usually will return a Floating number or a string. |
Example: |
---|
' Custom script adds two numbers together |
Return: |
4 |
Example: |
---|
' Custom script adds two numbers together |
Return: |
4 |
Links: |
---|
See Also: |
|
Edit Time: 11/7/2020 3:53:08 PM |
Topic ID#: 96 |