Channel created
Hello everyone and welcome to my community on Telegram. My name is Katya and this is a special place where we'll journey together into the fascinating realm of Generative AI and Machine Learning applications in investment.

With my experience in the finance industry, I've seen firsthand how transformative these technologies can be. I'm thrilled to share my insights, discoveries, and learning here with you.
From predicting market trends to optimizing portfolio performance, our discussions here will revolve around understanding these advanced technologies and their implications in the finance world.

Join me as we dive into articles, studies, updates, and even some of my personal experiences and observations. Whether you're a seasoned investor, a tech enthusiast, or just curious about the future of investing, there's something for you here.

So, let's explore, learn, and grow our investments together with the power of Generative AI and Machine Learning!
HOW TO CREATE A CRYPTOCURRENCY TRADING BOT WITH CHATGPT

In this article, we are going to create a cryptocurrency trading bot using ChatGPT, an advanced AI developed by OpenAI. The bot will utilize Alpaca API for paper trading, CoinGecko API for getting cryptocurrency prices, and SNScrape for social media data analysis. To interact with our bot, we'll use the OpenAI API. Also, we'll use Pinecone for efficient similarity search.

Let's get started.

Requirements

To follow along with this guide, you'll need:

- A development environment capable of running Python (like Jupyter Notebook or Google Colab)
- An account with Alpaca, CoinGecko, and OpenAI
- An understanding of Python, APIs, and cryptocurrency trading basics

Installation

First, we need to install the necessary Python packages. You can do this by running the following commands:


!pip install alpaca-trade-api
!pip install pycoingecko
!pip install requests
!pip install openai
!pip3 install git+https://github.com/JustAnotherArchivist/snscrape.git
!pip install pinecone-client


Setting Up Alpaca API

Alpaca is a stock and cryptocurrency trading API that allows developers to manage accounts, orders, and positions, get real-time price and historical data, and more.


import alpaca_trade_api as tradeapi

API_KEY = 'Your API Key'
API_SECRET = 'Your Secret Key'
BASE_URL = 'https://paper-api.alpaca.markets'

api = tradeapi.REST(API_KEY, API_SECRET, base_url=BASE_URL)
account = api.get_account()


Setting Up CoinGecko API

CoinGecko is a cryptocurrency price and information data platform. We will use it to get the real-time prices of cryptocurrencies.


from pycoingecko import CoinGeckoAPI

cg = CoinGeckoAPI()
bitcoin_price = cg.get_price(ids='bitcoin', vs_currencies='usd')
print(bitcoin_price)


Setting Up ChatGPT

Next, we will integrate ChatGPT using OpenAI's API. Here we will make a simple function to chat with the model. We'll use this to help make decisions.


import openai

openai.api_key = 'Your OpenAI Key'

def chat_with_gpt3(prompt):
response = openai.Completion.create(
engine="text-davinci-003",
prompt=prompt,
temperature=0.5,
max_tokens=100
)
return response.choices[0].text.strip()


Integrating SNScrape for Social Media Analysis

We will use SNScrape to track the mentions of certain cryptocurrencies on Twitter, a kind of sentiment analysis.

import snscrape.modules.twitter as sntwitter

def get_tweets(keyword, limit):
tweets_list = []

# Using TwitterSearchScraper to scrape data and append tweets to list
for i,tweet in enumerate(sntwitter.TwitterSearchScraper(keyword + ' since:2020-06-01 until:2020-06-30').get_items()):
if i>limit:
break
tweets_list.append(tweet.content)

return tweets_list


Making Trading Decisions

We can now start to create the function that will be making our trading decisions. It will get the current price of a cryptocurrency, retrieve the latest tweets about it, and then ask GPT-3 what action it should take.


def make_decision(crypto_name):
# Get the current price of the cryptocurrency from CoinGecko
crypto_price = cg.get_price(ids=crypto_name, vs_currencies='usd')[crypto_name]['usd']

# Get the latest tweets about the cryptocurrency
tweets = get_tweets(crypto_name, 10)

# Ask GPT-3 to make a decision
prompt = f"The current price of {crypto_name} is {crypto_price}. Here are the latest tweets about it:\n{tweets}\nShould I buy, sell, or hold {crypto_name}?"
decision = chat_with_gpt3(prompt)

return decision


Execute Trades

We can create a function to execute trades based on GPT-3 decisions.
def execute_trade(crypto_name, decision):
if decision.lower() == 'buy':
api.submit_order(
symbol=crypto_name,
qty=1,
side='buy',
type='market',
time_in_force='gtc'
)
elif decision.lower() == 'sell':
api.submit_order(
symbol=crypto_name,
qty=1,
side='sell',
type='market',
time_in_force='gtc'
)


This basic setup gives us a starting point for a more sophisticated trading bot. From here, you could add more AI capabilities, such as using Pinecone to find similar cryptocurrencies to trade, or improving the sentiment analysis of the social media scraping.

Remember, always backtest your strategies before deploying any trading bot, and be aware of the risks involved in trading.
Channel photo updated
Enhancing Crypto Insights: Dive Into the Streamlit-based Advisor and Its Code

