jyyang42 / RobinOptionCalculator

Find the best option to buy
MIT License
1 stars 2 forks source link

RobinOptionCalculator

Find the best option to buy

Dependency

Run the backend

  1. create a .env file in the workspace and define the environment variables
ROBIN_USERNAME=
ROBIN_PASSWORD=
  1. run the server

For Linux and Mac:

$ export FLASK_APP=flaskr
$ export FLASK_ENV=development
$ flask run

For Windows cmd, use set instead of export:

> set FLASK_APP=flaskr
> set FLASK_ENV=development
> flask run

For Windows PowerShell, use $env: instead of export:

> $env:PYTHONPATH=pwd
> $env:FLASK_APP = "flaskr"
> $env:FLASK_ENV = "development"
> flask run
  1. Test API

Change the expirationDate to a future Friday

curl --location --request POST 'http://127.0.0.1:5000/robin/calc' \
--form 'expirationDate=2020-08-14' \
--form 'optionType=call' \
--form 'company=fb'