What would it sound like if trading market data speaks?
A little background
This little project tries to do one thing for fun: to transform the trading market history data into some sords of sound.
The techniques involve some basic use of web audio API and D3.js. All the ticker names are collected from dumb stock api, while all the trading history data comes from ALPHA VANTAGE. Since support for web audio API is different by different browsers, it is highly suggested to try this demo with Chrome.
Feel free to choose any company interesting to you by typing/selecting corresponding stock exchange name as well as company security ticker (e.g.: NASDAQ for exchange and FB as ticker to listen to how Facebook sounds like.)
Currently the mapping from market data to sound is naive:
- Each beat stands for one day of the security price in the past, ordered by the security’s trading history.
- Sound frequency: the higher the daily close price, the higher the frequency.
- Waveform: if the daily open price is lower than close price, a beat of triangle wave sound is generated, otherwise the sine wave.
- Duration between each two beats are determined by the earlier day’s market volume: larger market volume comes with shorter duration.
Apart from the chart for market data, each beat is also visualized to show their waveform and frequency domain distribution.
Of course, listening to only one security ticker at a time isn’t that much fun. Some good way to extend this project might be to map multiple securities into different sounds, and play them simultaneously, in the hope of creating some sort of “symphony”.