We Asked AI to Build a Crypto Trading Bot — It Actually Works
In just 36 hours, it executed 7,328 trades with a 40.60% win rate and generated $566.07 in simulated profit.
Try It Yourself
Head over to app.webull.com/stocks, pull up ETH/USD, then paste the script into the browser’s dev console. This version is tuned specifically for ETH but can be adapted to other tickers.
Run This Script in Your Browsers Dev Console
How It Works
The bot uses momentum-based logic with tight trailing stops. It tries to catch small price movements and exit quickly. You'll notice in the logs that many trades end in a trailing stop (even when profitable) — these will show as "Error: stop loss" due to how the simulation logs trades, but they often represent gains.
Let It Evolve
This started as a fun experiment, but now we’re curious to see what others do with it. Tweak the strategy, add indicators, or swap ETH for NVDA. Drop your own variants — we might feature them. View or fork it on GitHub.
Prompt Used
We used the following single shot prompt with Google Gemini to create the script:
I want to create a high-frequency scalping trading bot in JavaScript that gets injected into a web trading platform via browser console. This is for educational/simulation purposes only. Requirements: Platform Integration:Inject script into https://app.webull.com/stocks (Ethereum chart) Monitor price changes using MutationObserver on this XPath: //*[@id="app"]/main/section/div[2]/div[1]/div/div[2]/div[1]/div[2]/div/div/span[2] Use system clock to create 1-minute OHLC data from real-time price feeds Trading Algorithm:Implement tick scalping strategy (trade on small price movements) Go both long and short positions (simulated) Entry logic: Trade on momentum (upward movement = long, downward = short) Include momentum calculation using recent price history UI Overlay:Create draggable, semi-transparent overlay positioned fixed on screen Hacker/terminal aesthetic (black background, green text, monospace font) Display: Current price, bot status, position info, P&L stats, trade history Control buttons: START, STOP, CLOSE POSITION Real-time trade log showing recent trades with timestamps Features:Start trading immediately when activated (don't wait for data collection) Aim for multiple trades within 5-10 minutes Track win rate, total P&L, number of trades Auto-exit positions on profit target, stop loss, or time limit Console logging for debugging Technical Specs:Pure JavaScript (no external libraries) Handle price parsing (remove commas, dollar signs) Maintain price history array (last 50 data points) Calculate momentum using recent vs older price averages Include error handling for missing DOM elements Output: Complete, ready-to-inject JavaScript code with all functionality implemented. The bot should be aggressive enough to generate trades quickly on an active Ethereum chart.