Multiple Tools
Last updated
Last updated
The 'External Script' block can accept several tools. In this case, the script class must inherit from the IExternalScriptMultiSec interface. There are two options for connecting blocks.
Option 1:
For each instrument, add the 'Traded instrument' block. Connect each block to the 'External Script' block. In this way, you can connect up to 50 sources to an external script.
Option 2:
Add a block 'Multi-source', select the necessary tools in it. Multi-source connect with 'External Script' blocks.
In the example, 'Tool by number' blocks are added. This block extracts the instrument by the specified number from the multi-source and feeds it to the chart panel. This block can be omitted if the script (c#) itself displays charts.
Script example:
The Execute method receives an array of instruments (ISecurity[]). Let's display a list of tool names in the log.
Result: