Requirements
...
A simple example of this is something like sc.cht.GetSGData2("BTC1", "ID0.[SG1].[0:5]", TRUE)
In this example, data is set to ID0 (the main price graph) and retrieves the most recent 6 bars from SG1 (which happens to be the Open).
In more detail
study_id - formatted like it appears in SC. ID1, ID2, ID3 etc. ID0 is the main price graph.
...
What's the difference between GetSGData and GetSGData2? - which one should I use?
They both have the same purpose - receiving subgraph data from the chart. Originally we created GetSGData. After working with it a while we saw the need to add GetSGData2.
...
Using GetSGData you can grab data for a single subgraph. It has a very straight forward interface but
...
it's limited to a single subgraph. If for example you had some study X that had 5 subgraphs in it and you wanted to grab all 5, you would need to add GetSGData 5 times to the spreadsheet which is fine but a bit tedious.
On the other hand GertSGData2 has a more complex
...
syntax but
...
it allows you to subscribe to those 5 subgraphs in one call.
...