YouMind
Iniciar sessão

How to Build an AI Trading Bot to WIN the Crypto Bull Run (beginner-friendly)

204K
403
40
16
1.1K

TL;DR

A comprehensive guide on building a personalized AI trading bot for cryptocurrency markets using Claude and Model Context Protocol (MCP), covering setup, strategy selection, and memory systems.

The crypto bull run is finally here, and the traders who leverage AI to capitalise are about to make a sh*t ton of cash.

In this article, I'm going to give you the exact roadmap to build your first AI trading bot from scratch, with exact prompts included.

In ~20 minutes, you'll have a done-for-you trading execution system that you can deploy directly into your own Claude agents.

Table of Contents

I: What You Need Before You Start (pre-reqs)

II: Building Your Context Brain

III: Setting Up the Execution Layer

IV: Choosing a Strategy

V: Building a Trade Ledger (memory system)

VI: Telegram Setup

I: What You Need Before You Start (pre-reqs)

Before we dive into the actual build, there are a few basic prerequisites that your AI trading bot will need.

Ensure you have:

  1. A Claude or ChatGPT subscription

This is the only real cost here. Claude is what I'll be using throughout this article since I'm a Claude power user, but if you're on ChatGPT, the exact same prompt I'll show here also works in Codex.

  1. Node installed on your machine

The setup prompt at the end of this article walks you through installing this automatically, so don't worry about doing it manually.

  1. An exchange account on a platform with a native MCP

I personally use Bybit, but some other options include: Bitget, Gate & OKX.

I actually recommend opening a completely separate exchange account just so your funds are sandboxed and your entire portfolio is not at risk due to an AI error.

Understanding the architecture of this build

→ Claude is the brain - your strategy partner, and the layer sending instructions out.

→ The MCP is the bridge - the connection between Claude and the exchange.

→ The exchange itself is the execution - it physically places the orders and sends data back through the MCP to Claude.

Miles Deutscher - inline image

*architecture

You may be wondering: "Miles, why don't I just use the built-in Grid Bots on my exchange?"

The reason is simple: With this setup I'm about to show you, you have complete control and customisability over your bot and strategy.

You can inject custom Pine Scripts, run your own strategy based on backtested data, and you're overall not locked into one specific trading style like the pre-built bots on exchanges are.

II: Building Your Context Brain

This is arguably the most important part of your trading bot build.

You need to spend a little bit of time setting up an AI second brain.

The simplest version of this is just having a folder on your computer that contains:

  • Your trading rules (entry/exit/TP/SL)
  • Your strategy
  • Personal context
  • High-level financial strategy

Also include any other important context that you think Claude needs to know as your personal trading assistant.

Miles Deutscher - inline image

Tip: If you're setting this up for the first time, I recommend opening Claude and taking ~10 minutes to do a deep voice prompting session.

You can paste this prompt so Claude can interview you and gather all the context it needs to create your desktop folder:

text
1I want to build an AI trading bot by connecting my crypto exchange (MCP) to you (Claude).
2
3Before I do that, I want to build an AI second-brain memory folder on my desktop.
4
5I want you to interview me and come up with 30 questions about my strategy, entries, exits, and financial goals to gain full context.

My preference is to create this as a .MD (markdown) file and make small tweaks over time with TextEdit (on Mac).

Building a proper memory system is something you might have to spend ~30 minutes to set up once, but trust me, it's 100% worth it if you actually want to build a profitable bot.

III: Setting Up the Execution Layer (MCP)

Depending on your exchange, the setup steps here may slightly vary.

But in general, it will be a four-step process:

  1. Log into your exchange
Miles Deutscher - inline image
  1. Connect MCP to Claude

Sample prompt:

text
1I want to connect [insert exchange] MCP so we can automate my trading.
Miles Deutscher - inline image

*example with Bybit

To make sure everything is connected properly, make sure to restart Claude so the MCP fully loads.

At this stage, you want to create a "subaccount" in your exchange, and if this is your first time trading via AI, I recommend starting with paper trading first if your exchange allows for it.

  1. Create API Key

Next, you'll want to set up an API key so your AI has full access to your account and can actually read and take action on your behalf.

Miles Deutscher - inline image

On Bybit in particular follow these steps:

API management → System generated API → Add name → Enable Read-Write

Miles Deutscher - inline image

