mirror of
https://github.com/codez0mb1e/resistance.git
synced 2024-12-22 08:51:49 +00:00
Currencies Analysis (beta)
This commit is contained in:
parent
dfd136c380
commit
94f079e469
@ -9,43 +9,54 @@ knitr::opts_chunk$set(echo = T, warning = F)
|
||||
|
||||
***Analysis price of the my list of ~~the most promised cryptotokens~~ currencies.***
|
||||
|
||||
## Set envinroment :earth_asia:
|
||||
## Prepare
|
||||
|
||||
Install packages and set environment :earth_asia:
|
||||
|
||||
`install.packages("azuremlsdk")`
|
||||
|
||||
```{r set_envinroment, message=FALSE}
|
||||
library(dplyr)
|
||||
library(tidyr)
|
||||
suppressPackageStartupMessages({
|
||||
library(dplyr)
|
||||
library(tidyr)
|
||||
|
||||
library(lubridate)
|
||||
library(stringr)
|
||||
|
||||
library(gt)
|
||||
library(tidyverse)
|
||||
library(glue)
|
||||
|
||||
library(ggplot2)
|
||||
|
||||
library(azuremlsdk)
|
||||
})
|
||||
```
|
||||
|
||||
library(lubridate)
|
||||
library(stringr)
|
||||
|
||||
library(gt)
|
||||
library(tidyverse)
|
||||
library(glue)
|
||||
|
||||
library(ggplot2)
|
||||
|
||||
library(azuremlsdk)
|
||||
|
||||
## set params
|
||||
```{r set_params}
|
||||
.azureml_dataset_name <- "Currencies"
|
||||
```
|
||||
|
||||
## connect to Azure ML workspace
|
||||
|
||||
Connect to Azure ML workspace:
|
||||
|
||||
```{r azureml_connect}
|
||||
ws <- azuremlsdk::load_workspace_from_config()
|
||||
sprintf(
|
||||
"%s workspace located in %s region",ws$name, ws$location
|
||||
"%s workspace located in %s region", ws$name, ws$location
|
||||
)
|
||||
|
||||
```
|
||||
## Load dataset
|
||||
|
||||
|
||||
## Load dataset
|
||||
|
||||
```{r get_azure_dataset}
|
||||
currencies_ds <- azuremlsdk::get_dataset_by_name(ws, name = .azureml_dataset_name)
|
||||
currencies_ds$name
|
||||
currencies_ds$description
|
||||
```
|
||||
Get USD/RUB top higher rates:
|
||||
|
||||
```{r prepare_dataframe}
|
||||
quotes_df <- currencies_ds$to_pandas_dataframe()
|
||||
@ -71,6 +82,10 @@ quotes_df %>%
|
||||
)
|
||||
```
|
||||
|
||||
## Preprocessing data
|
||||
|
||||
Calculate `Return` and `Log Return` for last 10 years:
|
||||
|
||||
```{r preprocessing}
|
||||
quotes_df %<>%
|
||||
transmute(
|
||||
@ -125,7 +140,7 @@ quotes_stats %>%
|
||||
|
||||
gt() %>%
|
||||
tab_header(
|
||||
title = "Least Volatility Currencies",
|
||||
title = "The Least Volatile Currencies",
|
||||
subtitle = glue("{min(quotes_df$date)} to {max(quotes_df$date)}")
|
||||
) %>%
|
||||
fmt_number(
|
||||
@ -138,7 +153,7 @@ My broker available pairs:
|
||||
symbols <- c(
|
||||
'RUB',
|
||||
'EUR', 'GBP', 'CHF', 'CNY', 'HKD', 'JPY', 'SEK', 'SGD', 'AUD',
|
||||
'KZT', 'BYN', 'TRY', 'MXN'
|
||||
'AED', 'KZT', 'BYN', 'TRY', 'MXN'
|
||||
)
|
||||
|
||||
quotes_stats %>%
|
||||
@ -147,14 +162,13 @@ quotes_stats %>%
|
||||
) %>%
|
||||
mutate(
|
||||
`100x Volatility` = volatility*100
|
||||
#risk = if_else(volatility > volatility_threshold, "High", "Medium or low", NA_character_)
|
||||
) %>%
|
||||
arrange(volatility) %>%
|
||||
select(-volatility) %>%
|
||||
|
||||
gt() %>%
|
||||
tab_header(
|
||||
title = "Least Volatility Currencies",
|
||||
title = "The Most Promised Currencies",
|
||||
subtitle = glue("{min(quotes_df$date)} to {max(quotes_df$date)}")
|
||||
) %>%
|
||||
fmt_number(
|
||||
|
1999
src/fx_currencies_anlysis.md
Normal file
1999
src/fx_currencies_anlysis.md
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user