--- slug: gamestonk-terminal-the-next-best-thing-after-bloomberg-terminal title: Gamestonk Terminal - The next best thing after Bloomberg Terminal date: 2021-03-14 image: /blog/2021-03-14-gamestonk-terminal-the-next-best-thing-after-bloomberg-terminal/2021-03-14-gamestonk-terminal-the-next-best-thing-after-bloomberg-terminal.webp tags: - gamestonk-terminal - finance - stock-market - programming - open-source description: In this blogpost, I introduce Gamestonk Terminal, an open-source project that aims to be a comprehensive tool for financial analysis and stock market research. It includes functionalities for discovering stocks, market sentiment analysis, fundamental and technical analysis, due diligence, prediction techniques, and more. ---


In this blogpost, I introduce Gamestonk Terminal, an open-source project that aims to be a comprehensive tool for financial analysis and stock market research. It includes functionalities for discovering stocks, market sentiment analysis, fundamental and technical analysis, due diligence, prediction techniques, and more. The open source code is available [here](https://github.com/DidierRLopes/GamestonkTerminal).
If you like stocks and are careful with the way you spend your money, (me saying it seems counter-intuitive given that I bought GME at the peak, I know) you know how much time goes into buying shares of a stock. You need to: Find stocks that are somehow undervalued; Research on the company, and its competitors; Check that the financials are healthy; Look into different technical indicators; Investigate SEC fillings and Insider activity; Look up for next earnings date and analysts estimates; Estimate market’s sentiment through Reddit, Twitter, Stocktwits; Read news;. … the list goes on. It’s tedious and I don’t have 24k for a Bloomberg terminal. Which led me to the idea during xmas break to spend the time creating my own terminal. I introduce you to “Gamestonk Terminal” (probably should’ve sent 1 tweet everyday to Elon Musk for copyrights permission eheh). As someone mentioned, this is meant to be like a swiss army knife for finance. It contains the following functionalities: - **Discover Stocks**: Some features are: Top gainers; Sectors performance; upcoming earnings releases; top high shorted interest stocks; top stocks with low float; top orders on fidelity; and some SPAC websites with news/calendars. - **Market Sentiment**: Main features are: Scrolling through Reddit main posts, and most tickers mentions; Extracting trending symbols on stocktwits, or even stocktwit sentiment based on bull/bear flags; Twitter in-depth sentiment prediction using AI; Google mentions over time. - **Research Web pages**: List of good pages to do research on a stock, e.g. macroaxis, zacks, macrotrends, .. - **Fundamental Analysis**: Read financials from a company from Market Watch, Yahoo Finance, Alpha Vantage, and Financial Modeling Prep API. Since I only rely on free data, I added the information from all of these, so that the user can get it from the source it trusts the most. Also exports management team behind stock, along with their pages on Google, to speed up research process. - **Technical Analysis**: The usual technical indicators: sma, rsi, macd, adx, bbands, and more. - **Due Diligence**: It has several features that I found to be really useful. Some of them are: Latest news of the company; Analyst prices and ratings; Price target from several analysts plot over time vs stock price; Insider activity, and these timestamps marked on the stock price historical data; Latest SEC fillings; Short interest over time; A check for financial warnings based on Sean Seah book. - **Prediction Techniques**: The one I had more fun with. It tries to predict the stock price, from simple models like sma and arima to complex neural network models, like LSTM. The additional capability here is that all of these are easy to configure. Either through command line arguments, or even in form of a configuration file to define your NN. It also allows backtesting. - **Reports**: Allows you to run several jobs functionalities and write daily notes on a stock, so that you can assess what you thought about the stock in the past, to perform better decisions. - **Comparison Analysis**: Allows to compare different stocks. - **On the ROADMAP**: Cryptocurrencies, Portfolio Analysis, Credit Analysis. Feel free to add the features you’d like and we would happily work on it. This project will always remain open-source, and the idea is that it can grow substantially over-time so that more and more people start taking advantage of it. Feel free to contribute towards the project. Feedback is extremely welcome! --- --- slug: momentum-football-bets title: Momentum Football Bets date: 2021-04-07 image: /blog/2021-04-07-momentum-football-bets/2021-04-07-momentum-football-bets.webp tags: - football - betting - momentum - web-scraping - beautiful-soup - python description: In this blogpost, I share how I developed an automated task to estimate the momentum of football teams for betting purposes using Beautiful Soup and Python. ---


In this blogpost, I share how I developed an automated task to estimate the momentum of football teams for betting purposes using Beautiful Soup and Python. The open source code is available [here](https://github.com/DidierRLopes/momentum-football-bets).
This Easter, I spoke with my girlfriend’s father and there were several football matches happening that weekend, he started talking about betting on some of those matches. He carried on to explain me his betting routine, which consisted of: 1. Checking the next fixtures for a specific competition: https://www.skysports.com/premier-league-fixtures 2. Checking the last results of each of the team and “estimate” their momentum (e.g. https://www.skysports.com/football/wolverhampton-wanderers-vs-liverpool/stats/429116)
Then, iterate these 2 steps for all the fixtures happening, from Premier League, Championship, League One, and League Two. Since I recently learned how to use Beautiful Soup to scrap data from web pages (see [GamestonkTerminal](https://dro-lopes.medium.com/gamestonk-terminal-the-next-best-thing-after-bloomberg-terminal-a263c001a61f)), I thought that I could create an automated task that would do all of these steps with a simple double click executable. After checking that I could extract such data from SkySports, I let him know that by the next day I would have something working. After dinner, I started working on the project, and before I went to sleep I had the first prototype working, which you can see in [here](https://github.com/DidierRLopes/momentum-football-bets). On top of “his” automated task, I created a “momentum score” which tries to estimate the momentum score based on what my girlfriend’s father told me that he does. He looks into the last games of the team and see if they have a positive momentum by looking to see if they come from a winning series. So, I thought it would be good to attribute a weight to each of the last matches where the most recent match would have the biggest weight, and last one from the 6 provided from SkySports stats would have the lowest weight. Together with this weight, I thought we could use the sum of the weight to the score in case of a win, subtract in case of loss, and don’t do anything in case of a draw. So, in simple terms, if score is positive the team is likely to have been winning their last matches, if score is negative the team is likely to have loss their last matches. But then, I thought: _“Ok, this is nice. But when you bet, you don’t bet on a single team, but on the result between the 2 teams that are playing each other.”_ I.e. if team A has an amazing momentum, and so has team B, the bet will — in theory — be risky. Hence, the next step was to address this concern. This was done by checking the momentum score difference between the teams, the bigger the momentum score, the less risky — in theory — a bet would be. What we want to see is a team that has been doing amazing for the past 6 games, and one that has been performing consistently bad. Lastly, I added a confidence filter so that the terminal would only output the games that shown at least a certain X confidence. And also, an argument that would select the number of days in the future that we could look for fixtures. After having this implemented, the day after was about polishing the code, adding some colouring and emojis, creating a repository for it, a README, discussing the binning of the momentum score and bet confidence terms, creating a logo for it, and creating an executable + adding the logo which my girlfriend did. ![image](/blog/2021-04-07-momentum-football-bets/2021-04-07-momentum-football-bets_1.webp) After this, we were quite excited to backtest the app. We filtered the next features with a big confidence bet score (to have less risk), and put 20 pounds on 3 different accumulators. [And it’s gone.](https://www.youtube.com/watch?v=-DT7bX-B1Mg) Hope you had a good read. Feedback is always appreciated. --- --- slug: move-over-bloomberg-terminal-here-comes-gamestonk-terminal title: Move over Bloomberg Terminal, here comes Gamestonk Terminal date: 2021-04-23 image: /blog/2021-04-23-move-over-bloomberg-terminal-here-comes-gamestonk-terminal/2021-04-23-move-over-bloomberg-terminal-here-comes-gamestonk-terminal.webp tags: - gamestonk-terminal - finance - stock-market - programming - open-source description: In this blogpost, we introduce Gamestonk Terminal, an open-source project that aims to be a comprehensive tool for financial analysis and stock market research. It includes functionalities for discovering stocks, market sentiment analysis, fundamental and technical analysis, due diligence, prediction techniques, and more. ---


In this blogpost, we introduce Gamestonk Terminal, an open-source project that aims to be a comprehensive tool for financial analysis and stock market research. It includes functionalities for discovering stocks, market sentiment analysis, fundamental and technical analysis, due diligence, prediction techniques, and more. The open source code is available [here](https://github.com/DidierRLopes/GamestonkTerminal).
Hey all, 2 months ago I made a terminal that I had been working on my spare time, to help me on my stock research, open-source. See [here](/blog/gamestonk-terminal-the-next-best-thing-after-bloomberg-terminal). ## The motto Gamestonk Terminal provides a modern Python-based integrated environment for investment research, that allows the average joe retail trader to leverage state-of-the-art Data Science and Machine Learning technologies. As a modern Python-based environment, Gamestonk Terminal opens access to numerous Python data libraries in Data Science (Pandas, Numpy, Scipy, Jupyter), Machine Learning (Pytorch, Tensorflow, Sklearn, Flair), and Data Acquisition (Beautiful Soup, and numerous third-party APIs). As of today, and thanks to all your help and the traction created around it, the terminal is looking better than ever. Now it’s no longer only me taking care of the repo, but also 2 other experienced devs, who are adding features on a daily basis and increasing the robustness of the codebase. Feel free to wander through the FEATURES page to see what you would get out of this tool! If some of you thought it was amazing 2 months ago, you won’t believe what it looks like now. You can check out the ROADMAP for all the features that have been added since, but let me list some of them: - **New** Screener for stocks, which allows users to save their presets and share them - **New** Options menu - **New** Comparison Analysis to compare several tickers in their historical price, sentiment, or fundamental analysis - **New** Portfolio Optimisation that assigns stocks weights based on risk level specified by the user - **New** Exploratory Data Analysis menu that looks at historical data from a statistic point of view - **New** Residual Analysis after using a statistical model for prediction - **New** menu to provide access to your portfolio (supports Robinhood, Ally invest, Alpaca, and Degiro) - **New** Cryptocurrency, Forex, and FRED menus - Prediction with backtesting - Technical analysis that includes a score and a summary - Due Diligence menu with data from Dark Pools, and also Failure to Deliver - Sentiment analysis from news provided from collaboration with a company that provides this feature paid. Free for us! As always feedback is appreciated, and contributions even more so! Let’s try to reduce the gap between the amount of information that the Hedge Funds have access to in comparison with the usual retail trader. Bloomberg Terminal, we’re coming for you. Feel free to join our discord at https://discord.gg/Up2QGbMKHY. --- --- slug: neistpoint-project title: NeistPoint Project date: 2021-05-23 image: /blog/2021-05-23-neistpoint-project/2021-05-23-neistpoint-project.webp tags: - neistpoint - clothing-brand - sustainability - project-management - c++ - stock-management description: In this blogpost, I share my journey of starting a sustainable clothing brand, managing the project, and developing a stock management tool in C++. ---


In this blogpost, I share my journey of starting a sustainable clothing brand, managing the project, and developing a stock management tool in C++. The open source code is available [here](https://github.com/DidierRLopes/NeistpointCLI).
## Context More than 2 years ago, me and some friends started a clothing brand - **NeistPoint**. The logo and name is inspired by the Neist Point Lighthouse in the Isle of Skye. The motto was “**For a greener future and a bluer ocean**”, and the goal was to raise awareness to contribute for a sustainable environment. At **Neist**, we tried to not be yet another clothing brand, but actually to fill the current gap in the retail industry by producing high-quality, eco-friendly clothes at affordable prices. And we achieved that. For instance, our t-shirts are made of 100% organic ring-spun combed cotton, and they last longer than my Lacoste t-shirts — seriously. The problem is that to be profitable, you need to either increase the prices of your products, or decrease the quality, which were not things we wanted to do since they didn’t represent the value of our brand. Due to that, and the fact that the team behind our brand no longer has time/resources, we’re dropping our **last ever** season now. Anyway, no regrets from my side, it has been a great learning experience to understand what is involved around the creation of a brand, being a project manager internally, and doing something other than coding in my spare time. _Also, most importantly, ending up with a full new wardrobe of pieces that I love and that will probably last for my kids._ Sorry for this rambling, just wanted to share this context with everyone. ## Implementation Given that our team had no experience in clothing whatsoever, and based on our needs, our steps to make this a high-quality product were: 1. Get the best (environmentaly friendly) clothing material 2. Send it to the best embroidery store in Portugal 3. Package it and forward it onto the customer
![image](/blog/2021-05-23-neistpoint-project/2021-05-23-neistpoint-project_1.webp) This process was **far from being optimised**. In fact, pretty much everything was manual. Apart from the creation of the clothes. Therefore, we needed a Software to keep track of the products at each of it’s stages: _material to request, material shipping, material in stock, product to create, product creating, product in stock, and product sent_. Since I didn’t find anything that I liked online, and I knew how to code, I thought the best solution was to develop something myself. This way it could be adapted to perfectly fit my own requirements (advantages of being your own product owner eheh). In addition, I wanted to improve my C++ skills, so I thought, **why not?** ![image](/blog/2021-05-23-neistpoint-project/2021-05-23-neistpoint-project_2.webp) For 1 week or so, during my commute I worked on the [NeistPoint Stock Managemen](https://github.com/DidierRLopes/NeistpointCLI) tool. To be honest, I think it took longer to devise the architecture behind it than to actually write the code, as there were lots of things that I wanted to be taken into account. Also, the fact that the “database” is a .csv file, was intentional. This way, we could share this file between the team members. Hope someone finds this tool interesting, and gets inspired to develop their own software to meet their own project requirements. In the meantime, feel free to check us one last time on [our website](https://neistclothing.com/) or [instagram](https://www.instagram.com/neistclothing/). You may even spot me in some of the pictures! The repository for the code can be found here: https://github.com/DidierRLopes/NeistpointCLI Thanks for reading, as always! --- --- slug: customizable-meme-filter title: Customizable Meme Filter date: 2021-06-12 image: /blog/2021-06-12-customizable-meme-filter/2021-06-12-customizable-meme-filter.webp tags: - python - meme-filter - image-processing - face-recognition description: In this blogpost, I share my journey of creating a customizable meme filter using Python. This filter selects a random meme based on the number of people on the screen and assigns each person to a character in the meme. ---


In this blogpost, I share my journey of creating a customizable meme filter using Python. This filter selects a random meme based on the number of people on the screen and assigns each person to a character in the meme. The open source code is available [here](https://github.com/DidierRLopes/meme-filter).
For the people who know me, they know how much I enjoy memes. I’ve got to admit, whenever I go to museums I have a lot of fun captioning artwork as memes. **As I like to say, I go for the art, and I stay for the memes.** One day while commuting to work (you can still see the [first commit](https://github.com/DidierRLopes/meme-filter/commit/59be427571c96350d9652922b3ab2ba52ddf18af) which dates back to 10 February of 2020 and has only notes of the sketch of this idea in Portuguese) I thought: > “It would be funny if there was a snapchat kind of filter where given the number of people on the screen, a random meme was selected and each person would be one of its characters”.
Since I was still improving my Python skills, I thought why not do it in Python. After 1 month, I already had the working code, however, since I was switching jobs at the time my commute time reduced drastically and so did my time to work on this. It took around 1 more month to finish the cleaning up of the script (324 lines) to be more readable, and at the same time Covid happened. **The latter explains why my hair is blonde on the demo below** :) Usage: ```console ./didifilter.py — location=memes — caption=’Which meme am I?’ — initial=30 — final=50 -b — max=3 ``` ![hair_1](/blog/2021-06-12-customizable-meme-filter/2021-06-12-customizable-meme-filter_1.webp) **To sum up:** This program is meant to be an advanced version of the known snapchat filter where there are random images spinning on top of people’s heads. The main improvement is that you can not only select the images you want to choose from and the caption, but you can also play it with friends (recognizing more than 1 face at the same time). The best part of the script is that it is meant to be easily customizable. Any person is able to create their own filter by creating a folder with the images they want within a folder with 1, 2, … based on the number of people they are meant to be used (apart from when backwardCompatible flag is enabled), and select/specify different types of flags/parameters, e.g.: ```console ./didifilter.py — locationFolder=celebrities — caption=’What celeb am I?’ — max=2 -v — video=”exampleVideo” ``` ```console ./didifilter.py --locationFolder=pokemons --caption="Who's this pokemon?" --width=250 --height=150 --max=1 -p ``` **AND**, you can also quickly tweak the code to adapt it to do something else. Here’s me **pranking** my girlfriend with a psyduck when the query was: “_Who do I look like?_” ![hair_2](/blog/2021-06-12-customizable-meme-filter/2021-06-12-customizable-meme-filter_2.webp) Hope you have a nice read and enjoy the filter. You can find the code [here](https://github.com/DidierRLopes/meme-filter). Feel free to provide feedback, as always! --- --- slug: my-journey-of-memorising-a-deck-of-52-shuffled-cards title: My journey of memorising a deck of 52 shuffled cards date: 2021-06-26 image: /blog/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards.webp tags: - memory-training - pao-system - memory-palace - card-memorization - learning-techniques - cognitive-skills - mnemonics - personal-challenge - mind-hacking description: In this blogpost, I share my journey of memorising a deck of 52 shuffled cards using the PAO system and Memory Palace technique. ---


In this blogpost, I share my journey of memorising a deck of 52 shuffled cards using the PAO system and Memory Palace technique.
A few years back, I wanted to read a book about memory and found the best-selling book **“Moonwalking with Einstein: The Art and Science of Remembering Everything”** an ideal choice. I won't go into too much detail about the book which is a great read, if you don't trust me, trust Bill Gates, who called the book "_absolutely phenomenal_"". But let me give you a brief sequence of events from the author and journalist of the book, Joshua Foer: - It starts by observing the extraordinary accomplishments of mental athletes at a memory championship. - Foer meets Tony Buzan, the trim 67-year-old English self-help guru who founded the [World Memory Championships](http://www.worldmemorychampionships.com/) in 1991 and who insists the brain is "like a muscle": exercise it and it gets stronger. - Foer learns the art of memory training. - He practices his memory muscles for 1 year with help of a shambling 24-year-old from Oxford who becomes his mentor. - He then finds himself in the finals of the US Memory Championships, alongside 'mental athletes' who could memorise the precise order of ten shuffled decks of cards in under an hour. If you're interested, here's a [nice review](https://www.theguardian.com/science/2012/nov/21/moonwalking-einstein-joshua-foer-review) on the book. ## My thoughts after reading book After finishing this book, more than anything I was curious. Unlike Joshua Foer, I didn't want to dedicate a full year to the cause, but I still wanted to give it a go so I could look back and think: "Here's something pretty useless for the day-to-day. Yet, how cool is that I can memorise 52 random cards?"". ![image](/blog/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards_1.webp) For people who know me, they know how much I hate to leave things unfinished. Whether that's a task that I set myself, or 'just' not leaving any pizza leftover. Therefore, I knew that if I really wanted to do this, I'd have to set aside time for it, and so I did. The text under is my journey to memorise a shuffled deck of 52 cards. ## Technique (PAO + Memory Palace) The mnemonic "**Memory Palace**" technique that I was about to use was referred to on the aforementioned book. The ancient mnemonic technique was first practiced by Simonides of Ceos over 2,500 years ago. When googling the term, the definition is: _A Memory Palace is an imaginary location in your mind where you can store mnemonic images. The most common type of memory palace involves making a journey through a place you know well, like a building or town. Along that journey there are specific locations that you always visit in the same order._ The mnemonic images would be conceived using the famous PAO system. This term means: _The Person-Action-Object System (or "PAO" System) is a popular method for memorising long random numbers and decks of playing cards. … Some people assign arbitrary images to the numbers without any phonetic conversion. The digits are usually chunked in 2 or 3 digits and then placed into loci in a Memory Palace._ The idea is to take advantage of what we humans are best at, photographic memory. ## The journey of memorising a shuffled deck of 52 cards ### 1. Create your own personal PAO system. For each card of the deck you have to have an associated _Person_, _Action_ and _Object_. It's useful to have the least possible rules, and have these intersecting simultaneous cards, so that there's less to memorise. Here's how I did it: - Define a **category** for each **suit** (e.g. Hearts represents friends) - Define **something** for each **type**. - From 1 to 10 I've defined the starting letter of the person (e.g. Card 7 represents a person with name starting with letter K or C). - For the court (Queen, Jack, King) I've defined them as a powerful male/female. (e.g. King is the GOAT of the category). Below you can see what the table looks like: ![image](/blog/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards_2.webp) **Note:** The Person is the main existing link, hence it needs to be something that you think of immediately when the category and the type of the card is known. I had to change my cards several times as some of the PAO's I had weren't memorable enough, either because the name was too common, or because I didn't relate that much to this person. ### 2. Memorise each card with it's PAO system Once the table above is filled in, the next step is to associate each card with it's **Person-Action-Object**. I find that as long as you can remember the person name of the card by doing the cross between category and type, the action-object comes easily. For instance: ![image](/blog/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards_3.webp) **Jack ♦: Einstein — Writing Equations — Blackboard** - When I see a **Diamond**, I know we are in the **Celebrities** category. Since this is a **Jack** I know it's an **important person**. I've selected Musk to be my GOAT, so this has to be **Einstein**. The **writing equations** and **blackboard** comes trivially when thinking about Einstein. **8 ♣: Floyd Mayweather — Skipping — Rope** - When a **Club** appears, I know we are in the **Athletes** category. Since this is an **8** I know the name starts with an **F or V**. This promptly reminds me of **Floyd**. The **skipping** and **rope** come immediately, due to my own personal experiences from improving my skipping skills and looking at videos of Mayweather. I find that the more the personal and creative you get with this, the easier it is to remember. **King ♠: Goku — Powering up — Blonde Hair** - If I see a **Spade**, I know we are in the **Cartoon** category. Since this is a King I know that this character is the **GOAT**. Which immediately triggers my brain to Goku, since it used to be my favourite cartoon as a kid. Trivially, comes the powering up as action, and the blonde hair as object. In order to remember all the cards, my trick was to have a deck of cards where on the back of each card I wrote its own PAO. So that if I didn't remember, instead of looking at the table, I could look at the back of the card. However, I find it important to sometimes not quit trying to remember immediately, as when you initially struggle to remember a card, when you eventually do, your brain retains this information so much better. **Note: At this step you may realise that you keep forgetting the same PAO card. I recommend you going back to step 1 and re-defining it.** Once I did this to the cards I kept forgetting, I was in a much better position. ### 3. Create your own memory palace This is the easiest step. I used the house I grew up in in Portugal, and decided to place 4 PAO instruments (i.e. 12 cards) per house division. Meaning that by the time I was in the first room upstairs, I was already 36 cards down the deck. Since I'm not living in Portugal, let me show you what I mean by using a picture of my current living room in London. The spots I would select in here would have been: 1. Top of table with candles; 2. Top of side table; 3. Inside my gecko's vivarium; 4. As a program on the TV. ![image](/blog/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards_4.webp) **Note: Make sure you always remember your memory palace spots, otherwise you may overlook them once looking for the next 3 set of cards.** The way I think about this is imagining that I lost my keys, and mentally going back in time to try to understand where they could be. ### 4. Practice memorising each set of 3 cards PAO This is where the creativity comes in. **When picking 3 cards from the deck, you picture the Person of the 1st card, the Action of the 2nd one, and the Object of the 3rd one.** Let's imagine we've got the cards aforementioned. **- Card 1: Jack ♦** * Einstein — Writing Equations — Blackboard **- Card 2: 8 ♣** * Floyd Mayweather — Skipping — Rope **- Card 3: King ♠** * Goku — Powering up — Blonde Hair In my brain, this would lead to ![image](/blog/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards_5.webp) **Note: At this point you may realise that some combos of cards don't work well together. **If this is bad enough to not make you remember the 3 card PAO, I recommend updating your PAO system to something that's easier to generalise. ### 5. Place each 3 cards PAO onto the memory palace For instance, if I were to place the **Einstein Skipping with Blonde Hair** on the **3rd spot of my living room (my gecko's vivarium)**, in my head, I would picture something like this: ![image](/blog/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards/2021-06-26-my-journey-of-memorising-a-deck-of-52-shuffled-cards_6.webp) **Note: I recommend trying to have the 3 card PAO interacting with the environment to improve memory.** In this case, I would have thought about the Blonde Skipping Einstein having to do skipping so fast that the gecko coudn't come close because the rope was going too fast. The more original/different, the more chances you have to remember this scenario. ### 6. Re-iterate the memory palace with new 3 card PAO every time Instead of memorising a new 3 card PAO in a memory palace location and then moving on, I always go back to the start and think about all the previous 3 card PAO's from start. This will ensure you don't forget the oldest 3 card PAO. In fact, it will make it so that the oldest 3 card PAO are repeated more times than the newer ones, so it's all balanced out. ### 7. Practice and Practice I found out that after memorising my PAO system (which took a long time) and the memory palace, it was fairly easy to memorise the shuffled 52 deck of cards. However, it was taking me way too long to memorise it AND say it out loud. Once I started practicing more and more time started decreasing. The last time I tried, I managed to do it under 10 minutes, which is not great but I'll take it. As I mentioned, I just wanted to be able to do it, I didn't care much about the time. Also, I still needed to think about the category + type of the card every-time, I think the time to memorise the deck of cards decreases exponentially once you actually associate each card image to it's PAO. But for that you need to practice more, which for me was getting boring. ... This is a different post than the ones I usually do, but I find it extremely interesting. Hence why I was keen on sharing it. Let me know if you've heard about it, or want to give this a go. Thanks for reading! --- --- slug: household-bills-program title: Household bills Program date: 2021-07-17 image: /blog/2021-07-17-household-bills-program/2021-07-17-household-bills-program.webp tags: - side-project - java - programming - gui - origin-story - learning-to-code - software-development description: In this blogpost, I share my journey of creating a program to split household bills. This was my first side project where I used Java to create a GUI application. ---


In this blogpost, I share my journey of creating a program to split household bills. This was my first side project where I used Java to create a GUI application. The open source code is available [here](https://github.com/DidierRLopes/HouseholdBills).
**My first side project.** Before University, I spent most of my spare time playing counter-strike (my steam account had **more than 1000 hours played**, that's more than 41 entire days playing in a row). I was a decent player I'd say, you can see a compilation of "almosts" I've done [here](https://www.youtube.com/watch?v=ocsJzNJJB50). However, I knew this wasn't the way. I realised that if I used the amount of time I was spending on online games for learning, I would have a much bigger satisfaction return. And, in the long term, my life would be better. **So I started studying hard.** I started valuing my time more, and declined most of the parties I was invited to because I was busy working late hours. Don't get me wrong, I'm an easy person. I like to think I make friends easily. However, I just had different priorities, and partying just wasn't one of them. As my parents say: _"Everything has its own time"_. In my 2nd year of University, I was getting really good grades, which means that I started having discussions with the other best students in the course. **That's how I met one of the smartest people I know to this day**. This guy was a proper hands-on person, he didn't study half the time I did, but he was always busy with something. He had a band, developed his own personalised guitar pedals and amplifiers, and developed some apps for fun. He did this all while having excellent results at University, which is insane. That's when I realised that he was not only giving more priority to these hobbies in relation to partying or meeting people, **BUT also in relation to doing courseworks or studying for exams**. He'd never fail a coursework/exam, but that further study could have bumped a grade from 17 to a 19 out of 20. One day, we were meant to meet at his place to work on a coursework together, and he shown me an app that he had developed for him and his girlfriend. The app was a simple command line interface that was able to split their usual household bills (rent, water bill, food shop, cat food, etc). **I found that fascinating.** I told him I would create one for myself. Since I had read about how to use Java to make a pretty GUI, I thought why not give this a go (although I had no idea about OOP). In addition, I didn't want my program to look the same as his, so I thought my version could be as if it was an upgrade. ... After that, I was on a mission. Little did I know that after this, I never really stopped having an interest in working on new side projects. The planning steps were: **1. Decide main features.** Add new household bills to split, Give money, and See bills. **2.Sketch what the GUI should look like** **3. Devise data structure associated with a new Household bill split.** This was important for both coding, and also database management. **4. Work out the math associated with the splitting and giving** The development process was to **"divide to conquer"**. I split the tasks into several sub-tasks, and after every new little code change I was testing the code to make sure that nothing was broken. I re-iterate through design and code several times, until I was happy with my solution. Then I did some clean-up/improvements, such as: Adding pictures of the users, Login password, Frenchies as icons. **On a funny side note:** As I didn't know how to work with DBs at that time, I used text files to save and load all the information. Meaning that if my brother ever opened one of those text files (which weren't properly hidden...), I could have passed from him owing me 100 euros to me owing him 10 million. The software was on his laptop, and I had an hardcoded password, so in theory he couldn't manually add any bill without my presence -- I guess that was enough for him to think that the product was bullet-proof. See images below of the program:


You can find more information about this on my GitHub, [here](https://github.com/DidierRLopes/HouseholdBills). **The program ended up being used for more than 3 years.** Since I lived with other people other than my brother, I had to update the name/image on the program to represent that. Since I was new to coding, I didn't think about the future. Therefore, when that time came, I had to manually replace the names one by one in the code. I also had friends requesting to use the program, which lead to me adapting this to their names/figures. It was a fun project and I definitely learned loads from it. The most important thing was that I was able to do whatever **I wanted software-wise as long as I dedicated enough time for it.** Hope you had a fun read. Thanks! --- --- slug: minion-recipes-program title: Minion Recipes Program date: 2021-07-23 image: /blog/2021-07-23-minion-recipes-program/2021-07-23-minion-recipes-program.webp tags: - python - programming - recipes - software-development description: In this blogpost, I share how I developed a program to help my mum manage her recipes. The program allows for adding, editing, and removing recipes, and even includes fun minion icons. ---


In this blogpost, I share how I developed a program to help my mum manage her recipes. The program allows for adding, editing, and removing recipes, and even includes fun minion icons. The open source code is available [here](https://github.com/DidierRLopes/RecipesProgram).
Once I developed the [Housebills program](/blog/household-bills-program), I really enjoyed the feeling of being able to create usable software from scratch. Therefore, that year during Christmas, I wanted to challenge myself to see if I could find any interesting project to do in only 1 week. I started by nagging my dad and brother for them to tell me something that would be useful to them in their daily lives. Sadly, none of them had any idea. Then, I went to the kitchen to ask my mum the same. She was busy searching recipes for xmas on her messy notebook, so she also said no. I sat there next to her thinking about what I could do, while she kept on going back and forth in her notebook searching. I don’t know if she had been reading about the binary search algorithm, or if she was just opening pages randomly. What I know is that 1 week later I did a program for her to keep her recipes. Safe to say that I saved Christmas, I guess. Note: Before the end of that year, I still upgraded the software for its version 2.0, which included more than 20 minion icons. To this day, I think she opens the program to see the minion icons more than the recipes themselves. Below it displays the interfaces used, and these correspond to: Red-Visualize; Add; Blue-Add; Green-Edit; and Yellow-Remove recipes. ![image](/blog/2021-07-23-minion-recipes-program/2021-07-23-minion-recipes-program_1.webp) PS: Any resemblance with the Microsoft colour scheme is pure coincidence eheh. When adding a recipe, the following window will be displayed. ![image](/blog/2021-07-23-minion-recipes-program/2021-07-23-minion-recipes-program_2.webp) This allows you to add both a recipe, and a category (i.e. the “Tiramisu” recipe would be within “Desserts” category). The recipe content would include: - Name of the recipe - Ingredients - Preparation - Comment When visualising a recipe, the following window will be displayed. ![image](/blog/2021-07-23-minion-recipes-program/2021-07-23-minion-recipes-program_3.webp) Where the recipe dialog box would prompt the recipes based on the category chosen on its left. Then, after selecting a recipe, the ingredients, preparation and comment would be filled out. When editing a recipe, the following window will be displayed. This is similar to the visualisation window, with the difference that the text boxes are editable, and therefore, the recipe can be improved. ![image](/blog/2021-07-23-minion-recipes-program/2021-07-23-minion-recipes-program_4.webp) Note: throughout the program there are Message Dialog boxes (as shown above) that tell the user whether the recipe has been successfully (or not) edited, added or removed. Finally, in order to remove a recipe, the following window would be displayed. Where you can either delete a single recipe, or the entire category. ![image](/blog/2021-07-23-minion-recipes-program/2021-07-23-minion-recipes-program_5.webp) The recipe database is handled in the most robust way: **with plain text files**, obviously. As always, hope you had a nice read. --- --- slug: k-means-clustering-to-visit-a-new-city title: K-means algorithm to visit a new city date: 2021-08-01 image: /blog/2021-08-01-k-means-clustering-to-visit-a-new-city/2021-08-01-k-means-clustering-to-visit-a-new-city.webp tags: - k-means - algorithm - travel - efficiency - london - gps - clustering description: In this blogpost, I share how I used the K-means algorithm to plan a visit to London. The algorithm helps to decide which attractions to visit based on the number of days of the visit and the GPS coordinates of the attractions. ---


In this blogpost, I share how I used the K-means algorithm to plan a visit to London. The algorithm helps to decide which attractions to visit based on the number of days of the visit and the GPS coordinates of the attractions. The open source code is available [here](https://github.com/DidierRLopes/LondonVisit).
Usually when I book a weekend getaway, I spend quite some time doing 2 things: - Writing down the main attractions I want to see - Depicting the travel path to maximise efficiency and see the most in less time (I’m a bit of an efficiency freak myself, sorry) **This repository aims to decide which attractions to visit in London as a function of the number of days that you will be visiting, by applying K-means algorithm.** As input you need to give the GPS coordinates of the main attractions you want to visit during your stay, and the number of days you are planning to visit. Notice that attractions that are not within the map screenshot boundaries will be discarded. See disclaimer below. The K-means algorithm will interpret: List of GPS coordinates of the main attractions that you want to visit as 2D samples, after converting to UTM. Number of days of the visit as Number of clusters. Of course, this is rather unrealistic because of several reasons, such as: - Not taking into account if they want to just pass by the London Eye, or have a ride on it; - Assumes that we are in a no man’s land since it completely bypasses the existence of other buildings, roads, …; - Does not consider altitude, even though London is rather plane; - Does not consider the number of attractions that one can possibly do per day; - Plus, if there was to be an attraction really far from the centre, it may happen that the algorithm considers an entire day for it (this would depend upon kernel initialisation) Nonetheless, I think this is a funny exercise, and if I were to select the areas to visit by myself, **it would most likely be a similar choice to the one taken by K-means**. **Disclaimer**: I did not know how to use Google API (neither wanted to pay for a key to be fair) hence I just took a screenshot of google maps and wrote down the coordinate of the lower left corner, so that I could use it as my origin. I also took the right top corner coordinate so that I could give the map with an “accurate” scaling. **Note**: GPS coordinates (latitude, longitude) have degrees has units, thus, explaining why the conversion to UTM coordinates, which uses meters. Immediately below you can see the result of a visit to London for 2, 3 and 4 days. ![image](/blog/2021-08-01-k-means-clustering-to-visit-a-new-city/2021-08-01-k-means-clustering-to-visit-a-new-city_1.webp)

This project was done for fun. However, I believe that by creating a tuple per location with coordinates and estimate of time taken on each attraction, something nice could come out of this. Hope you find this interesting. Let me know your thoughts. --- --- slug: ranking-99-mind-f-ck-movies title: Ranking 99 Mind f*ck movies date: 2021-08-15 image: /blog/2021-08-15-ranking-99-mind-f-ck-movies/2021-08-15-ranking-99-mind-f-ck-movies.webp tags: - movies - thrillers - imdbpy - python - sorting-algorithm description: Ranking and sorting a list of 99 mind-bending thriller movies using IMDbPy API in Python. ---


Ranking and sorting a list of 99 mind-bending thriller movies using IMDbPy API in Python. The open source code is available [here](https://github.com/DidierRLopes/SortMoviesPerRating).
During the Christmas holidays, me and my girlfriend, after watching The Office [US] twice in a row, and knowing most of Dwight’s pranks off by heart, decided that it was time to find something worth watching. Although there’s lots of tempting series out there, we didn’t want to follow that path as we don’t like the “addiction” effect that a series has. Also, we have the same taste regarding movies, where **we both enjoy complex thriller plots**, that leave your mind to resonate about them long after being done with it. Personally, I consider a movie great when it still crosses my mind when trying to sleep or the day after. So, thriller movies it was. After doing a little research work I came across this list of movies on Reddit: [99 mind f*ck movies](https://www.reddit.com/r/coolguides/comments/geipee/99_mindfck_movies/). I knew this list was good because most of my favourite movies were there, e.g. _The Prestige, Inception, The Usual Suspects, Primal Fear_, and _Ex Machina_. So, the movie list was decided, and with that, also our new year’s resolution. However, this list had 2 issues: **1. The list didn’t have any particular order.** We would like to have the list ranked from best to worst, so that watching the best ones first will keep our motivation levels up to finish the list. **2. The movie title didn’t have the released year.** Although we don’t particularly mind old movies, sometimes we’re just not in the mood to watch a B&W screen, or poor image resolution. Therefore, while Meg was busy, I was on a role to hack something that would both sort the list based on IMDB ranking, and add the release years to the titles. In a couple of minutes, I was already playing with [IMDbPy API](https://imdbpy.github.io/). This allowed me to have the sorting algorithm running in the background pretty quick. Within the hour, we already had our sorted movie list. Which I have attached below for future reference. ![image](/blog/2021-08-15-ranking-99-mind-f-ck-movies/2021-08-15-ranking-99-mind-f-ck-movies_1.webp) The first movie of the list that none of us had already watched was the movie [Incendies](https://www.imdb.com/title/tt1255953/). After having watched this movie, I can already tell you that sorting out this list was worth it. Definitely mind blowing, and a great watch. As usual, you can find the source code on my github: [SortMoviesPerRating](https://github.com/DidierRLopes/SortMoviesPerRating). Hope you enjoyed this read! --- --- slug: time-series-crossvalidation-for-nn title: Time-Series CrossValidation for NN date: 2021-09-04 image: /blog/2021-09-04-time-series-crossvalidation-for-nn/2021-09-04-time-series-crossvalidation-for-nn.webp tags: - python - data-science - deep-learning - time-series - cross-validation - neural-networks description: This blog post discusses the creation of a Python module for splitting univariate time-series data using cross-validation techniques. The module is designed to prepare data for training, validation, and testing in a Deep Neural Network (DNN). ---


This blog post discusses the creation of a Python module for splitting univariate time-series data using cross-validation techniques. The module is designed to prepare data for training, validation, and testing in a Deep Neural Network (DNN). The open source code is available [here](https://github.com/DidierRLopes/timeseries-cv).
2 years ago, [Filipe Ramos](https://www.linkedin.com/in/ACoAACK9n24BrpxWf0HMa9bL7MSHleu2YVXpI5E) my previous maths and probability teacher, knowing that I had a special interest in Data Science, challenged me to help him in his PhD thesis “_Data Science na Modelação e Previsão de Séries Económico-financeiras: das Metodologias Clássicas ao Deep Learning_”. Although we have been discussing theory, analysis and results, my main contribution was to write the Python code behind the thesis. As a result, I have written a python module that splits a given univariate time-series based on cross-validation techniques so that these can be fed to a Deep Neural Network (DNN) to extract training/validation/test errors. I know that there are examples of these online, but this was made from scratch so that we could personalise it according to the thesis’ needs, and grasp better what was at stake when performing different cross-validation techniques. **The idea is given a training dataset, the package will split it into Train, Validation and Test sets, by means of either Forward Chaining, K-Fold or Group K-Fold.** As parameters the user can not only select the number of inputs (`n_steps_input`) and outputs (`n_steps_forecast`), but also the number of samples (`n_steps_jump`) to jump in the data to train. The best way to install the package is as follows: `pip install timeseries-cv` and then use it with `import tsxv`. See the module developed [here](https://pypi.org/project/timeseries-cv/). This can be seen more intuitively using the jupyter notebook: “_example.ipynb_” Below you can find an example of the usage of each function for the following Time-Series: ```python timeSeries = array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]) ``` ## Split Train ```python from tsxv.splitTrain import split_train, split_train_variableInput X, y = split_train(timeSeries, n_steps_input=4, n_steps_forecast=3, n_steps_jump=2) X, y = split_train_variableInput(timeSeries, minSamplesTrain=10, n_steps_forecast=3, n_steps_jump=3) ```
## Split Train Val ```python from tsxv.splitTrainVal import split_train_val_forwardChaining, split_train_val_kFold, split_train_val_groupKFold X, y, Xcv, ycv = split_train_val_forwardChaining(timeSeries, n_steps_input=4, n_steps_forecast=3, n_steps_jump=2) X, y, Xcv, ycv = split_train_val_kFold(timeSeries, n_steps_input=4, n_steps_forecast=3, n_steps_jump=2) X, y, Xcv, ycv = split_train_val_groupKFold(timeSeries, n_steps_input=4, n_steps_forecast=3, n_steps_jump=2) ```

![image](/blog/2021-09-04-time-series-crossvalidation-for-nn/2021-09-04-time-series-crossvalidation-for-nn_5.webp) ## Split Train Val Test ```python from tsxv.splitTrainValTest import split_train_val_test_forwardChaining, split_train_val_test_kFold, split_train_val_test_groupKFold X, y, Xcv, ycv, Xtest, ytest = split_train_val_test_forwardChaining(timeSeries, n_steps_input=4, n_steps_forecast=3, n_steps_jump=2) X, y, Xcv, ycv, Xtest, ytest = split_train_val_test_kFold(timeSeries, n_steps_input=4, n_steps_forecast=3, n_steps_jump=2) X, y, Xcv, ycv, Xtest, ytest = split_train_val_test_groupKFold(timeSeries, n_steps_input=4, n_steps_forecast=3, n_steps_jump=2) ```

![image](/blog/2021-09-04-time-series-crossvalidation-for-nn/2021-09-04-time-series-crossvalidation-for-nn_8.webp) This module has not only been used for my friends’ thesis but also for a Data Science company and [Gamestonk Terminal](/blog/gamestonk-terminal-the-next-best-thing-after-bloomberg-terminal), that I know of :) You can check the stats of the module [here](https://pypistats.org/packages/timeseries-cv). --- --- slug: gamestonk-terminal-cant-stop-won-t-stop title: Gamestonk Terminal — Can’t Stop, Won’t Stop date: 2021-09-16 image: /blog/2021-09-16-gamestonk-terminal-cant-stop-won-t-stop/2021-09-16-gamestonk-terminal-cant-stop-won-t-stop.webp tags: - gamestonk-terminal - open-source - docker - jupyter-lab - hugo-website - python - finance - trading description: Gamestonk Terminal's latest updates including Docker integration, Jupyter Lab integration, a new Hugo website, and new features. A summary of the recent developments and future plans for the open-source financial tool. ---


Gamestonk Terminal's latest updates including Docker integration, Jupyter Lab integration, a new Hugo website, and new features. A summary of the recent developments and future plans for the open-source financial tool. The open source code is available [here](https://github.com/DidierRLopes/GamestonkTerminal).
Hey all, Do any of you know what **Docker, Jupyter Lab integration, features website and new features** have in common? Well this is what has been happening in [Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal) world since last month, and **MORE**! ### Docker - This has been a highly requested feature from our more experienced dev users, as it allows you to run our code in a container, pull the image and then get going with a smooth installation process. You will also be able to run Jupyer Lab from our Docker container. ### Jupyter Lab Integration - Jupyter is on course to take over the world (see [here](https://netflixtechblog.com/notebook-innovation-591ee3221233)). - Big investment banks like JP Morgan use Jupyter too, see [this](https://github.com/jpmorganchase/jupyterlab_templates). - Professionals in the industry such as Data Scientists, Data Analysts and Machine Learning engineers are familiar with the combo dockers+notebooks. Therefore, it makes our terminal an attractive Open-Source project to devote time to. - Academia students and universities will be able to use terminal data through a notebook for their projects and coursework. We’re on track to be able to achieve something on this soon! ### Hugo Website - Link [here](https://gamestonkterminal.github.io/GamestonkTerminal/). - This will not only simplify a contributor’s documentation process, but it will also let non-Gamestonkers now see the vast number of features we offer and yes, when you read “offer” this is actually an offer since the tool is **completely free** to use. ### Main New features - New Dark Pool Shorts menu - Refactored and improved Crypto menu!!! - Dark Pool and Crypto report generation - Excel Discounted Cash Flow created by a MBA student - Big code refactoring to allow for contributors to easily get started with our codebase - Contributing document (click here). ### Tier 2 features - [Sentiment Investor](https://sentimentinvestor.com/) data features implemented by the SI team themselves - Feature/fraud indicators implemented by a MBA student - Multiple plotting for economy data for more insight extraction - Screener presets to not miss out on promising tickers - Several new Technical Analysis indicators, e.g. Fibonacci, Fisher transform, Centre of gravity, zlma, Donchian channels… - Unusual options activity - Hot penny stocks in discovery menu - A contributor implementation of a realtime earnings expected move, from [The Geek of Wallstreet](https://thegeekofwallstreet.com/2021/08/03/realtime-earnings-data/) - Several new YahooFinance commands to discover promising tickers - Refactor Exploratory Data Analysis and Residual Analysis menus into a Quantitative Analysis one As if this wasn’t enough, we’re also working towards a [Discord bot](https://github.com/GamestonkTerminal/DiscordBot) so you can make best use of our terminal when discussing trading strategies with your friends. This was an initiative from a contributor, which just goes to show how much **we rely on our community to drive our project**. If you appreciate what we’re doing and want a better free and Open-Source financial tool, you should definitely star the project on our github [here](https://github.com/GamestonkTerminal/GamestonkTerminal), join [our Discord channel](https://discord.gg/Up2QGbMKHY), and follow our [twitter account](https://twitter.com/gamestonkt?lang=en). Not necessarily in that order! :) Have you been following our project and want to join our growing community? Here are a few tips on how to get started: - Join our Discord and tell us about your experience so far - Let us know what else you would like to see in the terminal - You can help to improve our crypto terminal, which is 99% taken care of from our contributors! - Help us add any features! You don’t know python? This may be your cue to learn with our team! Much love! GST Team & Community --- --- slug: how-i-created-a-bot-in-python-to-participate-in-nft-giveaways title: How I created a bot in python to participate in NFT giveaways date: 2021-09-30 image: /blog/2021-09-30-how-i-created-a-bot-in-python-to-participate-in-nft-giveaways/2021-09-30-how-i-created-a-bot-in-python-to-participate-in-nft-giveaways.webp tags: - python - bot - nft - giveaways - reddit - automation description: In this blogpost, I share how I created a bot in Python to automate participation in NFT giveaways on Reddit. The bot simplifies tasks such as upvoting posts, commenting, and opening Opensea links to favourite artwork. ---


In this blogpost, I share how I created a bot in Python to automate participation in NFT giveaways on Reddit. The bot simplifies tasks such as upvoting posts, commenting, and opening Opensea links to favourite artwork. The open source code is available [here](https://github.com/DidierRLopes/GiveawayNFTbot).
Lately I’ve been looking into NFTs. I’ve observed that more and more people are trying to innovate and create their own pieces of art. Some of them are impressive, some of them aren’t. But, > _Beauty is in the eye of the beholder — Margaret Wolfe Hungerford_
However, in my humble opinion, what distinguishes some art from others, is most of the time not the art itself but the community around it. For example, when everyone starts talking about the ‘new best thing’ you feel more pressure to get involved. Because of this dynamic, creators are investing in ways to increase their collectibles popularity by building their community. A great example is [ParallelNFT](https://parallel.life/) and the dystopic story that is being created around their cards — in their case, it’s fairly easy to understand that once a big community is formed around such cards, video games, movies and even series are on the table. For the first time ever, we would go from selling collectibles to creating some form of entertainment. A whole new industry in the making. However, not every digital creator has the resources to create a full concept around their cards. Does this mean that they can’t create a community around it? No. But they must find other ways. One of the most popular ways I’ve seen is through giveaways. Similar to what small clothing brands do to increase their popularity. This is a great tactic in my opinion, since giveaway not only give you a bigger audience (people that participate and re-share content) but it makes the cards have multiple owners. This, as a result, makes the collection more attractive for NFT collectors. _When demand exceeds supply_, **prices tend to rise.** And these creators are using Reddit as the platform of their giveaways. ![image](/blog/2021-09-30-how-i-created-a-bot-in-python-to-participate-in-nft-giveaways/2021-09-30-how-i-created-a-bot-in-python-to-participate-in-nft-giveaways_1.webp) When scrolling through reddit you will notice that all these posts have certain things in common: - They ask for an up-vote on the post - A comment with your wallet address - To favourite their artwork - They may also ask to you to join their Discord - For a follow on their Twitter or Instagram - If you can retweet or share a story These are things that take time, and a bot can perfectly do this. Therefore, I wrote a [giveaway NFT bot](https://github.com/DidierRLopes/GiveawayNFTbot) to simplify my work. Now I just sit down and read robot vacuum reviews while the bot: upvotes, comments and opens their Opensea link for me to favourite their artwork. I’ve already won multiple NFTs with this, which is exciting— you never know where the next [CryptoPunks](https://twitter.com/cryptopunksbot) are at. There’s actually 1 collection that I particularly like and believe has a lot of potential, it’s called [CryptoCartoonEaters](https://opensea.io/collection/crypto-cartooneaters) and due to the uniqueness of each collectible (only 100 made), I really think it has a great potential. I acquired my favourite cartoon as a kid: Goku Eating a Burger. ![image](/blog/2021-09-30-how-i-created-a-bot-in-python-to-participate-in-nft-giveaways/2021-09-30-how-i-created-a-bot-in-python-to-participate-in-nft-giveaways_2.webp) Let me know if you find this article interesting, and if you used the bot as well! --- --- slug: an-unusual-journey-learning-about-nns-for-a-phd-thesis title: An unusual journey learning about NNs for a PhD thesis date: 2021-10-22 image: /blog/2021-10-22-an-unusual-journey-learning-about-nns-for-a-phd-thesis/2021-10-22-an-unusual-journey-learning-about-nns-for-a-phd-thesis.webp tags: - phd-thesis - neural-networks - python - time-series-forecasting ---


An unusual journey of learning about Neural Networks for a PhD thesis. This blog post details the author's experience of assisting in the programming aspect of a PhD thesis, focusing on the study of various models and their forecasting performance. The open source code is available [here](https://github.com/DidierRLopes/UnivariateTimeSeriesForecast).
On 14th February of 2019, my previous Maths and Statistics teacher — [Filipe](https://www.linkedin.com/in/filipe-r-ramos-a66242143/) - sent me a messaged because of a Linkedin post I shared about work I was doing in python. It turns out that Filipe was looking for someone to help him with his PhD thesis, in specific, with the programming side of it. The challenge was to study diverse models (from classical to neural networks) and assess their forecasting performance. Since time series prediction was always a topic that I found fascinating and hadn’t had time to study, I thought this would be the perfect timing to do so. So from February 2019 onwards, this exciting journey started. I was working full-time so in order to be able to take part in this, I was only sleeping 4/5h a day. I started reading a lot of books and practicing my python coding skills in order to be more helpful. Then around June, we started working together on the code. We had around 2–3h discussions a couple times a week where we would discuss the point of the situation code-wise and where we wanted to be, we kept in touch about this every day. From the repo, which is open source [here](https://github.com/DidierRLopes/UnivariateTimeSeriesForecast), you can see that we explored: Exploratory Data Analysis; ARIMA and SARIMA; Exponential Smoothing; Deep Neural Network. The final part of this work consisted in an innovative approach to tackle an univariate time series, which you can find [here](https://github.com/DidierRLopes/UnivariateTimeSeriesForecast/blob/master/DNN_ourApproach.ipynb). On top of that, a library of cross-validation for Neural Networks was developed, which is now being used in real data science applications, see [here](https://github.com/DidierRLopes/timeseries-cv). The work, which took around 1 year to complete, can be divided into 3 distinct phases: - The **coding** phase lasted around 3 months. I would write the code, test the code and then touch base with Filipe to ensure we were going in the right direction. - The **tweaking and analysis phase** took around another 3 months. Here, Filipe took the code I had completed and analysed multiple time series with different trends and seasonalities; tweaked different models; trained and validated these; and started interpreting results. In this phase, me and Filipe would discuss the code from a pragmatic point of view, and improve it based on what Filipe wanted to see/analyse. This phase was so intense that Filipe flew out to London twice to meet me, almost over a period of 1 month. - The **writing of the thesis phase** took an additional 6 months. Here Filipe basically translated the results and analysis seen on the notebook of the thesis, wrote a full theoretical background on the models used and interpreted the applicability of these. The full work, _“Data Science in the Modeling and Forecasting of Financial timeseries: from Classic methodologies to Deep Learning”_, can be found in [here](https://ciencia.iscte-iul.pt/publications/data-science-na-modelacao-e-previsao-de-series-economico-financeiras-das-metodologias-classicas-ao/82703) or stored in [here](https://repositorio.iscte-iul.pt/handle/10071/22964). During this time, Filipe was also working full-time as he was a teaching assistant in three different universities. In spite of the adversities, Filipe achieved an impressive approved with “_unanimous distinction_” (maximum classification) from ISCTE Business School, Lisbon, Portugal. My character waiting for people to join my chatroom to discuss our poster. ![image](/blog/2021-10-22-an-unusual-journey-learning-about-nns-for-a-phd-thesis/2021-10-22-an-unusual-journey-learning-about-nns-for-a-phd-thesis_1.webp) Last week, at XXV Congress of the Portuguese Statistical Society (SPE 2021), we presented: - A poster that you can find [here](https://www.researchgate.net/publication/355360806_Forecasting_models_for_time-series_a_comparative_study_between_classical_methodologies_and_Deep_Learning), titled: _“Forecasting models for time-series: a comparative study between classical methodologies and Deep Learning”_ - A presentation that you can find [here](https://www.researchgate.net/publication/355360897_Explorando_o_poder_da_memoria_das_redes_neuronais_LSTM_na_modelacao_e_previsao_do_PSI_20), titled: _“Explorando o poder da memória das redes neuronais LSTM na modelação e previsão do PSI 20”_ ![image](/blog/2021-10-22-an-unusual-journey-learning-about-nns-for-a-phd-thesis/2021-10-22-an-unusual-journey-learning-about-nns-for-a-phd-thesis_2.webp) The poster above was presented at XXV Congress of the Portuguese Statistical Society (SPE 2021). I started this journey with my previous maths teacher and ended it with a close friend! Excited to see what other articles/publications we’ll be working on together in the future. PS: The ARIMA/ETS/MLP/RNN/LSTM models learned from this work, consisted the basis of the prediction menu on [Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal). As always, feel free to provide feedback! --- --- slug: the-start-of-my-machine-learning-journey title: The Start of my Machine Learning journey date: 2021-11-07 image: /blog/2021-11-07-the-start-of-my-machine-learning-journey/2021-11-07-the-start-of-my-machine-learning-journey.webp tags: - machine-learning - python - data-science - education - self-learning description: The start of my journey into the world of Machine Learning, from learning Python to understanding the underlying mathematics of ML algorithms. ---


The start of my journey into the world of Machine Learning, from learning Python to understanding the underlying mathematics of ML algorithms.
During my studies at [Imperial College London](https://www.imperial.ac.uk/) - 3ish years ago - I was introduced to the topic of Machine Learning, an area that I had always been interested about. At that time, not only I didn't know python, as `from sklearn.decomposition import PCA` wasn’t allowed. Therefore, we had to write the PCA (and other) algorithms in Matlab from scratch, which was great because it exposed us to the maths behind each algorithm. ![image](/blog/2021-11-07-the-start-of-my-machine-learning-journey/2021-11-07-the-start-of-my-machine-learning-journey_1.webp) The gif above is from my graduation at Royal Albert Hall with a MSc. in Control Systems with Distinction. After concluding my thesis (and paper): "[Energy savings from an Ecological Cooperative Adaptive Cruise Control: a Battery Electric Vehicle platoon investigation](https://ieeexplore.ieee.org/abstract/document/8796226)", which was presented at the 2019 European Control Conference in Napoli, I had finally time to focus on Machine Learning topics during my spare time through late hours and into weekends. I started by doing the famous MOOC **“Machine Learning - Andrew Ng”**. Saying that the course was good is an understatement. I ended up spending a long time on the course as I was taking notes and revising daily; I was still behaving like a university student even without the exam at the end! Not only the theory is really detailed, but the coursework in Matlab allowed me to understand what’s going on under the hood. Given that I was already a heavy Matlab user, due to its usage throughout my entire academic journey, I could focus on the ML section. After this course, I knew that I had learnt a lot, but I also knew that if I wanted to use ML for real-applications, I’d have to learn Python. Given that I knew Matlab, I choose to start reading a python book that had Data Science application in mind. Hence, I started reading **“Python Data Science Handbook”**. This, along with several hours of practicing on available datasets, has taught me pretty much all I know about Numpy, Pandas and Matplotlib. Although this book also contains a last chapter with ML algorithms, these are rather brief. > _In my previous job at Nurvv, where I worked as Sensor Fusion Engineer, I developed a python analysis tool that parsed all the raw data from a running session and conveyed that information into meaningful plots. This allowed us to analyse whether a run was successful from the Firmware side of things, and this was critical for our development. This tool was created mainly from the knowledged gathered from the book mentioned above._
Following this, I was rather confident with my Python skills. Therefore, I wanted to crack-on learning how to use ML algorithms with Python through the beauty of imports. It comes without saying that I had to start from the best-seller **“Hands-on Machine Learning with Scikit-Learn, Keras and TensorFlow”**. This book was what I was expecting and more. From time to time, when I’m working on personal projects, I still flick through it. This book also allowed me to develop many more personal projects (most of them public in [my GitHub](https://github.com/DidierRLopes), as I’m a big Open-Source fan — you should know that as I made [Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal) repository public). ![image](/blog/2021-11-07-the-start-of-my-machine-learning-journey/2021-11-07-the-start-of-my-machine-learning-journey_2.webp) The project that has been my biggest challenge was working with a friend on his PhD thesis entitled _“Modelling and Forecasting of Time-Series: A data science approach that compares classic methodologies with deep learning methodologies”_. Not only interpreting and discussing results but writing the code behind it. S/O to the resources: **“Forecasting: Principles and Practice”** and **“https://machinelearningmastery.com”**. Without these, this work would have been much harder. Throughout my short journey, I followed many people related with DS. People that I thought that in some shape or form added value through their posts. One of these, was Andriy Burkov. I remember when he started talking about creating the **“The Hundred-Page Machine Learning Book”** and specifically, I remember his Linkedin's poll to select the colour of one of the bubbles for his books' cover. I voted purple; the result was yellow. So, I took the freedom to fix the cover of his book, as you can see below. ![image](/blog/2021-11-07-the-start-of-my-machine-learning-journey/2021-11-07-the-start-of-my-machine-learning-journey_3.webp) My gecko Reidid on “The Hundred-Page Machine Learning Book”​, in order to keep industry standards of ML books with reptiles. I really enjoyed his book since it can explain everything, while keeping it simple and short. As I learned at University, _Keep It Simple, Stupid_. Also, his book is distributed in a “read first, buy later” principle. This meant that I was able to flick through the content of the book before buying it. Personally, I think this should be adopted more often, at least for technical books. Finally, last summer, while on holiday in Portugal, I read **“Approaching (almost) any machine learning”**, which I found to be great for people that have read about the theory but were wondering where/how to apply it. The next ML books in my list are: - **Deep Learning** — Aaron Courville, Ian Goodfellow, and Yoshua Bengio - **The Elements of Statistical Learning** — Jerome H. Friedman, Robert Tibshirani e Trevor Hastie - **Pattern Recognition and Machine Learning** — Christopher Bishop - **Understanding Machine Learning: From Theory to Algorithms** — Shai Ben-David and Shai Shalev-Shwartz Let me know if you think these are good books, or if there are others that you’d recommend. --- --- slug: handing-your-twitter-account-to-your-most-avid-community-member title: Handing your twitter account to your most avid community member date: 2021-11-17 image: /blog/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member.webp tags: - community-building - twitter - open-source - gamestonk-terminal description: Handing over the Twitter account of Gamestonk Terminal to an active community member and the impact it had on the project's growth and engagement. ---


Handing over the Twitter account of Gamestonk Terminal to an active community member and the impact it had on the project's growth and engagement.
When I started [Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal) I had no idea of the reach and impact it would have. From getting **over 3.5k stars on GitHub on the first single day alone**, to trending [on Reddit](https://www.reddit.com/r/algotrading/comments/lrndzi/cant_afford_the_bloomberg_terminal_no_worries_i/) and receiving overwhelming feedback, to receiving a message from an ex-colleague based in Switzerland about my name being [top 1 on Hackernews](https://news.ycombinator.com/item?id=26258773). As if this wasn’t enough, a couple of days later the project got featured by [VICE Magazine](https://www.vice.com/en/article/qjp9vp/gamestonk-terminal-is-a-diy-meme-stock-version-of-bloomberg-terminal) and [Daily Fintech](https://dailyfintech.com/2021/02/25/never-underestimate-bloomberg-but-here-are-5-reasons-why-the-gamestonk-terminal-is-a-contender/). As a result, my social life was impacted and had little time to even cuddle my puppy, due to the amount of feature requests, issues… the usual somehow ungrateful life of an open-source maintainer… I’m not complaining though, as I live for this. ![image](/blog/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member_1.webp) Moving forward a couple of weeks, it became clear to myself that I was building a strong community around what can/will/should be a leading product in the emerging fintech industry and Internet 3.0. Therefore, I knew that github issues and discussions wouldn’t be enough to interact with all members of the community, so Discord turned out to be the best option going forward (let’s be honest: mostly because of the convenience that Discord offers to share memes, feel free to check my creations on [our Discord](https://discord.gg/2KnVnkDTxM), you can thank me later). My next rookie mistake was thinking I could use Discord announcements and @ everyone, as a means for updating the community on new features. Being the #1 investment research free and open-source project on github gets you several PRs a day being merged, so in all the fairness the announcements were recurrent with constant several new features. You can check my [one hour live programming stream](https://www.youtube.com/watch?v=9BMI9cleTTg) of adding a feature to the terminal. ![image](/blog/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member_2.webp) This is when I realized that Discord wasn’t the best place for this type of communication. I needed a platform where I could share these features ad-hoc and that only alerted users who wanted to be up-to-date with our latest features. And this is when I created our [Twitter account](https://twitter.com/gamestonkt), @gamestonkt. Reviewing the history of our Twitter feed, you can see that this is exclusively what our handle was used for. It just shared new features every day. It felt like I was always playing catchup to the growing number of features piling up in the queue waiting to be announced on Twitter. With the project already having **over 500 features** in less 1 year, this inevitable outcome would be a surprise to no one. (**yup, I repeat, over 500**). ![image](/blog/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member_3.webp) However, I felt like **it missed personality**... With time being a limiting factor — time was more efficiently used improving the terminal — the public facing demonstrations were a lower priority. When you believe this much in a product, the product ends up speaking for itself. > _“If you build it, they will come” — Field of Dreams_
It then occurred to me, why am I handling our Twitter? Why not leave this up to one of our most avid and vocal users that has been with project since beginning? As Jim from “The Office” would do, let’s do a PROS & CONS table. ### Pros - The user represents the community that the twitter content is targeted at. - The user is an active daily user and will help to demonstrate features in the terminal. - The user is keen on learning the ins and outs of the product. - This user is not only a user anymore but a friend given his interaction with the maintainers. - Lastly, I get to spend time doing what I enjoy: coding and meme content on our Discord. ### Cons - The user finds out my mother’s maiden name and the name of my first pet. This is really a no brainer the more you think about it. I think it depends a lot on the type of people you have in your community and how confident you are on this individual . We were lucky, because we had the **perfect fit**: an active Discord user **@Danglewood**, who had built an engaged audience, generating over 130K+ in Reddit karma over Q2 2021. It was clear that **@Danglewood** was having an impact on driving traffic and user engagement by posting data and his personal research with screenshots of Gamestonk Terminal. In the future, **our report feature will allow easy sharing of this information**, I already can’t wait for this. Through a combination of humour and truths, he was engaging the audience’s curiosity by providing them with ways to filter out the ever-present noise within stock market information. It made sense to bring this approach to [our Twitter](https://twitter.com/gamestonkt) feed which has since transformed and now offers insights, educational nuggets, and data as well as presenting new features. The end result speaks for itself! ![image](/blog/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member/2021-11-17-handing-your-twitter-account-to-your-most-avid-community-member_4.webp) On your end, what is your opinion? And why do you 100% agree that this was the best decision? --- --- slug: sector-and-industry-analysis-gamestonk-terminal title: Sector and Industry Analysis — Gamestonk Terminal date: 2021-12-02 image: /blog/2021-12-02-sector-and-industry-analysis-gamestonk-terminal/2021-12-02-sector-and-industry-analysis-gamestonk-terminal.webp tags: - gamestonk-terminal - sector-analysis - industry-analysis - financedatabase - open-source description: The development journey of a new Sector and Industry Analysis feature for Gamestonk Terminal, integrating the FinanceDatabase package. ---


The development journey of a new Sector and Industry Analysis feature for Gamestonk Terminal, integrating the FinanceDatabase package. The open source code is available [here](https://github.com/DidierRLopes/GamestonkTerminal).
The end-to-end story of developing a new **Sector and Industry Analysis** for [Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal) from scratch. On the 13th of October, [Jeroen Bouma](https://github.com/JerBouma) (a ALM advisor and python enthusiast) reached out in order to integrate his [FinanceDatabase package](https://github.com/JerBouma/FinanceDatabase) into [Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal). ![image](/blog/2021-12-02-sector-and-industry-analysis-gamestonk-terminal/2021-12-02-sector-and-industry-analysis-gamestonk-terminal_1.webp) After having a call with Jeroen to bounce ideas, it was clear that our terminal needed such capability to be even more powerful (as if **over 500 features** already and counting didn’t already do the trick eheh). However, at the time I was too busy to work on the concept so I asked Jeroen if he could sketch something up on a jupyter notebook. Within the following week, Jeroen sent a Jupyter notebook explaining the FinanceDatabase module and what we could have in a Sector and Industry analysis. ![image](/blog/2021-12-02-sector-and-industry-analysis-gamestonk-terminal/2021-12-02-sector-and-industry-analysis-gamestonk-terminal_2.webp) In addition, he also mentioned his [PassiveInvestor package](https://github.com/JerBouma/ThePassiveInvestor), and ended up [implementing it on his own in Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal/pull/857)! This was a great addition, as it strengthened our **ETF context** and provided a slick Excel report for the Excel fans out there! See his [LinkedIn post](https://www.linkedin.com/feed/update/urn:li:activity:6859887432532291584/) on the experience. ![image](/blog/2021-12-02-sector-and-industry-analysis-gamestonk-terminal/2021-12-02-sector-and-industry-analysis-gamestonk-terminal_3.webp) ... Forward to last weekend (1.5 months later), I had a free Sunday afternoon so started working on the development of this menu. I started by thinking about what would make this menu more flexible and powerful. ![image](/blog/2021-12-02-sector-and-industry-analysis-gamestonk-terminal/2021-12-02-sector-and-industry-analysis-gamestonk-terminal_4.webp) These were my thoughts about what it needs: - **Several filtering parameters** as the number of companies in the database is pretty huge with 155.705 tickers, 16 sectors, 242 industries, 111 countries and 82 exchanges. These were the filters selected: Country, Sector, Industry, Market Cap and Flag to include/exclude international exchanges. - **To be able to do some statistics on the sector**, industries and countries (e.g. companies per sector/industry with a specified country and market cap) which allows users to better understand companies landscape of a sector and industry. - **To get the financials of the companies that fall under that filter subset** (e.g. return on assets, quick ratio, debt to equity), and then compare these in order to get the best performers. - Since one of the previous financials isn’t enough to understand which company would be best to invest in, I wanted the filtered companies to have the capability to jump onto the comparison analysis menu so you could get all the capabilities of comparing historical price data, volume data, income/balance/cash flow, sentiment, or even technical indicators. - If in the stocks context I had Tesla loaded, I wanted to go into this sia menu and get all the filtering parameters to be ready to filter for companies similar to Tesla in terms of (Sector, Industry, Country and Market Cap). By Sunday night, I created the [pull request for this](https://github.com/GamestonkTerminal/GamestonkTerminal/pull/995). Due to the due diligent reviews performed by the main contributors of the project, the menu got a lot of improvements. Some of them were: - Do not display companies that account for under a certain threshold (1%) and therefore sum them in an “Others” slice. - Allow to export all the data as a table. - After filtering and getting financials, save the data for faster data retrieval if the same filters are used. - Minor bug fixes. After a lot of comments and feedback from the main maintainers, and everyone being happy with this first iteration, the PR got merged. In fact, one of the main maintainers found a hidden gem while testing it. ![image](/blog/2021-12-02-sector-and-industry-analysis-gamestonk-terminal/2021-12-02-sector-and-industry-analysis-gamestonk-terminal_5.webp) In the meantime, I’ve been in contact with Jeroen about adding some more capabilities to his FinanceDatabase package so that everyone could benefit from them. Some examples are: - When an industry is selected, the corresponding sector should be automatically filled. - If I select a country and a market cap for filtering, my sector choices should be bounded by what exists within those. - I should be able to query about companies landscape in terms of a country. E.g. I want to understand what countries have the most large cap companies within the Financial Services sector. This would not only make the FinanceDatabase a more powerful Package, which would in turn benefit Gamestonk Terminal sia menu, and ultimately our thousands of users! ![image](/blog/2021-12-02-sector-and-industry-analysis-gamestonk-terminal/2021-12-02-sector-and-industry-analysis-gamestonk-terminal_6.webp) This is an example of how the Sector and Industry Analysis menu looks (as a bonus I show how you can go into the Comparison Analysis menu): ![image](/blog/2021-12-02-sector-and-industry-analysis-gamestonk-terminal/2021-12-02-sector-and-industry-analysis-gamestonk-terminal_7.webp) Next time you know, it all starts with an e-mail. At Gamestonk Terminal we are on a role to have the best investment research terminal, and hope this story reflects it. Try it now, it’s free. ❤️ --- --- slug: gamestonk-terminal-ux-features title: UX/UI is better than features date: 2022-01-06 image: /blog/2022-01-06-gamestonk-terminal-ux-features/2022-01-06-gamestonk-terminal-ux-features.webp tags: - gamestonk-terminal - ux/ui - software-development - teamwork description: Gamestonk Terminal's UX/UI features and the teamwork behind their implementation. ---


Gamestonk Terminal's UX/UI features and the teamwork behind their implementation. The open source code is available [here](https://github.com/DidierRLopes/GamestonkTerminal).
**Features attract users, UX/UI conquers them ⚔️** Throughout month of December, me and 3 of the most active maintainers of [Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal) had a meeting where we discussed shifting our focus from adding features, to improving the terminal UX/UI to make it even more attractive. The main outcomes of these meeting were: 1. Relative and Absolute menu jumping, e.g. if i’m in crypto/ta and want to go to stocks/ta I can do: a. Absolute: `/stocks/load tsla/ta` b. Relative: `../../stocks/load tsla/ta` 3. Scripting feature. You can now interact with the terminal through a sequence of commands, e.g.: `stocks/disc/ugs -l 3/gtech/active`. 4. `reset` command everywhere to allow for faster development as it exits from the terminal and comes to the same menu running new terminal code and its API keys. 5. Auto-completion in commands with choices. 6. When misspelling a command name, if it’s similar enough that the terminal recognises the right command, it will replace it, to speed up interaction.
![image](/blog/2022-01-06-gamestonk-terminal-ux-features/2022-01-06-gamestonk-terminal-ux-features_1.webp) 6. Running a `.gst` job, like `python terminal.py scripts/test_stocks_disc.gst` which allows to run a sequence of commands of the terminal. In the future we can take advantage of this for integration tests. The user can build their own daily routines to speed up the investment process.
![image](/blog/2022-01-06-gamestonk-terminal-ux-features/2022-01-06-gamestonk-terminal-ux-features_2.webp) Now, I know what you’re thinking. This is a massive improvement over the terminal usage up until now, and that’s a **LOT** of code changes. Which is very much true, to be specific, this engineering effort resulted in: > **370 files changed with 44,875 additions and 18,463 deletions**
And you may be wondering how long did this take us to do. Nope, it wasn’t months but… ![image](/blog/2022-01-06-gamestonk-terminal-ux-features/2022-01-06-gamestonk-terminal-ux-features_3.webp) **1 week. Yup, a single f*king week.** You can see that it was finalised with these PRs ([#1049](https://github.com/GamestonkTerminal/GamestonkTerminal/pull/1049), [#1041](https://github.com/GamestonkTerminal/GamestonkTerminal/pull/1041), [#1048](https://medium.com/@dro-lopes/gamestonk-terminal-ux-features-f9754b484919#1048)). In that week we split work, did pair programming, we called each other to discuss better implementation practices, we changed the architecture 2/3 more times… On top of that, I was feeling overwhelmed with the stocks menu, I clearly underestimated how many features we have (how naive…), so the 3 other maintainers jumped on it and helped me out. In 3 or so years of software engineering, this was** teamwork like I’ve not felt before**. That weekend I was so happy as we accomplished this task that I think I didn’t even work on the terminal that Sunday! Doesn’t happen often these days! However, as a good friend of mine told me: > _**“The entertainment industry hasn’t found yet something more appealing than developing code towards a product I believe in and with people I like”**_
I still think about this often, and this is what I tell my girlfriend, to explain why I’m coding and not playing Mario Kart 8 Deluxe with her. (the fact she always beats me at it also may be considered as a factor 🤣). You may be thinking this is a one off, the reality is that **it isn’t**. Another example can be seen in [this blog post](https://dev.to/northern64bit/aspiring-16-year-old-quant-developer-contributing-to-open-source-application-16k4). This goes over the story of the development of our discord bot where it all started from a message from a **16yo contributor that wants to become a quant**. He wanted to not only improve his python skills with us but also bring the terminal features to a bigger audience. Working with us in an open-source project is helping him towards achieving his life-goal dream. While I write this post another contributor, finishing his CPA, is working on [improving the code resulting from that UX effort by creating a base class](https://github.com/OpenBB-finance/OpenBBTerminal/pull/1141) so that new developers can add controllers much easily (he estimates a reduction of 11% of codebase size based on “napkin maths” as he puts it). ![image](/blog/2022-01-06-gamestonk-terminal-ux-features/2022-01-06-gamestonk-terminal-ux-features_4.webp) While user experience is critical, so is user interface. And that is why our next engineering effort will be around it. We already have something in the works in [this PR](https://github.com/GamestonkTerminal/GamestonkTerminal/pull/1140), where we can draw lines and write text! Almost like TradingView (almost… 😬). ![image](/blog/2022-01-06-gamestonk-terminal-ux-features/2022-01-06-gamestonk-terminal-ux-features_5.webp) So, keep on the lookout because 2022 is gonna be a big year for us!! 🦋 🚀 Ohh, before I say thanks for the read and all that, it’s also worth mentioning that there’s a PR in the queue for a new context called “**alternative data**”, which already has a **COVID menu** to factor that data into account on your investments. ![image](/blog/2022-01-06-gamestonk-terminal-ux-features/2022-01-06-gamestonk-terminal-ux-features_6.webp) _PS: The blue text is because we are transitioning towards [rich package](https://github.com/Textualize/rich) which gives a lot more freedom when it comes to improving our user interface._
Thanks for your read, and if you enjoy Gamestonk Terminal, please reach out to [our discord](https://discord.gg/ptYabd8w) to say thank you, or ideally: for **@terp340** to change date format to dd/MM/YYYY — **the only correct one**! Happy 2022 with lots of love ❤️ --- --- slug: meet-the-most-advanced-investment-research-platform title: Meet the most advanced investment research platform date: 2022-03-21 image: /blog/2022-03-21-meet-the-most-advanced-investment-research-platform/2022-03-21-meet-the-most-advanced-investment-research-platform.webp tags: - investment-research - gamestonk-terminal - automation - routines description: Meet the most advanced investment research platform. This blog post introduces Gamestonk Terminal, an advanced investment research platform, and discusses its features and automation capabilities. ---


Meet the most advanced investment research platform. This blog post introduces Gamestonk Terminal, an advanced investment research platform, and discusses its features and automation capabilities. The open source code is available [here](https://github.com/DidierRLopes/GamestonkTerminal).
Several people have asked me why [Gamestonk Terminal](https://github.com/GamestonkTerminal/GamestonkTerminal) doesn’t have release versions, and the main reason is because at the pace the team codes and the rate that new features / bug fixes appear it doesn’t yet makes sense to do so. To give you an example, recently I shared the first **DEMO of what the terminal can do**, and I mention about our “routines” automation concept.

From watching these videos it was clear that Michael is an expert in the field and was capable of understanding deep topics and not solely staying on the surface. So I was keen to have a chat with him. It turns out that he was a big supporter of OpenBB in particular due to our open-source approach to finance and the connection was immediate. Michael met a few of our team members, and a week later we had a signed contract. I couldn’t be more excited to welcome him to the team and see the amazing products we are going to build at OpenBB. Here’s what Michael has to say about joining OpenBB: > _"At OpenBB, I've discovered the perfect blend of my core passions: ML/AI, Opensource, and, more recently, quantitative finance. Joining the OpenBB team truly feels like a fairytale come true. I've never encountered a team so singularly-focused and driven. They genuinely "get it," and working alongside such talented individuals is incredibly inspiring. I'm ecstatic to be on board and am eager to help contribute to OpenBB's AI initiatives."_
If you are excited about the field of open source, AI, and finance, and want to help - you can reach out to Michael on [Twitter](https://twitter.com/MichaelNStruwig). --- --- slug: openbb-bot-our-new-addition-to-the-openbb-open-source-family title: OpenBB Bot - our new addition to the OpenBB open source family date: 2023-11-21 image: /blog/2023-11-21-openbb-bot-our-new-addition-to-the-openbb-open-source-family/2023-11-21-openbb-bot-our-new-addition-to-the-openbb-open-source-family.webp tags: - openbb - openbb-bot - open-source - discord - telegram - chatbots - monetization - business-strategy - product-story description: The OpenBB Bot architecture is now open source. Check out our Discord Bot architecture now on GitHub. ---


The OpenBB Bot is now open source. Check out our Discord Bot architecture now on GitHub. The open source code is available [here](https://github.com/OpenBB-finance/openbb-bot).
## What is the OpenBB Bot, and why did we build it? When the OpenBB Terminal first went viral, users were writing online that one of the things missing from our product was a chat feature like other investment platforms provide. However, we didn't understand why the chatting experience needed to be centralized in the application where users research their financial data. Plus, with the ever-growing userbase of apps like Discord, Telegram, Slack, and others, combined with their capabilities to build apps on top, we thought we could do more. We believe in a future where you can query financial data right from where you are. Meaning you can chat with colleagues, from any of the apps you're already using. This is when we partnered with OptionsFamBot (the biggest Discord financial bot that was present in 15k+ servers, reaching 1 M+ users) to build the OpenBB Bot. You can read more about our launch in August 2022 [here](https://openbb.co/blog/openbb-bot-launch). ## Failing to monetize. Failing to grow user base. To provide OpenBB Bot users with access to 100+ financial commands (including expensive datasets such as the options and dark pool ones) we had to pay not just the data vendors but also for the display rights. This was relatively expensive, but we considered it a marketing cost since we expected exponential user growth. We expected that since the Bot could be deployed in any server in a few seconds, more users would be exposed to the Bot, bringing the Bot to other servers, and so on... **However, that didn't happen.** In September 2022, Discord changed its command syntax to force commands to start with "/" and the user drop was noticeable.

In the meantime, with the end of the Covid-19 Pandemic, people started leaving their houses more and spending less time with communities investing online. Other companies with financial bots were experiencing the same: investors spending less time talking about investing on apps like Discord. We saw a trend that these same companies started increasing their prices to balance out the number of users. This is when we went in the other direction: we upgraded our free tier package and decreased the price of our paid version. That announcement can be found [here](https://openbb.co/blog/openbb-bot-price-change).

This happened at the same time as we added more innovative features to the bot. Features that OpenBB brought to market, while other bots copied from us today. We created a codebase that was robust and scalable, but still flexible so that it could be quickly tweaked and deployed on other chatting apps. A couple of days after the price reduction, we announced OpenBB Bot for Telegram (read more about this announcement [here](https://openbb.co/blog/openbb-bot-arrives-on-telegram)). With the growth of Telegram users and crypto communities, we were well posed to capture that market. Or so we thought. But our growth never achieved the numbers we had initially estimated.

Our conclusion is that the market for financial chatbots is much smaller than what we had originally forecasted. This also meant that our goal with the OpenBB Bot as a marketing tool wasn't returning the ROI that we were expecting. So in May 2023 we went pretty much all-in on considering the OpenBB Bot as a marketing expense, and removed the individual paid tier. You can see that announcement [here](https://openbb.co/blog/openbb-bot-free-for-individuals).

Note that we maintained the control of the Billboard message. This is a feature that allows us to add OpenBB events and announcements to the top of these commands, hence increasing awareness. See below how it looks,

However, even with that change and [adding an AI feature](https://openbb.co/blog/openbb-midjourney-for-investing) to the OpenBB Bot, the user base never grew past what we had hoped. So we decided to open source the architecture behind the OpenBB Bot. ## Decision to open source When talking with Roberto Talamas (check out his [OpenBB champion story](https://openbb.co/blog/openbb-champions-roberto-talamas)), he mentioned that he was building his own financial chatbot for his fund from scratch. That was the trigger we needed to open source our architecture, so the "Robertos" of the world wouldn't have to start building their chatbot from scratch, but could piggyback on our architecture, which just works (it has never been down since launch and processed over 2.75 M Discord requests). Since we failed to monetize the Bot, and our adoption trajectory never grew past our expectations, open-sourcing the architecture behind the OpenBB Bot made a ton of sense. This architecture utilizes data from the OpenBB platform (check out last week's [beta announcement](https://openbb.co/blog/celebrating-the-openbb-platform-v4-beta)) which means that developers can simultaneously get familiar with our platform while seeing how easy it is to pull financial data from OpenBB - effectively growing OpenBB's ecosystem.

I'm looking forward to seeing what products are built around the OpenBB Bot in the future. You can check the repository [here](https://github.com/OpenBB-finance/openbb-bot). Welcome to the OpenBB open source family. --- --- slug: goodbye-openbb-sdk-hello-openbb-platform title: Goodbye OpenBB SDK. Hello OpenBB Platform date: 2023-11-29 image: /blog/2023-11-29-goodbye-openbb-sdk-hello-openbb-platform/2023-11-29-goodbye-openbb-sdk-hello-openbb-platform.webp tags: - openbb - platform - sdk - core - extensions description: Today, we are thrilled to announce the new OpenBB SDK, a game-changing platform that is now divided into the robustness of OpenBB Core and the limitless potential of OpenBB extensions. ---


Today, we are thrilled to announce the new OpenBB SDK, a game-changing platform that is now divided into the robustness of OpenBB Core and the limitless potential of OpenBB extensions. The open source code is available [here](https://github.com/OpenBB-finance/OpenBBTerminal).
In the ever-evolving landscape of financial data integration and standardization, OpenBB has been revolutionizing the way individuals and organizations handle data from multiple data providers by utilizing our open-source products. We have been talking about the OpenBB Platform v4 over the past few months. This is such a milestone for our team and for the financial world that we are renaming the OpenBB SDK into the OpenBB Platform. The OpenBB Platform consists of the OpenBB Core and OpenBB Extensions. Let’s dive into each of these, individually. ## OpenBB Core The OpenBB Core empowers quants and finance developers to create powerful data solutions, offering unparalleled simplicity, flexibility, and scalability. It follows the principle that "less is more." The core will consist of two main components: 1. **Data Standardization Infrastructure:** This ensures that regardless of the type of data processed by the core, users can expect consistent conventions and naming. This facilitates a seamless experience, even when the data comes from completely different data providers. 2. **Data Source Integration:** Developers will be able to effortlessly connect and integrate various data sources, including databases, APIs, and cloud storage systems. a) **Official partner integrations** will be available by having access to official endpoints from data vendors. This ensures the integrity of the data and provides a reference for what data is available to the end user. Our affiliate program will detail where commercial agreements are in place with OpenBB. b) Additionally, **community provider integrations** will be available, allowing the community to contribute their own integrations for specific use cases or share them with others through the open-source codebase. ## OpenBB Extensions OpenBB extensions enhance the capabilities of the OpenBB Core, allowing developers to create custom functionalities and customize the overall Platform according to their specific needs. It is important to note that these extensions can be used as a standalone or integrated with the rest of the openBB ecosystem. These extensions can be classified into two categories:
  • Official extensions developed and maintained by the OpenBB Team, such as the ML/AI Toolkit, Econometrics, and Reports;
  • Community extensions developed by the open-source community. These extensions focus on enabling intelligent data processing and custom workflows that assist users in their investing decision-making process.
## Key advantage of new platform V4 By combining the strengths of OpenBB Core and OpenBB Extensions, the OpenBB Platform offers unparalleled advantages for developers and organizations:
  1. Enhanced Flexibility: The modular architecture of the Platform allows developers to choose and integrate only the components they need, avoiding unnecessary complexity.
  2. Scalability: The OpenBB Platform seamlessly scales with your data integration requirements, ensuring smooth performance even with large volumes of data.
  3. Extensibility: Developers can create their own extensions and contribute to the OpenBB ecosystem, fostering collaboration and innovation.
  4. Time and Cost Savings: With its intuitive interface and pre-built components, the OpenBB Platform accelerates development cycles, reducing time-to-market and costs associated with custom solutions.

The reimagined OpenBB SDK into OpenBB Platform (OpenBB Core and OpenBB Extensions), revolutionizes the data integration landscape. By leveraging the power of OpenBB Core for data integration and standardization, and harnessing the capabilities of OpenBB Extensions for customization and advanced functionality, developers can unlock new possibilities and build cutting-edge data solutions. Whether you are working with diverse data sources or performing complex data transformations, the OpenBB Platform empowers you to conquer any data challenge and propel your organization towards data-driven success. We invite users and enthusiasts to explore the OpenBB Platform v4, now available for download and installation from the [OpenBB Hub](https://docs.openbb.co/platform/installation), [Github](https://github.com/OpenBB-finance/OpenBBTerminal/tree/develop/openbb_platform), and [PyPI](https://pypi.org/project/openbb/). ## Inside OpenBB: A peek into our team emails In order to adhere to one of OpenBB's core values - Transparency - we want you to understand the journey we have undergone and the reason we have dedicated the past 9 months to this endeavor. So, for the first time, we're sharing a confidential email thread that circulated among our entire team. This thread provides insight into our thought process when it comes to handling large projects at OpenBB.

Over the next few weeks we will keep iterating on our Platform, based on user feedback, so we can keep pushing for a platform that can be adopted by everyone - from professional investors, data scientists, quants, to students. If you rely on financial data to do financial research or build apps, we want to hear from you! Reach out with feedback to support@openbb.finance or join [our Discord](https://discord.com/invite/xPHTuHCmuV). --- --- slug: the-new-finai-tech-stack title: The new FinAI Tech Stack date: 2023-12-15 image: /blog/2023-12-15-the-new-finai-tech-stack/2023-12-15-the-new-finai-tech-stack.webp tags: - openbb - finance - ai - agents - langchain - llamaindex - mindsdb - nixtla description: This blog post delves into how our collaboration with MindsDB, Nixtla, LlamaIndex, and Langchain is revolutionizing the financial world. Read on to learn all about the event "The New FinAI Tech Stack" held last week in SF, California. ---


This blog post delves into how our collaboration with MindsDB, Nixtla, LlamaIndex, and Langchain is revolutionizing the financial world. Read on to learn all about the event "The New FinAI Tech Stack" held last week in SF, California.
## Context In early September, I attended a “Future of Finance” event in NYC. Despite the presence of well-known financial professionals from top firms in the industry, I found the event lacked practical applications demonstrating how AI is impacting the financial sector. Once I was back in the Bay Area, I had a barbecue with Jorge and Max from MindsDB and Nixtla, and I was commenting on that experience. To which Jorge promptly replied - why don’t we do it ourselves? So following this discussion, we decided to put the AI in finance event in motion.

At OpenBB, AI has become a key component in our approach to refactoring the OpenBB Platform from the ground up. We've recently recruited a Head of AI to help us build our strategy and work on this effort full-time. You can find more details on this [here](/blog/revolutionizing-ai-at-openbb-with-new-leader-michael-struwig).

## OpenBB x MindsDB A few days later, I visited the MindsDB office to discuss collaborating with Jorge on potential partnerships. I suggested the idea of gaining access to MindsDB's data, a proposal that seemed feasible to implement. Eventually, we accomplished this, and I even showcased it during the event last week. The code for this endeavour is open source. Take a look [here](https://github.com/OpenBB-finance/backend-for-terminal-pro/tree/main/mindsdb_python). However, Jorge had an even bigger idea. He proposed the concept of granting MindsDB users access to OpenBB data via SQL and harnessing MindsDB's capabilities for machine learning. Essentially, we could convert the data frame in runtime into a virtual SQL table, since we have access to the Pydantic model from the OpenBB platform, and we can build that on the go. After [tweeting about this](https://twitter.com/didier_lopes/status/1710560436398264756?s=20), I received numerous messages, which validated that there was interest in OBB SQL. So, we set off to work on this. Together with the OpenBB team, we made it easy to access all available inputs/outputs for each endpoint, while the MindsDB team worked on virtualizing the tables. The result can be seen [here](https://github.com/mindsdb/mindsdb/tree/staging/mindsdb/integrations/handlers/openbb_handler). At the event last week, Jorge shared this work. Additionally, in collaboration with LangChain, he successfully developed a Slack bot with direct access to this data, all accessible within Slack ## OpenBB x Nixtla Back in August, Nixtla introduced the initial foundation generative AI model for temporal data at MindsDB. At that time, we received an invitation to showcase the practical applications of TimeGPT in production, and for the first time, we unveiled Terminal Pro briefly. I detailed this experience in a [blog post](https://openbb.co/blog/openbb-incorporates-the-first-generative-AI-model-for-temporal-data-timegpt) and shared a similar demo during the event last week. Following that, Max and Azul from Nixtla proceeded to share a presentation where they used OpenBB data to assess price targets from analysts and develop an approach on how it is possible to reduce the bias inherent to price estimates and produce better estimates. ## OpenBB x LlamaIndex Back in July, we initiated the development of AskOBB, enabling users to interact with the open source [OpenBB Terminal](https://github.com/OpenBB-finance/OpenBBTerminal) using natural language. In this effort, we leveraged LlamaIndex and you can see more about it [here](https://openbb.co/blog/breaking-barriers-with-openbb-and-llamaIndex). So when we started discussing an AI in Finance event, it only made sense to reach out to Jerry and Simon to invite their team to present at the event. And so we did. Jerry ended up presenting their [open source SEC insights repo](https://github.com/run-llama/sec-insights) that uses the Retrieval Augmented Generation (RAG) capabilities of LlamaIndex to answer questions about SEC 10-K & 10-Q documents. As for the OpenBB Terminal Pro, we demonstrated how we are using LlamaIndex to chat with documents that are uploaded to the OpenBB Terminal Pro. The video below highlights these features. ## OpenBB x Langchain After attending the AI Engineering Summit event, specifically Harrison’s workshop on how to get started with agents using Langchain, I felt inspired to create an agent on top of the OpenBB platform. So that very day, I went home and started to work on [this repo](https://github.com/DidierRLopes/openbb-agents). By the end of the day, the agent was already able to perform complex queries. Over time I iterated on it to make the agent more robust, but the improvement on the architecture started to happen after Michael joined OpenBB and he was able to focus on this full-time - the progress can be found on [this open source repo](https://github.com/OpenBB-finance/openbb-agents). An example of a prompt that the agent can answer is: > _Check what are TSLA peers. From those, check which one has the highest market cap. Then, on the ticker that has the highest market cap get the most recent price target estimate from an analyst, and tell me who it was and on what date the estimate was made._
So at the event, Harrison presented this architecture which heavily relies on Langchain and OpenBB tools.

Later on, I demonstrated how we can integrate this architecture into OpenBB Copilot and make it available from the OpenBB Terminal Pro. ## Wrap up Finally, this was an amazing event organized by MindsDB and a team that put together 5 of the most prominent open-source companies working on problems at the intersection of AI and Finance. You can rewatch the entire event here: