Code Monkey home page Code Monkey logo

stockmanager's Introduction

Stock Manager

Google Apps Script for managing stocks at Google Sheets

Push Code

To push the code to your Google Apps Script project, run clasp login to authenticate with your Google account, then execute clasp push.

Summary

The Stock Manager application reads data from the transaction sheet, which contains stock transaction details, and performs the following operations:

  1. Reads Transaction Data: Reads through the transaction sheet, extracting the following elements:

    Ticker Side Quantity Total Price
    SLCE3 BUY 200 $3,690.00 $18.45
    SLCE3 BUY 150 $2,767.50 $18.45
    VALE3 SELL 4000 $265,408.50 $66.35
    PETR4 BUY 500 $7,325.00 $14.65
    ITUB4 BUY 300 $4,275.00 $14.25
    B3SA3 SELL 800 $36,640.00 $45.80
  2. Position Sheet: Generates a sheet called generatedPosition containing aggregated stock position data. Each row in the generatedPosition sheet represents a unique stock position and contains the following elements:

    Ticker AvgPrice Qty
    VALE3 66.352125 4000
    SLCE3 18.45 350
    PETR4 25.70 800
    ITUB4 30.20 600
    BBDC4 28.90 700
    B3SA3 45.80 450
  3. Trade Sheet: Generates a sheet called generatedTrade containing trade information. Each row in the generatedTrade sheet represents a trade and contains the following elements:

    Ticker Quantity AvgBuyPrice SellPrice Profit ProfitPercentage Type
    MGLU3 1 R$ 62.02 R$ 60.73 -R$ 1.29 -2.09% DAY
    MGLU3 31 R$ 59.62 R$ 60.73 R$ 34.41 1.86% SWING
    BTOW3 7 R$ 85.00 R$ 89.14 R$ 29.00 4.87% SWING
    HGTX3 50 R$ 15.72 R$ 16.02 R$ 14.90 1.90% SWING
    PSSA3 20 R$ 51.68 R$ 52.45 R$ 15.36 1.49% SWING
    BKBR3 40 R$ 13.60 R$ 14.32 R$ 28.90 5.31% SWING
  4. Monthly Trade Report: Generates a report called monthlyTradeReport containing monthly trade information. Each row in the monthlyTradeReport sheet represents a month and contains the following elements:

    Year Month Total Sold Day Trade Swing Trade
    2023 01 R$ 10,741.36 R$ 60.73 R$ 10,680.63
    2023 02 R$ 7,269.62 R$ 119.69 R$ 7,149.93
    2023 03 R$ 8,899.06 R$ 0.00 R$ 8,899.06
    2023 04 R$ 9,170.60 R$ 0.00 R$ 9,170.60
    2023 05 R$ 11,187.25 R$ 0.00 R$ 11,187.25
    2023 06 R$ 438.20 R$ 0.00 R$ 438.20

Usage

Main Function

The main function of the Stock Manager application is main(), which is responsible for initiating the stock management process. It can be manually triggered or set to run on a schedule.

stockmanager's People

Contributors

gardusig avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

stockmanager's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.