This function will remove instrument from the portfolio. It removes access to the instrument by changing the state of the symbol's inPortfolio property. When an instrument's symbol is included in the loaded portfolio, the instrument.inPortfolio property has a value of TRUE. When an instrument portfolio, and the instrument.inPortfolio property is FALSE, Trading Blox Builder will not use the symbol.
This Function is an Instrument Data Function. It should be run in the Set Parameters script section defore the data is loaded, and the system's indicators perform the system's indicator calculations. The Set Parameters script section was implemented so the memory needed for each symbol is needed, and the time it takes to load the data. By changing the access state of a symbol to False, the time to load, and calculate indicators isn't used and the memory required isn't needed.
Previously, this function was executed in the BEFORE TEST script so the time saving and the memory used is wasted because . When it is used in that script section the instrument's data will be loaded and the system's indicator calculations will run because the instrument's inPortfolio property is TRUE until the DisableTrading function changes the property to FALSE.
The instrument.inPortfolio property value can be changed by using the instrument.DisableTrading(index). Changing the state of the instrument.inPortfolio property is best done in the Set Parameters script section. The Set Parameters script section executes ahead of the Before Test script section where the instruments in the portfolio are loaded and used in the calculation of indicators.
When an instrument in the portfolio is removed from being accessible by using the Set Parameters script section, the data won't consume any time to load it, and it won't need any memory space to hold any calculated indicators.
can change the instrument's is changed by the instrument.DisableTrading function, it instrument.inPortfolio value will change from a 1 = (TRUE) to a 0 =(FALSE).
These script section, Exit Orders, Entry Orders, Update Indicators, won't execute for an instruments when its instrument.inPortfolio property is FALSE.
This function does not remove a symbol's character text from the portfolio's save list of symbols, those will always be in place until changed using the Portfolio Manager. This function's ability allows the trader to load a large list of instrument symbols and provides a method for removing all the symbols the user decides remove from the symbols from being accessed and traded by the system. When the symbols are removed, the processing of the above script section will not execute. By removing the listed scripts from running during a test, the time save will enable Trading Blox Builder to run faster. For example, when a portfolio of 10,000 stock symbols listed, but the system test only wants to allow 700 of those symbols be used the system test, removing .
Syntax: |
---|
where none of the instruments will have context. In the example line below, the MktSymbol is a BPV Instrument Type variable. When the LoadSymbol loads a symbol, all the normal properties and function in an instrument object are assigned to the MktSymbol BPV Type Instrument. ' Example of how to use this function when it is ' it is not used in the Set Parameters script section.
' When this function is used in a custom script section ' that is called from the Set Parameters script, the ' custom function will provide the instruments in the ' custom script section to with automatic context. ' The calling script function script.InstrumentLoop will ' automatically cause the instruments to loop through ' Assigned portfolio list of symbols. instrument.DisableTrading ' Will not need the index parameter to change its |
Parameter: |
Description: |
---|---|
index |
The symbols location in the portfolio is the row-location of the symbol to remove. See the examples below to how it works.
Index parameter is not needed and not allowed after the symbol has been loaded by the LoadSymbol function. When a symbol is loaded, the DisableTrading function will be applied to the MktSymbol (BPV=Instrument)instrument assigned by the LoadSymbol function. |
Example: |
---|
' ============================================================== |
Links: |
---|
LoadSymbol, instrument.priorityIndex, instrument.inPortfolio, system.totalInstruments |
See Also: |
Edit Time: 9/7/2020 3:54:25 PM |
Topic ID#: 86 |