Coder Social home page Coder Social logo

markit's Introduction

Task

Prerequisites Get the csv stock daily data for the past year. Here is the url example https://www.google.com/finance/historical?output=csv&q=GOOG

Task Write Scala functions that will return, feel free to adapt function signatures, these are just indicative

/* 1 - 1 year historic prices given a ticker */
`def dailyPrices(ticker: String) : List[Double]` 
 
/* 2- daily returns, where return = ( Price_Today – Price_Yesterday)/Price_Yesterday */
`def returns(ticker:String) : Seq[Double]`
 
/* 3 – 1 year mean returns */
`def meanReturn(ticker:String): Double`

Objectives

  • solve the problem in an elegant and effective FP way
  • make fun along the way, use Scala.js, try something new with it

Work process

Initially I thought of doing simple scala.js ui in top of this solution for demo purposes. But it turns out to be a significant pain in the a frustration to force this thing to work. CORS issue is the one in particular.
Due to time constraints I decided to skip this ui part and roll out CLI solution as it suffice to demonstrate working prototype.

fs2 streams has been used to accommodate for possible large data amounts in a reliable and fp-pure fashion.

As the result we have end-to-end streaming pipeline that is well ready to process data of any size.

Test and Run

  • sbt test runs all the tests
  • sbt "run MSN" executes queries for MSN ticket

markit's People

Contributors

aafa avatar

Watchers

 avatar  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.