Skip to content

This is a basic package used in AI forecasts to find trading signals.

License

Notifications You must be signed in to change notification settings

scalastic/fin.backend

Repository files navigation

fin.backend

This is a basic R package used in AI forecasts, which is intended to define loading functions, technical indicator calculations and rebalancing data. Its specific objective is also to calculate
target values.

This R package is intended to be part of a trading signals application.

Quick Guide

library(fin.backend)
library(future)
library(ggplot2)

plan(multisession)

dt <- data_tools.load_raw_data("CAC_40", "2022-11-11")

dt_plot <- data_tools.flat_raw_data(dt, 7, "2022-11-11", "2022-06-01")

ggplot(dt_plot[date >= "2022-06-01", .(date, close, Target)]) + geom_line(aes(x = as.Date(date), y = close)) + geom_point(aes(x = as.Date(date), y = close, color = factor(round(Target))))

plan(sequential)

Data

Restricted User Guide

Manage MongoDB

Clean-up (if needed)

  • DB is located under ~/fin.db
  • Delete all files in ./fin.db/mongo-db/*
  • Delete log file ./fin.db/log/mongo.log

Start the DB

  • DB is located under ~/fin.db
  • Execute ./fin-db/mongo.sh

Manage R project

  • R project is located under ~/fin.backend

Build with RStudio

  • Onglet Build / More / Clean and Install
    Restarting R session...

    * Project '~/fin.backend' loaded. [renv 0.16.0]
    > library(fin.backend)
    > 
  • Put the downloaded CSV data under ./fin.backend/inst/testdata/ directory
  • Execute the import function init-db.import_data()

Export data to CSV

library(fin.backend)
library(future)
library(progress)

plan(multisession)

export_csv.X_y("CAC_40", "2022-11-11", "2022-11-01", "~/fin.data/")

plan(sequential)

Releases

No releases published

Packages

No packages published

Languages