A Novice Coder, a Finance Data Application, and the Value of Rapid Prototyping
When I recently sat down to build a minimally viable data application for looking at airline stocks, I wondered how long it might take to get to viable and, frankly, feared how minimal it might be. But, an hour later I had it. Read on for the full story.
Join the DZone community and get the full member experience.Join For Free
but, an hour later i had it. it wasn’t beautiful and it wasn’t viable in the sense of providing valuable insights. it was, however, illustrative. it made it easy to ask, "does this layout make sense?", "is this the data i actually want?" i could show it to a client, or my boss, and ask, "is this the direction we want to go?" i could get feedback, fast. that was valuable.
how did i build something in less than an hour? i leveraged what was already built when i could, leaving me to write as little code as possible, preferably none. that’s my weakness in this whole building thing, if you’ll remember.
i started with a quick white boarding session. i had a general sense of what i needed. dates, stock prices, stock information, visualizations, etc. i searched for components i might need, some i knew existed, some i didn’t. an example of a pleasant surprise came when searching for "date", as i needed some way to input a date range, i found a "datepicker" component. it was exactly what i needed and something that would’ve taken me all day to build.
the resulting mockup, built in the exaptive data-flow designer , looked like this:
this only took a few minutes, but effectively illuminated what i had (the components), what i needed (the comments indicating necessary components), and the initial framework for my dashboard. in this case, it helped me see that the problem was mostly solved and that i was a capable enough programmer to fill the gaps. if there were gaps i couldn’t fill, i could have easily pulled in one of our more experienced programmers by sharing the whiteboard. but, in this case, i could handle it.
to fill the gaps, i needed components for getting financial data. a quick google search revealed the yahoo finance api as an easy and accessible solution. a python library i found turned "easy and accessible" into 3 lines of code for getting the information i needed and less than 50 to get the information and iterate through it, creating a duffle of data for my initial visualization (price for a given date range and ticker symbol.) in case you’re wondering what a duffle is, it’s an exaptive specific data model, built to be powerfully simple. if you’re interested, learn more here . back to yahoo finance, the story was similar for a component returning more granular data (market cap, ebitda, eps, etc. for a given ticker symbol). less than 110 lines of straight-forward code later, i had what i needed.
get historical data:
get granular data:
all that was left was to wire things up and configure the visualizations.
i added a progress bar component, because the api calls were a bit slow with larger date ranges, and a tool tip to the line chart to better see the stock where my mouse was hovering. the rest of the time was configuring components. (oh, and hacking the css to get a layout using a copy and paste job from stack overflow.)
input four airline stock tickers, a date range, and…voila! two line charts, a box chart, and a table. in the upper plot, the orange line is united (ual), the blue is american (aal), the red is delta (dal), and green is southwest (luv).
below, i hover the line for delta airlines. (notice the small tool tip with the ticker symbol where i’ve hovered.) the table displays the data for delta, and an updated line chart underneath shows only delta’s stock over the given time period.
i can also hover over the box chart to get more detail.
since it's a prototype—the first step in a process—i also included a sortable, scrollable table with all of the data, just beneath the dashboard. i might not include that in further iterations, but in early stages, i can use it to troubleshoot the data return.
the goal of this was an mvp dashboard, and i think i achieved that. would i buy american airlines stock based on some insight it provides? not today. do i have a better line of sight to a valuable data application? absolutely. so, what did i learn?
i need a better data source, offering more granular data, including ratios that provide insight into the state of these companies individually, as they relate to one another and the airline industry as a whole. i could build components to massage the data i have into something more useful, but why reinvent the wheel? in fact, the first person i showed this to said, "finance people use the quandl api, the data is much better." (#fastfeedback) the nice part? thanks to an ethos of modularity , i can pull the yahoo finance components, replace them with quandl api components, losing none of my current functionality in the process.
i learned i’m no css wizard (note the less than perfect layout), but we have a guy who is, so why spend too much time worrying about it? my goal wasn’t something beautiful. it was a compass pointing to the next steps for a better application.
finally, i learned that airline stocks haven’t outperformed over the past year, despite a constant slide in fuel prices. in fact, on the whole, you might characterize them as underperforming with a sprinkle of volatility. does it mean fuel price doesn’t impact their profitability, and therefore, their value? it can’t. does that mean these stocks are currently undervalued? it could, and a next version of the dashboard might help decide.
why was i able to do this in less than an hour? because, other people have solved their problems by building components that turned out to be a big part of the solution to my problem. (it’s amazing how frequently this is the case, e.g. here and here .)
but, it’s satisfying to note that no one else will have to build a component for getting stock prices. i did the work (all 45 lines worth) and it’s now available for use by anyone solving a problem using the same set of data. i leveraged the system where i could. i made a contribution where i could. the result was a prototype data application in 45 minutes.
Published at DZone with permission of Luke Tucker, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.