TopGit theo dõi maxbbraun/trump2cash trên GitHub trong nhóm Automation, đã đạt 6.5k sao. A stock trading bot powered by Trump tweets
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This bot watches Donald Trump's tweets
and waits for him to mention any publicly traded companies. When he does, it
uses sentiment analysis to determine whether his opinions are positive or
negative toward those companies. The bot then automatically executes trades on
the relevant stocks according to the expected market reaction. It also tweets
out a summary of its findings in real time at
@Trump2Cash.
You can read more about the background story here.
The code is written in Python and is meant to run on a
Google Compute Engine instance. It uses the
Twitter Streaming APIs to get
notified whenever Trump tweets. The entity detection and sentiment analysis is
done using Google's
Cloud Natural Language API and the
Wikidata Query Service provides the company data.
The TradeKing API does the stock trading.
The main module defines a callback where incoming tweets are
handled and starts streaming Trump's feed:
def twitter_callback(tweet):
companies = analysis.find_companies(tweet)
if companies:
trading.make_trades(companies)
twitter.tweet(companies, tweet)
if __name__ == '__main__':
twitter.start_streaming(twitter_callback)
The core algorithms are implemented in the analysis and
trading modules. The former finds mentions of companies in the
text of the tweet, figures out what their ticker symbol is, and assigns a
sentiment score to them. The latter chooses a trading strategy, which is either
buy now and sell at close or sell short now and buy to cover at close. The
twitter module deals with streaming and tweeting out the
summary.
Follow these steps to run the code yourself:
1. Create VM instance
Check out the quickstart
to create a Cloud Platform project and a Linux VM instance with Compute Engine,
then SSH into it for the steps below. Pick a predefined
machine type matching
your preferred price and performance.
Container
Alternatively, you can use the Dockerfile to build a
Docker container and
run it on Compute Engine
or other platforms.
The authentication keys for the different APIs are read from shell environment
variables. Each service has different steps to obtain them.
Twitter
Log in to your Twitter account and
create a new application. Under the Keys
and Access Tokens tab for your app you'll find
the Consumer Key and Consumer Secret. Export both to environment variables:
If you want the tweets to come from the same account that owns the application,
simply use the Access Token and Access Token Secret on the same page. If
you want to tweet from a different account, follow the
steps to obtain an access token. Then
export both to environment variables:
You also need to enable the Cloud Natural Language API
for your Google Cloud Platform project.
TradeKing
Log in to your TradeKing account and
create a new application.
Behind the Details button for
your application you'll find
the Consumer Key, Consumer Secret, OAuth (Access) Token, and Oauth (Access)
Token Secret. Export them all to environment variables:
There are a few library dependencies, which you can install using
pip:
pip install -r requirements.txt
4. Run the tests
Verify that everything is working as intended by running the tests with
pytest using this
command:
export USE_REAL_MONEY=NO && pytest *.py -vv
5. Run the benchmark
The benchmark report shows how the current implementation of the
analysis and trading algorithms would have performed against historical data.
You can run it again to benchmark any changes you may have made. You'll need a Polygon account:
maxbbraun/trump2cash thuộc nhóm Automation trên TopGit, cùng 4 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về maxbbraun/trump2cash ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/maxbbraun/trump2cash là nguồn chính thức.
maxbbraun/trump2cash có bao nhiêu sao?
maxbbraun/trump2cash có 6.5k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/maxbbraun/trump2cash. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
maxbbraun/trump2cash có phải mã nguồn mở không?
Có — maxbbraun/trump2cash phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/maxbbraun/trump2cash.
maxbbraun/trump2cash có trang demo không?
Dự án có trang chủ ở https://trump2cash.biz. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
maxbbraun/trump2cash là gì?
maxbbraun/trump2cash (maxbbraun/trump2cash) là dự án Python trên GitHub. Theo mô tả gốc: A stock trading bot powered by Trump tweets
maxbbraun/trump2cash so với các dự án Automation khác thế nào?
maxbbraun/trump2cash được TopGit xếp vào nhóm Automation, với 6.5k sao GitHub và viết bằng Python. Xem trang chủ đề Automation trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
trump2cash có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về trump2cash.