In the rapidly evolving realm of cryptocurrency, staying updated with accurate insights is pivotal. Presenting the Crypto Trading Bot Advisor - a tool that fuses the prowess of AI with data analytics to offer incisive cryptocurrency insights. Before we delve deep, you can https://tradingbotadvisor.streamlit.app

A Glimpse into the Advisor:

The application, sculpted using the remarkable Streamlit framework, aggregates crypto market metrics, collates recent news, and taps into OpenAI's GPT model to suggest insightful trading actions.

Key Components:

1. Streamlit's User-Centric Interface: A stellar platform, Streamlit effortlessly morphs Python scripts into user-friendly web applications. Here, it crafts a layout soliciting user inputs such as the OpenAI API Key, desired cryptocurrencies, and the analysis period.

2. CoinGecko API: Unearthing Crypto Data: Post user input, the application liaises with the CoinGecko API, retrieving historical crypto metrics. Users can view high, low, and average prices for their selected cryptos across their specified duration.

3. Visualizing Insights with Plotly: A visual chart, curated using Plotly, provides a graphical representation of the crypto trends. This can be a lighthouse for traders navigating the tumultuous seas of crypto trading.

4. GoogleNews: Keeping a Finger on the Pulse: The tool employs the GoogleNews API to fetch the latest news about the chosen cryptos. Such news snippets, often loaded with market-moving updates, play a pivotal role in shaping trading strategies.

5. OpenAI's GPT: The AI Touch: The centerpiece is the integration with OpenAI's GPT model. Infused with data and headlines, the model channels its analytical prowess to proffer trading recommendations. This adds another layer of depth to users' decision-making processes.

Setting the Sail:

1. API Key Input: To tap into GPT's insights, users need to furnish the OpenAI API Key. Fret not, the input remains masked to ensure utmost privacy.

2. Crypto Selection: Users can enlist the cryptos they wish to analyze, separated by commas.

3. Timeframe for Analysis: A handy slider lets users dictate the duration of analysis, extending up to a full year.

4. Unravel Insights & Recommendations: On setting the parameters, the application serves historical metrics, visual charts, recent news, and the coveted AI-backed trading suggestions.

Behind the Curtain:

- Flexibility in API Key Setup: The code, though peppered with comments, highlights diverse methods to establish the OpenAI API Key, offering flexibility based on individual preferences and setups.

- Robust Error Management: The tool anticipates potential data retrieval issues, ensuring that hiccups with a particular crypto don't derail the entire process.

- Pandas: The Data Maestro: The tool's seamless data management owes its credits to Pandas. Whether it's handling the latest news or presenting user-friendly outputs, Pandas ensures the user experience remains top-notch.

In Conclusion:

The Crypto Trading Bot Advisor epitomizes the convergence of data analytics, AI, and web programming. By utilizing a myriad of APIs coupled with OpenAI's GPT model, it promises valuable crypto insights. Whether you're a trading veteran or a crypto enthusiast, this tool might just be the oracle you were seeking. Don't forget to [try the app for yourself]https://tradingbotadvisor.streamlit.app
## Using Streamlit for Thematic Stock Investment Search

### Finding Stocks that Match Unique Investment Criteria

In today's rapidly evolving financial landscape, investors are always on the hunt for opportunities that align with unique, niche, or emerging themes. What if you're an eco-conscious investor, and you're interested in the rise of insect-based proteins as a sustainable food source? How would you find stocks related to this very specific theme?

