Skip to content

Rest Api risk management trading tool based on incremental value at risk

Notifications You must be signed in to change notification settings

gaugau3000/portfolio-inc-var-api

Repository files navigation

Rest Api risk management trading tool based on incremental value at risk

codecov Codacy Badge

Description

Following the inspiration of the darwinex youtube playlist Institutional-Grade Risk Management Techniques for Traders this api will allow you to manage the risk of your trading system based on incremental value at risk based on variance-covariance method (it take into account the volatility and the correlation between assets).

Once you have define a portfolio with a time-frame horizon, you will be able to add new trades opportunity that will be accepted or rejected regarding the increase risk level.

The project is built using Typescript and use nestjs framework.

demo_api_var.mp4

DataProvider

To calculate the value at risk you need to get the last n candles of all the assets that are currently in the portfolio.

Below supported dataProvider.

Data Source Status
Binance Futures
Binance Spot

Running the app with docker compose using postgresql database)

1/ Create a folder for the project

2/ Download the init script that will create the database

wget https://raw.githubusercontent.com/gaugau3000/portfolio-inc-var-api/master/scripts/init-user-db.sh

2/ Download docker-compose file

wget https://raw.githubusercontent.com/gaugau3000/portfolio-inc-var-api/master/docker-compose.yml

3/ Run the docker compose file

docker-compose -up

4/ Open your favorite browser and go to, it will expose api using the swagger documentation

http://localhost:3000/api

5/ Now time to play !

Running the app with node js

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Documentation

Please find swagger doc here

What's next ?

Please go to project page

License

This tool is MIT licensed.

About

Rest Api risk management trading tool based on incremental value at risk

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published