Evan Rust
Published © GPL3+

YAHOO! Stock Ticker

If you like current stock information, this is the project for you. By utilizing Yahoo APIs and Arduino, you can create a stock ticker.

BeginnerFull instructions provided1 hour14,314
YAHOO! Stock Ticker

Things used in this project

Hardware components

Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
Arduino Mega 2560
Arduino Mega 2560
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×12
Male/Male Jumper Wires
×5

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
For the LCD case (Optional)

Story

Read more

Custom parts and enclosures

LCD Case

A really nice LCD housing from http://www.thingiverse.com/thing:614241

Schematics

Schematic

Connect as-is.

Code

Python Side for Stock Ticker

Python
You can just copy-paste it into a Python IDE.
from yahoo_finance import Share
import time
import serial
StockShares = ['DOW','YHOO','BAC','F','JPM','TWTR','CHK','PBR','FIT','COG','ABX','FCX','GE','TRGP','CNX','BSX','MRC','NKE','NEM','PBRA','HST','BP','MRK','HON','MET','CLR','WPX' \
,'EXC','JCP','YELP','GNC','TSLA','VRX','P','NFLX','CMG','SM','WYNN','SHAK','ICON']

ser = serial.Serial('COM1',9600)
def printShare(share,name):
    ser.write(name + ': *' + share.get_open()+','+share.get_price())
    print name + ': *' + share.get_open()+','+share.get_price()
    time.sleep(.1)
def mainProgram():
    for i in StockShares:
        name = i
        s = Share(i)
        printShare(s,name)
        s.refresh()
        time.sleep(9.5)
    mainProgram()
mainProgram()

Arduino Side for Stock Ticker

C/C++
Just upload to any Arduino Board.
#include <LiquidCrystal.h>
String str = "";
float o;
float c;
String s;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16, 2);
lcd.setCursor(0,0);
delay(1000);
}

void loop() {
  // put your main code here, to run repeatedly:
if (Serial.available()>0){
  s = Serial.readStringUntil('*');
  o = Serial.parseFloat();
  c = Serial.parseFloat();
 
}
lcd.print(s + "open:" + o);
lcd.setCursor(0,1);
lcd.print("current:");
lcd.print(c);
delay(2000);
for (int positionCounter = 0; positionCounter < 17; positionCounter++) {
lcd.scrollDisplayLeft();
delay(200);
}
delay(500);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("change: ");
lcd.print(c-o);
delay(2000);
for (int positionCounter = 0; positionCounter < 17; positionCounter++) {
lcd.scrollDisplayLeft();
delay(200);
}
lcd.clear();
}

Credits

Evan Rust

Evan Rust

120 projects • 1053 followers
IoT, web, and embedded systems enthusiast. Contact me for product reviews or custom project requests.

Comments