Coder Social home page Coder Social logo

tom-stack3 / stocksreminder Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 544 KB

A project for managing your stock purchases. Sends a weekly recap for all your stocks, with your revenue and a graph showing its history for the past week, compared to the Nasdaq-100.

License: Apache License 2.0

C# 100.00%

stocksreminder's Introduction

stocksReminder

A C# project I made for managing stock purchases, which sends a weekly recap for all stocks interested in. For each stock we generate a graph, that shows the progress of the stock compared to the Nasdaq-100, and calculates the revenue for each stock.

Weekly reminder example:

How it works:

Every execution, the program reads from the users.json.
For every user we go over his stocks, getting the history of the stock prices using a free stocks API I found on the web: finnhub api.
For Israeli stocks, which don't show up on the finnhub API, I use the bizportal site, to get info about the Israeli stocks.

You are welcome to check those out!

If we run the Weekly reminder:
We proccess the stock prices, and create a graph using Google Chart API. Go check it out here!
An example for a graph generated for Amazon stock: here

Finally, the program sends an email to the client with his revenue and a graph for every stock.

If we run the Alert Check:
We proccess the stock prices, and check if the stock prices went up or down by a certain percentage, (set by the user in the App.config - explanation bellow). If it changed by that percentage or more, we send an email to alert the client.

Setup:

App.config

Before running the program, you will need to edit the App.config. It will look like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>
    <appSettings>
	  <!--MailFromAddress: the email address the program sends its email from -->
      <add key="MailFromAddress" value="[email protected]" />
	  <!--MailFromPass: the password to that email address -->
      <add key="MailFromPass" value="from_mail_pass" />
	  <!--bizportalUrlAPI: to work with Israeli stocks, Don't change!! -->
      <add key="bizportalUrlAPI" value="https://www.bizportal.co.il/forex/quote/ajaxrequests/paperdatagraphjson?period=weekly&amp;paperID=" />
	  <!--ChangeToAlertOn: the change in percentage the program will alert on, in checkForAlert() -->
      <add key="ChangeToAlertOn" value="20" />
	  <!--FinnhubAPIkey: the finnhub api key the program works with. get yours on https://finnhub.io/ -->
      <add key="FinnhubAPIkey" value="finnhub key. get yours on https://finnhub.io/" />
    </appSettings>
</configuration>

In the App.config, you have a couple of things to change in the <appSettings>:

  • Change MailFromAddress to a working email, you want the program to send the emails from.
  • Change MailFromPass to the matching password for the email address you chose above.
  • Change FinnhubAPIkey to your API key. You can get yours on https://finnhub.io/.

Optional:

  • Change ChangeToAlertOn to the percentage you want the program to alert on.

users.json

Before running the program, you will also need to edit the users.json.
This is the file which contains the info about each client:

  1. "EmailAdresses":
    The email addresses to send the Weekly reports and the alerts.
    There can be multipule email addresses for each client. (for each bundle of stocks).
  2. "Stocks": (the client's stocks)
    for each stock:
    • "Id": the stock's symbol.
    • "Name": the stock's name, the client wants to be shown on the reports.
    • "Price": the price the client bought the stock originally. (for calculating the revenue)

See an example in users.json.

stocksreminder's People

Contributors

tom-stack3 avatar

Watchers

 avatar

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.