-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
avhz
authored and
avhz
committed
Jun 24, 2024
1 parent
4c97fa7
commit 25f887c
Showing
15 changed files
with
129 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ Cargo.lock | |
|
||
## PYTHON | ||
.venv/ | ||
.env/ | ||
venv/ | ||
env/ | ||
./Bindings/.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[build-system] | ||
requires = ["maturin>=1.6,<2.0"] | ||
build-backend = "maturin" | ||
|
||
[tool.maturin] | ||
features = ["pyo3/extension-module"] | ||
|
||
[project] | ||
name = "RustQuant" | ||
requires-python = ">=3.8" | ||
dynamic = ["version"] | ||
classifiers = [ | ||
"Programming Language :: Rust", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
// RustQuant: A Rust library for quantitative finance tools. | ||
// Copyright (C) 2022-2024 https://github.com/avhz | ||
// Dual licensed under Apache 2.0 and MIT. | ||
// See: | ||
// - LICENSE-APACHE.md | ||
// - LICENSE-MIT.md | ||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
//! This module defines a custom calendar type. | ||
|
||
use std::collections::BTreeMap; | ||
|
||
use crate::time::{CalendarMetadata, DateRollingConvention, DayCountConvention, Holiday}; | ||
use time::Date; | ||
|
||
/// Custom calendar type. | ||
pub struct CustomCalendar { | ||
/// Start date of the calendar. | ||
pub start: Date, | ||
/// End date of the calendar. | ||
pub end: Date, | ||
/// Metadata of the calendar. | ||
pub metadata: CalendarMetadata, | ||
|
||
/// Holidays in the calendar. | ||
pub holidays: BTreeMap<Date, Holiday>, | ||
|
||
/// Day count convention. | ||
pub day_count_convention: DayCountConvention, | ||
/// Date rolling convention. | ||
pub date_rolling_convention: DateRollingConvention, | ||
} | ||
|
||
impl CustomCalendar { | ||
// / Create a new custom calendar. | ||
// pub fn new(start: Date, end: Date, metadata: CalendarMetadata) -> Self { | ||
// Self { | ||
// start, | ||
// end, | ||
// metadata, | ||
// } | ||
// } | ||
|
||
/// Add a vector of holidays to the calendar. | ||
pub fn add_holidays(&mut self, holidays: Vec<Holiday>) { | ||
for holiday in holidays { | ||
self.holidays.insert(holiday.date, holiday); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
// RustQuant: A Rust library for quantitative finance tools. | ||
// Copyright (C) 2022-2024 https://github.com/avhz | ||
// Dual licensed under Apache 2.0 and MIT. | ||
// See: | ||
// - LICENSE-APACHE.md | ||
// - LICENSE-MIT.md | ||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
/// Date generation conventions. | ||
pub enum DateGenerationConvention { | ||
/// Forward from the issue date. | ||
Forward, | ||
|
||
/// Backward from the maturity date. | ||
Backward, | ||
|
||
/// Zero date generation. | ||
Zero, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters