allenfrostline

What about Crawling Trump's Tweets and Make it to a Trading Algo?


2017-02-09

Since Twitter has open api and Trump has been dramatically influencing the US stock market for quite some months. I will search if there’re already people doing the identical thing and if not try do write a draft notebook on it. (To be continued.)

Update:

Alright… See this Github repository trump2cash. I have to agree the author did a great job and es tot mir leid that this is eactly what I was about to do. I also noticed that he used a less famous online broker “TradeKing” in U.S., which allows Python API trading. This is something I was missing in my plan. All I knew before this trump2cash project are Interactive Broker and Quantopian Zipline framework.

Time Trade Value Return Annualized
Initial - $100,000.00 - -
12/6/2016 8:52 AM BA⬊ $99,904.05 -0.096% -
12/22/2016 5:26 PM BA⬊ $99,904.05 -0.096% -2.166%
1/3/2017 7:30 AM GM⬊ $99,904.05 -0.096% -1.289%
1/3/2017 11:44 AM F⬈ $101,333.52 1.334% 18.849%
1/4/2017 8:19 AM F⬈ $105,950.59 5.951% 112.442%
1/5/2017 1:14 PM TM⬊ $106,534.52 6.535% 116.006%
1/9/2017 9:14 AM FCAU⬈ $106,729.63 6.730% 101.209%
1/9/2017 9:16 AM F⬈ $106,729.63 6.730% 101.209%
1/9/2017 9:16 AM FCAU⬈ $106,729.63 6.730% 101.209%
1/17/2017 12:55 PM GM⬈ $106,508.94 6.509% 72.981%
1/17/2017 12:55 PM WMT⬈ $106,488.57 6.489% 72.694%
1/17/2017 12:55 PM STT⬈ $106,053.96 6.054% 66.664%
1/18/2017 7:34 AM F⬊ $106,053.96 6.054% 66.664%
1/18/2017 7:34 AM GM⬊ $106,053.96 6.054% 66.664%
1/18/2017 7:34 AM LMT⬊ $106,053.96 6.054% 66.664%
1/18/2017 8:00 AM BLK⬈ $106,945.01 6.945% 79.233%
1/24/2017 12:49 PM TRP⬊ $107,069.96 7.070% 66.339%
1/24/2017 7:46 PM F⬈ $107,069.96 7.070% 66.339%
1/24/2017 7:46 PM GM⬈ $107,069.96 7.070% 66.339%
1/30/2017 7:16 AM DAL⬊ $107,069.96 7.070% 58.683%