mirror of
https://github.com/Magnus167/msyrs.git
synced 2025-08-20 09:40:00 +00:00
feat: add documentation for JPMaQSDownloadGetIndicatorArgs struct and its default implementation
This commit is contained in:
parent
e8b5cc4354
commit
ab30aa2380
@ -38,6 +38,24 @@ fn all_jpmaq_expressions(expressions: Vec<String>) -> bool {
|
|||||||
.all(|expression| is_jpmaq_expression(expression))
|
.all(|expression| is_jpmaq_expression(expression))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Struct for the arguments passed to JPMaQSDownload for downloading indicators.
|
||||||
|
///
|
||||||
|
/// Example Usage:
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// use msyrs::download::jpmaqsdownload::JPMaQSDownloadGetIndicatorArgs;
|
||||||
|
/// use msyrs::download::jpmaqsdownload::JPMaQSDownload;
|
||||||
|
///
|
||||||
|
/// let download_args = JPMaQSDownloadGetIndicatorArgs {
|
||||||
|
/// tickers: vec!["USD_EQXR_NSA".to_string(), "GBP_EQXR_NSA".to_string()],
|
||||||
|
/// metrics: vec!["value".to_string(), "grading".to_string()],
|
||||||
|
/// start_date: "2024-11-11".to_string(),
|
||||||
|
/// end_date: "2024-11-11".to_string(),
|
||||||
|
/// };
|
||||||
|
///
|
||||||
|
/// let mut jpamqs_download = JPMaQSDownload::default();
|
||||||
|
/// let res_df = jpamqs_download.get_indicators_qdf(download_args).unwrap();
|
||||||
|
/// ```
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct JPMaQSDownloadGetIndicatorArgs {
|
pub struct JPMaQSDownloadGetIndicatorArgs {
|
||||||
pub tickers: Vec<String>,
|
pub tickers: Vec<String>,
|
||||||
@ -46,6 +64,11 @@ pub struct JPMaQSDownloadGetIndicatorArgs {
|
|||||||
pub end_date: String,
|
pub end_date: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Default implementation for JPMaQSDownloadGetIndicatorArgs.
|
||||||
|
/// Gets the indicators for the tickers from the start of the data till 'today + 2 days'.
|
||||||
|
/// Typically, a user only needs to update `tickers` and `start_date` fields.
|
||||||
|
///
|
||||||
|
/// The default metrics are: ["value", "grading", "eop_lag", "mop_lag"]
|
||||||
impl Default for JPMaQSDownloadGetIndicatorArgs {
|
impl Default for JPMaQSDownloadGetIndicatorArgs {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
JPMaQSDownloadGetIndicatorArgs {
|
JPMaQSDownloadGetIndicatorArgs {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user