-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #258 from avhz/market-data
Market data
- Loading branch information
Showing
110 changed files
with
3,146 additions
and
1,919 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
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 |
---|---|---|
@@ -1,8 +1,27 @@ | ||
# Introduction to RustQuant | ||
![](./assets/logo.png) | ||
|
||
RustQuant is a Rust library (crate) for quantitative finance. | ||
|
||
You can download the library from [Crates.io](https://crates.io/crates/RustQuant), and API documentation can be found at [Docs.rs](https://docs.rs/crate/RustQuant/latest). | ||
# Code | ||
|
||
> Note: this book is a very early work-in-progress and has almost no content. | ||
The crate is available for download from [Crates.io](https://crates.io/crates/RustQuant), and the source is available on [GitHub](https://github.com/avhz/RustQuant). | ||
|
||
# Installation | ||
|
||
RustQuant of course requires [Rust](https://www.rust-lang.org/) to be installed first. | ||
|
||
You can easily add RustQuant to your Rust project by running: | ||
|
||
```bash | ||
cargo add RustQuant | ||
``` | ||
|
||
# Documentation | ||
|
||
API documentation can be found at [Docs.rs](https://docs.rs/crate/RustQuant/latest). | ||
|
||
The documentation contained in this book is more *"cookbook"* style. | ||
|
||
Contributions to documentation in any form are highly welcome. | ||
|
||
> Note: this book is a very early work-in-progress and has almost no content. |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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,39 @@ | ||
# Curves | ||
|
||
Curves can be fit to market data. Here we include an example of a spot curve being fitted. | ||
|
||
![`Spot curve`](../../assets/spotcurve.png) | ||
|
||
```rust | ||
{{#include ../../../../examples/curves_spot.rs}} | ||
``` | ||
|
||
|
||
<table> | ||
<tr> | ||
<th> Good </th> | ||
<th> Bad </th> | ||
</tr> | ||
<tr> | ||
<td> | ||
|
||
```rust | ||
int foo() { | ||
int result = 4; | ||
return result; | ||
} | ||
``` | ||
|
||
</td> | ||
<td> | ||
|
||
```rust | ||
int foo() { | ||
int x = 4; | ||
return x; | ||
} | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> |
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,8 @@ | ||
# `data` | ||
|
||
The `data` module encompasses everything data related. | ||
|
||
That is, anything that can be observed, either in markets or derived from market observable data, and also facilities to manage that data. | ||
|
||
Another form of data is contextual (or reference) data. These are things such as calendars and date conventions. While there are facilities to handle these data inside the `data` module, the underlying implementations are in other modules, such as the `time` module. | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
# `error` | ||
# error |
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1 +1 @@ | ||
# `macros` | ||
# macros |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
use plotly::{Plot, Scatter}; | ||
use time::macros::date; | ||
use time::{Date, Duration}; | ||
use RustQuant::data::Curve; | ||
|
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
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,14 @@ | ||
use RustQuant::pricer::MarketData; | ||
use RustQuant::pricer::MarketDataBuilder; | ||
use RustQuant::time::oceania::australia::AustraliaCalendar; | ||
|
||
fn main() { | ||
let market_data: MarketData<AustraliaCalendar> = MarketDataBuilder::default() | ||
.underlying_price(Some(100.0)) | ||
.volatility(Some(0.2)) | ||
.dividend_yield(Some(0.0)) | ||
.build() | ||
.unwrap(); | ||
|
||
println!("{:?}", market_data); | ||
} |
Oops, something went wrong.