Topic Options
#3608 - 11 May 09 03:42 PM Off market data in trade history
Jeff Morcombe Offline
Junior Member

Registered: 03 May 09
Posts: 14
is there anyway of identifiying or not returning off market history when retrieving trade history

Top
#3612 - 12 May 09 05:48 PM Re: Off market data in trade history [Re: Jeff Morcombe]
Paul Klink Offline

Paritech

Registered: 24 Jan 02
Posts: 124
Loc: Melbourne
Hi Jeff,

When you mean "Trade History", I assume you are referring to "Course Of Sales" data. If so ...

Have you looked at the IPxCourseOfSalesRec.TradeAttributes property? This returns a SafeArray of pxTradeAttribute enumerators for each CourseOfSales record. You could use this property to filter out all records which have the pxTradeAttribute_OffMarketTrade attribute.

Note that there is also a IPxCourseOfSalesRec.TradeAttributesAsVar property which returns the array of pxTradeAttribute values as a Variant.

Does this help?

Regards
Paul

Top
#3615 - 21 May 09 12:12 PM Re: Off market data in trade history [Re: Paul Klink]
Jeff Morcombe Offline
Junior Member

Registered: 03 May 09
Posts: 14
Sorry I've been distracted on other tasks but,

I was refering to identifiying off market data when using the PxPriceHistory.

I have looked at PxCourseOfSales.TradeAttributes property
Not sure how to relate these records to the PxPriceHistory record.

I Need to get PriceHistory(DateTime,Open,high,low,close,volume) + TradeAttributes



Edited by Jeff Morcombe (21 May 09 12:15 PM)

Top
#3621 - 25 May 09 02:32 PM Re: Off market data in trade history [Re: Jeff Morcombe]
Paul Klink Offline

Paritech

Registered: 24 Jan 02
Posts: 124
Loc: Melbourne
Price History can be considered as a consolidation (or intervalisation) of Course of Sales data. Course of Sales contains all the trades for a security. Price History consolidates that data into Open, High, Low, Close values for particular time intervals. Generally this consolidation is done in such a way so that it is easy to create charts and see trends in the price data or do technical analysis.

Information like trade attributes is used to determine what trades are included in the consolidation however this field itself is not included in the consolidated data.

Sounds like you want to use a different algorithm for consolidating Course of Sales data into Price History. While this is possible, please not that:

Quote:
The PxAPI monitors the number and type of requests done by any client software. If limits are are approached or exceeded, the relevant client's data connection will be throttled or disconnected.

If you want to do your own price history consolidation, you will need to maintain your own historical database on your computer and only use PxApi to update it with the current days data.

Top
#3642 - 22 Jun 09 10:56 PM Re: Off market data in trade history [Re: Paul Klink]
Jeff Morcombe Offline
Junior Member

Registered: 03 May 09
Posts: 14
I have started to rewrite my application to be more event driven
and capture data using onchanged events, as well as filter out the market data, but are not having much luck

As a simple example I tried to add a couple events to the sample c# application PxFetchS provided by Paritech and update as the data changes. Similar to the example PxCosD.exe

if you can follow the code below, this is the code i have tried.
Unfortunately, no luck, I must be missing something simple - Any suggesttions...


private void cosButton_Click(object sender, RoutedEventArgs e)
{
ClearData();

if (CheckConnected())
{
FCourseOfSalesDataItem = FConnection.SubscribeCourseOfSales(txtSymbol.Text, pxSymbolSourceId.pxSymbolSourceId_Asx, 100, DateTime.Now, GetQueryOnly());
FCourseOfSalesDataItem.OnDataStatusChange += new IPxCourseOfSalesEvents_OnDataStatusChangeEventHandler(FCourseOfSalesDataItem_OnDataStatusChange);
ProcessCourseOfSalesDataStatusChange();

// added these two events
FCourseOfSalesDataItem.OnAfterRecChange +=new IPxCourseOfSalesEvents_OnAfterRecChangeEventHandler(FCourseOfSalesDataItem_OnAfterRecChange);
FCourseOfSalesDataItem.OnListChange += new IPxCourseOfSalesEvents_OnListChangeEventHandler(FCourseOfSalesDataItem_OnListChange);

}
}


void FCourseOfSalesDataItem_OnDataStatusChange(PxCourseOfSales CourseOfSales)
{
ProcessCourseOfSalesDataStatusChange();
}
void FCourseOfSalesDataItem_OnListChange(PxCourseOfSales CourseOfSales, pxListChangeType ChangeType, int n1, int n2)
{
ProcessCourseOfSalesDataStatusChange();
}
private void FCourseOfSalesDataItem_OnAfterRecChange(PxCourseOfSales CourseOfSales, int n1)
{
ProcessCourseOfSalesDataStatusChange();
}


Edited by Jeff Morcombe (22 Jun 09 11:02 PM)

Top


Who's Online
0 registered (), 5 Guests and 2 Spiders online.
Key: Admin, Global Mod, Mod