Ask/Bid from DataLoader

Questions about MultiCharts .NET and user contributed studies.
lstman
Posts: 18
Joined: 26 Feb 2013
Has thanked: 2 times
Been thanked: 1 time

Ask/Bid from DataLoader

Postby lstman » 22 May 2013

I am creating a strategy using DataLoader.
I want to know "StatusLine" of TICK data obtained from DataLoader.

Can I use "StatusLine" of TICK data obtained from DataLoader?

----------------------------------------------------------------------------------------

Code: Select all

public Bar[] Data
{
get { return m_ticks; }
}

private Bar[] m_ticks;

public void RequestData()
{
m_ticks_retrieved = false;
var _request = m_host.Bars.Request;
_request.Resolution = new Resolution(EResolution.Tick, 1);
_request.From = Begin;
_request.To = End;

IDataLoaderResult iRes = m_host.DataLoader.BeginLoadData(_request, DataCB, null);
}

protected void DataCB(IDataLoaderResult Result)
{
if (Result.IsCompleted)
{
m_ticks = Result.Data;
m_host.DataLoader.EndLoadData(Result);

var _Ask = Data[0].StatusLine.Ask; <-------- Error!!
}
}

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Ask/Bid from DataLoader

Postby Henry MultiСharts » 23 May 2013

Hello lstman,

Bar property has nothing to do with the status line. Status line has its own property. From .Net Wiki:
4.2.1 Instrument Data:
e) Status Line data: status line data when working either on the chart or scanner, for example:
double dailyLow = StatusLine.Low; - get daily low from status line.
Status line provides only the current realtime data. There is no history of status line values.

You need to load the corresponding ask and bid data series with the required time range in order to obtain the values you need.

lstman
Posts: 18
Joined: 26 Feb 2013
Has thanked: 2 times
Been thanked: 1 time

Re: Ask/Bid from DataLoader

Postby lstman » 23 May 2013

Hi Henry.

Shall I use the below?

Code: Select all

_request.QuoteField = RequestQuoteField.Ask;
IDataLoaderResult iResAsk = m_host.DataLoader.BeginLoadData(_request, DataCB, null);

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Ask/Bid from DataLoader

Postby Henry MultiСharts » 23 May 2013

From MC .NET FAQ #7:
Q: Where can I find DataLoader interface example?

A: In MultiCharts .NET you can access a lot of various data directly from the scripts. It can be real-time ask and bid and level 2 data from various symbols that are not even charted. You can also access all information from the Order and Position Tracker. This is an example for using the DataLoader interface. For MultiCharts .Net 8.5 Release you can find an example here.

A sample code that subscribes to realtime data and outputs the realtime bar values in Output tab of PLEditor window can be found here.

Releated article in MultiCharts.NET-Programming Guide:
4.7.4 Receiving the data for any symbol and any resolution. DataLoader.


Return to “MultiCharts .NET”