Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jwfearn/capone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Capital One coding challenge

My Submission

Program source code.

Usage

  1. Install git, elixir, and jq. On a Mac with Homebrew, you can install the required software like this:

    brew install git elixir jq
  2. Set the QUANDL_API_KEY environment variable to your Quandl API key:

    export QUANDL_API_KEY='your-key-goes-here'
  3. Clone then compile, test, and run with the run script:

    git clone [email protected]:jwfearn/capone.git
    cd capone
    ./run
  4. You can try different options by running the capone command directly, Use --help for a list of options:

    ./capone --help

Capital One Investing Coding Test Instructions

What We Are Looking For:

We are looking for production quality code with a high level of software craftsmanship. We value readable code that is tested and easy to modify and maintain, over code that runs in the fewest CPU cycles possible.

We would like you to write an application that:

Retrieves pricing data from the Quandl WIKI Stock Price API for a given set of securities and date range Displays the Average Monthly Open and Close prices for each security for each month of data in the data set. The securities to use are: COF, GOOGL, and MSFT. Perform this analysis for Jan - June of 2017 Output the data in the below format, or optionally in a prettier format if you see fit.

{
  "GOOGL": [
    { "month": "2017-01", "average_open": "815.43", "average_close": "$818.34" },
    { "month": "2017-02", "average_open": "825.87", "average_close": "$822.73" },
    { "month": "2017-03", "average_open": "945.24", "average_close": "$951.52" },
    { "month": "2017-04", "average_open": "945.24", "average_close": "$951.52" },
    { "month": "2017-05", "average_open": "945.24", "average_close": "$951.52" },
    { "month": "2017-06", "average_open": "975.37", "average_close": "$977.11" }
  ]
}

The documentation of the API can be found here. You may use this api_key on your requests: REDACTED

You have considerable latitude on how to display this data, obtain it, and what language to use. Please do this in the way that feels most comfortable for you. Many candidates prefer to use a script which is run from the command line. Others choose a webpage that displays things. For others, it’s a live code notebook. What’s important is that it is well crafted and reproducible by us.

We’d also like you to try and add at least one “additional feature” to this program (and if you’re able, all of them). They’re listed below as command line switches for a terminal program, but we’d accept any method that lets a user decide how to display this data.

—max-daily-profit: We’d like to know which day in our data set would provide the highest amount of profit for each security if purchased at the day’s low and sold at the day’s high. Please display the ticker symbol, date, and the amount of profit.

—busy-day: We’d like to know which days generated unusually high activity for our securities. Please display the ticker symbol, date, and volume for each day where the volume was more than 10% higher than the security’s average volume (Note: You’ll need to calculate the average volume, and should display that somewhere too).

—biggest-loser: Which security had the most days where the closing price was lower than the opening price. Please display the ticker symbol and the number of days that security’s closing price was lower than that day’s opening price.

When you have completed the exercise, please upload your entire solution to Github.com and send an email with the URL of your repository to [email protected] and include your name in the email. Please make sure you have an appropriate README documenting how we should compile (if necessary) and run your solution.

About

Capital One coding challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published