DataLoader to load symbols not on chart

Questions about MultiCharts .NET and user contributed studies.
uprz23
Posts: 12
Joined: 27 Oct 2012
Has thanked: 2 times

DataLoader to load symbols not on chart

Postby uprz23 » 14 Jan 2023

Hi,

Is it possible to load data from a symbol that's not on the chart?

I get an error like "(SPY-1 Day): Symbol not found" when I have IBM on the chart. But when I change the instrument on the chart to SPY, it works.

Thanks

Code: Select all

protected override void StartCalc() { // assign inputs InstrumentDataRequest Request = Bars.Request; Request.Subscribe2RT = false; DataRequest _DataRequest = new DataRequest(); _DataRequest.RequestType = DataRequestType.FromTo; _DataRequest.From = new DateTime(2020,1,1,0,0,0); _DataRequest.To = new DateTime(2023,1,1,0,0,0); Request.Range = _DataRequest; Request.QuoteField = RequestQuoteField.Trade; Request.Symbol = "IBM"; Request.DataFeed = "TS"; DataLoader.BeginLoadData(Request, OnData, null); }

User avatar
Polly MultiCharts
Posts: 54
Joined: 20 Jul 2022
Been thanked: 14 times

Re: DataLoader to load symbols not on chart

Postby Polly MultiCharts » 18 Jan 2023

Hello uprz23,

If you’re referring to the TS data feed, the request should contain the full name of it.
Also please note that exchanges can be different, so you need to specify that in the request as well.
You can try these code samples:

Code: Select all

Request.Symbol = "IBM"; Request.Exchange = "NYSE"; Request.DataFeed = "TS";
or

Code: Select all

Request.Symbol = "SPY"; Request.Exchange = "ARCX"; Request.DataFeed = "TS";


Return to “MultiCharts .NET”