I tried coding a LLM Crypto Trading Bot (to retire early $$$)

Nicholas Renotte
28 Apr 202520:30

Summary

TLDRThis video explores the development of a sentiment analysis-based trading strategy using the Finnbert model. Initially focused on shorting and trading based on positive sentiment, the approach evolved into a long-only model, with improvements in profit-taking and stop-loss strategies. The speaker then tested a contrarian approach, buying on negative sentiment, and achieved significant gains by becoming more aggressive with larger position sizes. The video demonstrates how adjusting strategy parameters can optimize returns, and the associated code and resources are shared for further exploration.

Takeaways

  • πŸ˜€ Focus on long-only positions: The strategy transitioned from including short positions to focusing solely on long positions based on sentiment analysis.
  • πŸ˜€ Removal of shorting logic: All shorting-related conditions were eliminated to focus on trading in positive sentiment scenarios only.
  • πŸ˜€ Position sizing adjustments: The strategy recalculated position sizes, especially after removing shorting, to optimize risk management.
  • πŸ˜€ Take Profit and Stop Loss settings: A take-profit target of 1.5% above the purchase price and a stop loss of 70% were implemented to manage risk.
  • πŸ˜€ Testing contrarian strategy: The trader tested a contrarian approach, where they bought during negative sentiment in the market, assuming low prices would increase.
  • πŸ˜€ More aggressive strategy: The trader reduced the probability threshold for buying signals and allocated 50% of their portfolio to trades, increasing both frequency and trade size.
  • πŸ˜€ Positive outcome from aggression: The more aggressive strategy led to a significant return of 20.04% for the period, with a total return of 32%.
  • πŸ˜€ Real-time testing: The video demonstrated real-time adjustments to the trading logic, providing immediate feedback on strategy effectiveness.
  • πŸ˜€ Fine-tuning strategy: The trader continued to refine the strategy by modifying key parameters (e.g., probability and risk exposure) to optimize performance.
  • πŸ˜€ Code and resources shared: The code used for the strategy, including trading logs, helper functions, and the sentiment analysis system (Finnbert utils), will be available on GitHub for others to use and learn from.

Q & A

  • What is the primary strategy being tested in this script?

    -The primary strategy being tested is a sentiment-based trading strategy where trades are initiated based on positive or negative sentiment, which is identified by an analysis of financial news or other data sources.

  • How did the author initially approach the trading algorithm before modifying it?

    -Initially, the author used a strategy that involved both long and short positions based on sentiment analysis. The algorithm would trigger trades when either positive or negative sentiment was detected.

  • What changes did the author make to the trading algorithm?

    -The author decided to focus solely on long positions, eliminating short positions, and adjusted the position sizing to reflect this new approach. Additionally, they set a take-profit and stop-loss percentage to control risk.

  • What were the initial results after the first round of modifications?

    -After modifying the algorithm to only focus on long positions, the results showed a reduction in losses, with an annual return of approximately -6.5%. However, profits were not yet being made.

  • What was the author’s idea for improving the strategy further?

    -The author considered a contrarian approach, where instead of buying when sentiment was positive, they would buy when sentiment was negative, believing that prices might be lower and the market could rebound.

  • How did the contrarian approach affect the trading results?

    -Switching to a contrarian strategy led to the first profitable return, with an 8.85% return and a total return of 14%, suggesting the strategy had potential when applied to negative sentiment signals.

  • What were the next steps after observing the success of the contrarian strategy?

    -The author decided to become more aggressive with the strategy by lowering the probability threshold for signals and increasing the risk allocation to 50% of the portfolio, aiming for larger trade sizes and more frequent trade signals.

  • What were the results of the more aggressive approach?

    -The more aggressive approach, with a 50% risk allocation and a lower probability threshold, led to a significantly better performance, with a 20.04% return and a total return of 32%.

  • Why did the author adjust the probability threshold and risk allocation?

    -The author adjusted the probability threshold to increase the number of trade signals and risked more capital (50% of the portfolio) to increase trade sizes, expecting greater returns from more aggressive trades.

  • What is the significance of the GitHub repository mentioned at the end of the video?

    -The GitHub repository will provide access to all the code used in the project, including trading logs, helper functions, and the sentiment analysis scripts, allowing others to replicate or further develop the trading strategy.

Outlines

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Mindmap

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Keywords

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Highlights

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Transcripts

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now
Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Trading StrategyContrarian ApproachSentiment AnalysisFinancial MarketProfit StrategyRisk ManagementStock TradingInvestment StrategyAggressive TradingPortfolio ManagementAlgorithmic Trading