public method TradeDeskAut.GetPriceHistory, GetPriceHistoryAsync

Brief

Gets the historical prices (EST).

Declaration
Visual Basic
Function GetPriceHistory (sInstrument as String, sPeriod as String, dtStart as DateTime, dtEnd as DateTime, iMaxNumber as Integer, bBid as Boolean, bAsk as Boolean) As Object
IDL
[id(300)] HRESULT GetPriceHistory( [in]BSTR sInstrument, [in]BSTR sPeriod, [in]DATE dtStart, [in]DATE dtEnd, [in]int iMaxNumber, [in]VARIANT_BOOL bBid, [in]VARIANT_BOOL bAsk, [out, retval] IDispatch* retVal)
Visual Basic
Function GetPriceHistoryAsync (sInstrument as String, sPeriod as String, dtStart as DateTime, dtEnd as DateTime, iMaxNumber as Integer, bBid as Boolean, bAsk as Boolean) As String
IDL
[id(425)] HRESULT GetPriceHistoryAsync( [in]BSTR sInstrument, [in]BSTR sPeriod, [in]DATE dtStart, [in]DATE dtEnd, [in]int iMaxNumber, [in]VARIANT_BOOL bBid, [in]VARIANT_BOOL bAsk, [out, retval] BSTR* retVal)

Parameters
sInstrument

The name of the instrument. The value can be obtained in the Instrument column of the Offers table.

sPeriod

The identifier of the period.

Specify any period supported by the server. To get a list of available periods, use the PriceHistoryHelperAut.GetPeriods method.

dtStart

The start data of the period. Please, note that periods except ticks always start from the good round data/time. Therefore the periods of prices can start from the date after the date specified.

See MarketRateAut.StartDate for explanation.

The date and time are recognized as EST date/time.

dtEnd

The end data of the period.

You can specify the date which corresponds to the zero ole date in order to get the history "up to now". Use 0 in C++, DateTime.FromOADate(0) in .NET and CDate(0) in the VB/VBScript.

The date and time are recognized as EST date/time.

iMaxNumber

The maximum number of periods to receive. In case the number is less than zero the default maximum number of periods on the server is used. If the specified value exceeds the the default maximum number of periods on the server, the server value is used.

NOTE: If the requested history exceeds the maximum number of periods, then the latest data, the data nearest the dtEnd date for the maximum number of periods will be returned. To retrieve the entire desired history, you will need to request the each successive set of periods adjusting the dtEnd toward the dtStart until having requested all the sets of periods contained in the desired history range.

bBid

The flag indicating whether the bid prices must be returned.

bAsk

The flag indicating whether the ask prices must be returned.

Returns

The GetPriceHistory method returns an instance of the MarketRateEnumAut class.

The GetPriceHistoryAsync method is implemented for asynchronous execution. The method returns RequestID. To get a result of method execution, use the events of TradeDeskEventsSink.OnPriceHistoryCompleted or pending events of the kind KIND_PRICEHISTORYCOMPLETED.

Details

Date and time in the result market rates will be also in the EST time zone. In order to get date and time in UTC time zone use GetPriceHistoryUTC

Algorithm of loading of the tick history of arbirary length [show]

The GetPriceHistory and GetPriceHistoryAsync methods are defined in the TradeDeskAut class.

back