Live
Auto strategy optimizer — AI improves your edge while you sleep
guidebeginner12 min

Using Cody: Your AI Trading Assistant

Learn how to use Cody to generate strategies, optimize parameters, and understand your code.

Last updated: Jan 28, 2026

Cody is an AI assistant built into QuantIDE. It's not just a code generator—it's a teaching partner that helps you learn while building production-grade trading systems.

What Cody Can Do

  • Generate complete strategies from plain English descriptions
  • Explain what any piece of code does
  • Debug strategies that aren't working
  • Suggest optimizations and improvements
  • Answer questions about trading concepts
  • Help you learn Python as you build

Generating Strategies

The simplest way to use Cody is describing what you want in plain English:

text
You: "Write a strategy that buys Bitcoin when the
price drops 5% in a day and sells when it recovers 3%"

Cody: Here's a mean reversion strategy based on daily
price drops...

[Cody generates complete, runnable code]

Be specific about:

  • The asset(s) you want to trade
  • Entry conditions (when to buy)
  • Exit conditions (when to sell)
  • Any risk management rules
  • Position sizing preferences

Example Prompts

text
# Good prompts - specific and clear
"Buy ETH when RSI drops below 25, sell when it rises above 65"

"Create a momentum strategy for AAPL using 20 and 50 day
moving averages with a 2% stop loss"

"Write a breakout strategy that enters when price breaks
above the 20-day high with volume 50% above average"

# Vague prompts - Cody will ask for clarification
"Make me money" → Too vague
"Trade stocks" → Which ones? What signals?
"Good strategy" → Define "good"

Understanding Your Code

Cody can explain any code, line by line:

text
You: "Explain what this line does:
entries = (fast_ma > slow_ma) & (rsi < 50)"

Cody: This creates entry signals where BOTH conditions
are true:

1. fast_ma > slow_ma: The fast moving average is above
   the slow one, indicating an uptrend

2. rsi < 50: RSI is below 50, meaning momentum hasn't
   peaked yet

The & operator requires both conditions. You'll only
enter trades when the trend is up AND there's still
room for the move to continue.

Debugging with Cody

When your strategy isn't working as expected, ask Cody:

text
You: "My strategy has zero trades. Here's the code:
[paste code]"

Cody: I see the issue. Your entry condition requires
RSI < 20, but looking at the data, RSI never drops
that low for this asset.

Try RSI < 30 instead, or check if your data range
includes any significant drawdowns.

You: "Why is my Sharpe ratio negative?"

Cody: A negative Sharpe ratio means your strategy
lost money on a risk-adjusted basis. Looking at your
backtest:

1. Total return: -12%
2. You're trading too frequently (847 trades)
3. Fees are eating your profits (0.1% × 847 = 85% drag)

Consider: fewer trades, lower fee broker, or wider
entry thresholds.

Learning Mode

Ask Cody to explain concepts as it helps you:

text
You: "Add a stop loss to my strategy and explain
how stop losses work"

Cody: A stop loss automatically exits your position
if the price moves against you by a certain amount.
It limits your downside risk.

Here's your strategy with a 5% stop loss:

pf = vbt.Portfolio.from_signals(
    close=closes,
    entries=entries,
    exits=exits,
    sl_stop=0.05,  # Exit if price drops 5% from entry
    init_cash=10000
)

With this stop loss, no single trade can lose more
than 5% of its entry value. The tradeoff: you might
get stopped out of trades that would have recovered.

Optimization Suggestions

After running a backtest, ask Cody for improvements:

text
You: "My strategy has a 1.2 Sharpe ratio. How can
I improve it?"

Cody: A 1.2 Sharpe is decent but there's room to
improve. Based on your backtest results:

1. Your win rate is 45% but winners are 2x losers -
   that's good, but try tighter stops to improve win rate

2. You're holding positions 12 days average - consider
   adding a time-based exit for trades that go nowhere

3. Your entries cluster around market opens - try
   filtering for time of day

Want me to implement any of these changes?

Usage Limits

Cody usage varies by plan:

  • Free: 5 prompts total (try before you subscribe)
  • Quant ($39/mo): 100 prompts/month
  • Desk ($99/mo): 250 prompts/month with priority responses

Tags

codyaiassistantcode-generation
Related documentation