Enter the thematic stock investment search tool: [Thematic Stocks Search Tool](https://thematic-stocks.streamlit.app)

### Using the Thematic Stocks Search Tool:

#### Inputs:

The tool provides a user-friendly interface where you can input specific criteria:

1. OpenAI API Key: This is essential for accessing the powerful OpenAI GPT model that helps in generating embeddings for similarity searches. The key is kept confidential by using a password input field.

2. Theme: Here, you can input your unique investment theme or topic. For our example, you'd enter "insect-based proteins".

3. Number of companies: This slider allows you to decide how many companies you want to view in the results. If you're looking for a broader overview, slide it to a higher number. For a more concise result, keep it lower.

#### Results:

Once you input your criteria, the tool works its magic:

1. Summary: This column provides a brief overview of the company, giving you an idea of its primary operations and relevance to your theme.

2. Score: This column indicates the relevance score, with a higher score suggesting a closer match to your theme.

3. Name: The official name of the company.

4. Industry: This will help you understand the broader sector the company operates in, allowing you to gauge if the industry aligns with your investment strategy.

### Practical Application for Investors:

This tool essentially bridges the gap between thematic investing and the vast sea of stocks available in the market. Traditional stock screening tools might not capture such niche criteria. But with the integration of OpenAI's advanced language model, our tool can dig deeper and find stocks that closely resonate with the theme.

For instance, if you discover a company that's heavily involved in insect farming and has a promising growth trajectory, it could be an excellent addition to a sustainability-focused portfolio.

### Wrapping Up:

In the digital age, leveraging cutting-edge tools like the thematic stock search can provide investors with a significant edge. By efficiently pinpointing investment opportunities that align with unique or emerging themes, investors can stay ahead of the curve and craft portfolios that resonate with their values and insights.

Whether you're a seasoned investor or just starting out, tools like this can be invaluable in your investment research process. So the next time you hear about a new emerging trend or theme, head over to the [Thematic Stocks Search Tool](https://thematic-stocks.streamlit.app) and discover stocks that align with your vision!
Hello! You won't believe the adventure I went on this Saturday. It all started when I realized that my lovely pet's hair was taking over my house and our current vacuum cleaner didn't help! I needed a vacuum cleaner that could handle all that fur and keep my home spick and span.

I'm no expert in vacuum cleaners, but I thought, why not use my coding skills to find the perfect one? So, armed with my trusty LLM, I embarked on a quest to discover the best vacuum cleaner for pet hair.

I began by writing code that could search the internet for articles about "vacuum cleaners good for hair." You know, the ones that do a fantastic job of removing all that pesky pet fur. My little program was like a detective, scanning Google for the most relevant articles and reviews.

Once it scrapped a bunch of articles on google, I needed to organize all that information. You know how websites can get chatty, right? So, to make sense of it all, I employed some fancy natural language processing tricks. I split the articles into smaller pieces, kind of like breaking a long story into chapters, to make it easier for my Python code to digest.

But wait, that's not all! To make sense of all the text, I converted it into numbers using something called "embeddings." It's like giving each piece of text a unique identity, so my code can compare them and see which ones are similar.

With all this data organized, I was ready to create my own little knowledge database with Choma. It was like my treasure trove of information on vacuum cleaners! Now, when I had a question about which vacuum cleaner was the best for pet hair, I could quickly find the answers from all those articles I had collected earlier.

Now came the thrilling part. I had to ask the right question to get the perfect answer. So, I crafted a question like a wizard weaving a spell. I asked for the model of a vacuum cleaner that wouldn't burn a hole in my pocket but would be a pro at tackling my furry friend's hair.

And guess what? My LLM didn't disappoint! It went through all the articles in Chroma, sifted through the knowledge, and retrieved the best answers. It was like magic!

In the end, armed with the knowledge from my LLM-powered journey, I made an informed decision and found the best vacuum cleaner to keep my home hair-free and tidy. My pet was happy, I was happy, and my Python code was patting itself on the back.

So, that's how my adventure to find the ultimate vacuum cleaner unfolded. Who knew that LLM could be the key to a clean and hair-free home? The world of technology is full of surprises, my friend!

Check my code here:
https://colab.research.google.com/drive/19kyWF-6riM53z336f2URdm0GH5ihW9AC?usp=sharing
How Generative AI is Revolutionizing the Café and Restaurant Scene

Hello dear readers!

Today, we're diving deep into the futuristic realm of generative AI and its potential impact on our favorite spots: cafés and restaurants. From creating tantalizing new dishes to forecasting customer favorites, the future is now. Let’s see how!

1. Crafting the Perfect Menu with AI
- AI as a Chef's Assistant: Imagine a world where AI suggests new recipes based on the ingredients a restaurant has! That means potentially unique dishes popping up on your favorite menu.
- Vivid Visuals: And for those of us who love to 'eat with our eyes', AI doesn’t disappoint. It can whip up images of those delicious dishes for a drool-worthy menu.

2. Chatbots: The New Maître D'
- Forget the days of waiting to get your queries answered. Modern chatbots, powered by generative AI, can handle orders and answer your burning questions about the menu, ingredients, or allergens in real-time.

3. Step Up Your Marketing Game
- Personalized and targeted. That’s how AI crafts marketing campaigns or snazzy social media posts tailored to foodies out there.

4. Designing the Ideal Ambience
- An AI that’s also an interior designer? By analyzing trending designs, it suggests the perfect vibe for your café.

5. Setting the Mood with Music
- AI can curate music playlists that match the café's mood, ensuring every moment is melodious.

6. Valuable Insights from Feedback
- Generative AI sifts through reviews to provide actionable insights for businesses, ensuring that every dining experience gets better and better.

7. Predicting Tomorrow’s Specials
- With data-driven demand forecasting, AI helps restaurants prepare for the crowd's favorite dishes, ensuring no one leaves disappointed.

8. Events That Resonate
- From thematic nights to festive promotions, AI provides innovative ideas that guarantee memorable nights out.

9. Customized Just for You
- Experience personalization like never before! AI recommends dishes based on your preferences, making every meal special.

10. Training the Stars of Tomorrow
- With AI-generated scenarios, staff can practice handling diverse situations, ensuring top-notch service every time.

11. A Greener Footprint
- Restaurants are getting eco-friendly with AI. By predicting sales and inventory patterns, waste gets significantly reduced.

12. Sustainability is the New Trend
- From sourcing eco-friendly ingredients to optimizing energy consumption, AI paves the way for a sustainable dining experience.

13. Dining in the Digital Age
- Think AR/VR menus or digital tables offering visual delights, recommendations, or even interactive AI-generated games while waiting for your meal.

The magic of generative AI in the world of gastronomy ensures that every visit to a café or restaurant becomes an experience straight out of the future. We're excited to see what's next on the menu! How about you?