Giter VIP home page Giter VIP logo

randomsp's Introduction

randomsp

A library to pull and return a random stock from a smattering of stock indices

Based on some research through computer simulations, it was found that perhaps a more random strategy to investing in the stock market was more stable over the long term than using any particular strategy.

Link to forbes article that explains the study

In the same vein of thought, randomsp was born.

Indices

The study from the article used 5 different stock indices to make their predictions: the UK FTSE, the MIB FTSE (Italian stock exchange), the Nikkei 225 (Japanese market), the DAX (German market), and the S&P 500.

This library includes those 5 indices plus the Nasdaq stock exchange.

Notes

  • The Nikkei 225 stocks have symbols, but more often than not are denoted by a number value in their index. Because of this, the name of the company and number are returned instead of the symbol acryonym.

Install

$ go get github.com/ru-lai/randomsp

Usage

import "github.com/ru-lai/randomsp"

func main() {
	stock, err := randomsp.GetRandomIndexStock()
	// ZTS

	stock, err := randomsp.GetRandomNasdaqStock()
	// ATVI

	stock, err := randomsp.GetRandomFinancialTimesStock()
	// G4S

	stock, err := randomsp.GetRandomSPStock()
	// WRK

	stock, err := randomsp.GetRandomItalianFinancialTimesStock()
	// BPE

        stock, err := randomsp.GetRandomNikkeiStock()
        // Tokyu Land 3289

	stock, err := randomsp.GetRandomDaxStock()
	// BMW

        // each function call should have error handling
        if err != nil {
            // handle error here
            log.Fatal(err)
        }
}

API

Each method will return a string of a random stock from either the index you called or a random index and an error if applicable

License

MIT © Tyler Boright

randomsp's People

Stargazers

Jakob Lorz avatar Montana Flynn avatar NNashwin 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.