Security practices:

  • Store this key somewhere safe (ideally offline)
  • Never share this key with anybody
  • Turn on 2FA within your exchange account
  1. Connect API to Claude

Lastly, you want to go ahead and give Claude your newly-generated API key.

Again, once connected, go ahead and restart Claude.

After completing the above four steps, you'll want to place a sample order via Claude just to make sure everything is being received on the exchange's side.

Miles Deutscher - inline image

IV: Choosing a Strategy

At this stage, technically speaking, your bot is complete and you can trade via your Claude chat/project right now.

But, for those of you who want to build a bot that actually makes money, it's going to be important to pick a viable strategy.

You have a few options here, and the option you end up picking will depend on what you want to do and your prior experience.

  1. Turn your personal strategy into Pine Script

If you're already a trader with a profitable strategy, you have the option of turning your strategy into Pine Script so your AI can ingest it and follow it.

Full article on this below:

https://x.com/milesdeutscher/status/2082095561176703135

  1. Choose pre-existing strategies from the internet

There are tons of profitable strategies on GitHub, TradingView, Reddit, and even here on 𝕏.

A quick search on these platforms can pull up popular/well-vetted trading strategies that you can plug into Claude.

  1. Discretionary trading

Lastly, it's completely okay to just use this set up to automate bits and pieces of your existing manual trading workflow.

For example: You can use this bot to take profits for you, instead of manually managing your positions.

Or, let's say you're on-the-go and want to place a trade. You can quickly voice-prompt your bot instead of doing it yourself.

You don't need to automate 100% of your trading and using your bot for small trade management tasks like this is still extremely helpful and worth setting up.

V: Building a Trade Ledger (memory system)

Once your bot is taking trades, you should build a trading ledger so you can see all the data and make tweaks if needed.

You can do this locally.

First, setup a Memory.md file with Claude.

This should cover: why the trade fired, the outcome, and all relevant data.

Tell Claude to update this file every time a trade is placed.

Miles Deutscher - inline image

Second, you want a learnings file.

This is where Claude will log what it learned from each trade and how it plans on improving your strategy.

You can also use this as your personal trading journal to log notes that your AI ingests.

Miles Deutscher - inline image

The cool thing here is that over 6+ months of trading, you're building an intense data-backed log that you can use to actually improve your strategy.

Most people aren't profitable because they don't have access to data, and thus, they can't make informed adjustments to their trading approach. This trade ledger system fixes that.

VI: Telegram Setup

For those of you who want to trade on your phone, and who want quick access to your bot, you can connect Claude to Telegram via BotFather.

Remember, your computer needs to be on for your BotFather to tap into your Claude. What I personally do is run my AI trading accounts on a local device that I don't mind keeping on 24/7 with the Caffeine plugin.

Search "BotFather" on TG and it should pop up.

Run /newbot inside BotFather and it will guide you through the step-by-step setup.

Miles Deutscher - inline image

You can also use Dispatch inside Claude Desktop as another way to get mobile access to your AI bot.

Miles Deutscher - inline image

Wrapping Up

So, there you have it. My full guide for how to build a crypto trading bot for this upcoming bull run.

I hope you found this article helpful. If you did, be sure to follow me here @milesdeutscher. Every day, I post about how you can actually use AI in financial markets to make more money.

For deeper AI insights, follow me over on @aiedge_.

Lastly, I recently created a free Skool community where I post behind-the-scenes AI alpha, and share some of my cool AI x finance workflows.

I'm sure you'll find a lot of value inside

👉 https://www.skool.com/milesdeutscherfinance

Miles Deutscher - inline image
Guardar com um clique

Faça leitura aprofundada de artigos virais com IA no YouMind

Guarde a fonte, faça perguntas específicas, resuma o argumento e transforme um artigo viral em notas reutilizáveis num único espaço de trabalho com IA.

Explorar o YouMind
Para criadores

Transforme o seu Markdown num artigo 𝕏 impecável

Quando publica os seus próprios textos longos, formatar imagens, tabelas e blocos de código para o 𝕏 é uma dor de cabeça. O YouMind transforma um rascunho completo em Markdown num artigo 𝕏 impecável e pronto a publicar.

Experimente Markdown para 𝕏

Mais padrões para decifrar

Artigos virais recentes

Explorar mais artigos virais