jasondavindev / status-invest-detailed-transactions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Status Invest detailed transactions

Running

Log in the Status Invest portal and get the cookie named .StatusInvest. Pass this cookie to environment variable COOKIE.

Example

export COOKIE=".StatusInvest=YOUR_COOKIE_HERE"

Set the ticker name in the TICKER environment variable.

Example

export TICKER=ITSA4

Then run the application

COOKIE="YOUR_COOKIE_HERE" TICKER="ITSA4" node index.js

The output will be in JSON format. For save the content, forward to output

COOKIE="YOUR_COOKIE_HERE" TICKER="ITSA4" node index.js > /tmp/output.json

With Docker

docker run --rm -ti -e COOKIE="YOUR_COOKIE_HERE" -e TICKER="ITSA4" -w /app -v $PWD:/app node:14 bash -c "npm i; node index.js > /tmp/output.json"

Output example

[
  {
    "code": "ITSA4",
    "quantity": 10,
    "unitValue": 9.0,
    "totalValue": 90.0,
    "referenceDate": "2021-02-18T00:00:00",
    "rank": 20210218,
    "operation": "compra",
    "newPriceAvg": 9.0,
    "newPosition": 10,
    "prevPosition": 0,
    "prevPriceAvg": 0
  },
  ... other transactions
]

The output shows the profit whether the transactions is a sale (venda) in the profix field.

Example

{
  "code": "OIBR3",
  "quantity": 400,
  "unitValue": 1.51,
  "totalValue": 604,
  "referenceDate": "2020-10-29T00:00:00",
  "rank": 20201029,
  "operation": "venda",
  "newPriceAvg": 0,
  "newPosition": 0,
  "prevPosition": 400,
  "prevPriceAvg": 1.44,
  "profit": 28
}

About


Languages

Language:JavaScript 100.0%