[Quantproject-developers] Metodi HistoricalDataProvider
Brought to you by:
glauco_1
|
From: marco\.milletti\@l <mar...@li...> - 2005-01-10 13:29:52
|
> ! }
> ! /// <summary>
> ! /// Returns the adjusted market value=
for the given ticker, at the given ExtendedDateTime
> ! /// </summary=
>
> ! /// <param name=3D"instrumentKey">instrument identifier</param>=0D
=
> ! /// <param name=3D"extendedDateTime"></param>
> ! /// <returns><=
/returns>
> ! public static double GetAdjustedMarketValue( string inst=
rumentKey , ExtendedDateTime extendedDateTime )
> ! {
> ! double r=
eturnValue;
> ! double adjustedClose =3D getQuote( instrumentKey ,=0D
=
> ! extendedDateTime.DateTime , QuoteField.AdjustedClose );
> ! i=
f ( extendedDateTime.BarComponent =3D=3D BarComponent.Close )
> ! re=
turnValue =3D adjustedClose;
> ! else
> ! // extendedDateTime.Ba=
rComponent is equal to BarComponent.Open
> ! {
> ! double open =3D=
getQuote( instrumentKey ,
> ! extendedDateTime.DateTime , QuoteFie=
ld.Open );
> ! double close =3D getQuote( instrumentKey ,
> ! =
extendedDateTime.DateTime , QuoteField.Close );
> ! returnValue =3D =
open * adjustedClose / close;
> ! }
> ! return returnValue;
> ! =
}
> ! /// <summary>
> ! /// Returns the raw market value for the =
given ticker, at the given ExtendedDateTime
> ! /// </summary>
> ! =
/// <param name=3D"instrumentKey">instrument identifier</param>
> ! //=
/ <param name=3D"extendedDateTime"></param>
> ! /// <returns></returns=
>
> ! public static double GetRawMarketValue( string instrumentKey , E=
xtendedDateTime extendedDateTime )
> ! {
> ! double returnValue;=0D
=
> ! if ( extendedDateTime.BarComponent =3D=3D BarComponent.Close )
> =
! returnValue =3D getQuote( instrumentKey ,
> ! extendedDateTim=
e.DateTime , QuoteField.Close );
> ! else
> ! // extendedDateTim=
e.BarComponent is equal to BarComponent.Open
> ! returnValue =3D get=
Quote( instrumentKey ,
> ! extendedDateTime.DateTime , QuoteField.O=
pen );
> ! return returnValue;
> }
Glauco:
come mai in quest=
i due metodi non utilizzi una switch case invece dell'if, in modo da pote=
r restituire, poniamo, anche l'high e il low (adjusted e close)?
Pu=F2 e=
ssere che in qualche strategia l'high e il low possano tornare buoni ...=0D
=
=0A=0A=0A=0A_________________________________________________________=
___=0ALibero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl s=
enza limiti a meno di 1 euro al giorno. =0AAbbonati subito senza costi di=
attivazione su http://www.libero.it=0A=0A
|