Predefined Assistants

Mia

Introduction

Mia is our agentic coding assistant. Think of agentic coding as a form of pair programming, where you are the observer who gives high-level directions and Mia is the driver who writes the code and calls the QuantConnect API. She is aware of the entire project's context, QuantConnect documentation, runtime errors, and logs, and uses a proprietary blend of commercial and open-source models to accomplish the goals you set. We trained Mia on hundreds of algorithms and thousands of documentation pages to provide contextual assistance for most issues you may encounter when developing a strategy. Agentic conversations like this unlock the ability for everyone to create, research, and deploy algorithmic trading strategies without being an expert programmer.

We encourage using Mia before other commercially available LLMs. Our benchmarks show Mia is able to generate working QuantConnect code in 75% of test cases vs OpenAI o3 25%.

How It Works

Mia is the generalist on the team. Where each specialist assistant has a focused toolset, Mia has access to every tool in QuantConnect Cloud and reaches for whichever the work requires. When you give her a prompt, she drafts a plan and gets to work. When you arrive empty-handed, she pulls the next idea from your Research Pipeline. When the pipeline is empty, she reads recent financial news and generates a fresh, testable strategy from what she finds. From there, depending on what the work needs, she runs statistical research in a notebook, pressure-tests a model, writes and debugs algorithm code, deploys and monitors paper trading, or scans news for adverse events on a live position.

What It Does

Mia writes QuantConnect algorithm code, runs it, fixes what is broken, and runs it again until the strategy executes end to end. She follows modern development patterns and optimizes her code for speed, so backtests run faster. She does not wrap runtime errors in try/catch to hide them, and instead lets the algorithm fail so she can fix the root cause. When research is the right next step, Mia opens the project's research notebook and works inside it with the notebook tools, following the project's template precisely. When the work calls for paper trading, she deploys the strategy and watches its live performance against the backtest baseline, treating any divergence as a signal to investigate.

What You Get Back

What you get back depends on what you asked Mia to do. At minimum, you get a working algorithm in your project, compiled clean, with a backtest you can open and read on your own terms. When you ask for research, you also get a notebook documenting the data, transformations, and tests behind the conclusion. When you ask for paper trading, you get a deployed algorithm and a record of how it has held up against the backtest baseline so far.

Mia keeps her replies brief and reports work honestly. She will tell you when a strategy passed her checks and when it failed. The decision about live capital stays with you.

Brainstorm Trading Ideas

Looking for inspiration on a new area of research? Mia can suggest new trading ideas for you to investigate.

> Brainstorm some new trading strategy ideas.

Write & Debug Code

Mia has read and write access to the files in your project. With Mia's deep knowledge of our documentation and LEAN, she can implement any strategy or functionality you request. After writing the code, Mia compiles the project to check for errors. If she detects some errors, she autonomously works to debug and fix them before compiling the project again.

Write Full Strategies

Mia can implement full trading strategies.

> Create a momentum strategy for a universe of US Equities.

Add New Factors

Mia can upgrade your existing strategy to incorporate new factors, allowing you to make more informed trading decisions.

> Filter trades based on the Fear & Greed Index. Favor long trades during fearful periods and short trades during greedy periods.

Add Portfolio Optimization

Mia can test various portfolio construction techniques to find what works best for your strategy.

> Replace the equal-weighted portfolio construction with a portfolio that optimizes the trailing Sharpe ratio.

Add Risk Management Orders

Mia can extend your strategy with risk management orders to reduce volatility in your equity curves.

> Add take-profit and stop-loss orders to this strategy.

Add Machine Learning

Mia can review your code and offer some suggestions on where machine learning models can fit in.

> Where can we incorporate some machine learning in this strategy?

Analyze Backtest Results

Once your project successfully compiles, Mia launches a backtest to evaluate the strategy's performance. If the algorithm throws errors during execution, Mia catches them and edits the code to solve the problem. When the algorithm runs without error, she reviews the backtest statistics, orders, logs, and more, and then provides a summary of the performance. If you have a specific question about the results, just ask.

> How can we increase the Sharpe ratio of this strategy?


> The algorithm takes a long time to run. Can you speed it up?


> Why didn't the algorithm place any trades during the backtest?

Optimize Parameters

Once you are satisfied with your trading strategy, you may want to run an optimization job to optimize parameters and test their sensitivity.

> What rebalance time leads to the best performance? Let's try 10 minutes to 60 minutes after the market opens, in steps of 5 minutes.


> Test how sensitive this strategy is to the width of the Bollinger Bands.


In some cases, you may even be able to make your strategy more robust by removing some parameters.

> Count the number of parameters we have in this strategy. Which ones could we remove?

Tools

Mia has access to the following tools:

  • create_compile
  • read_open_project
  • update_project
  • read_project_nodes
  • create_backtest
  • read_backtest
  • list_backtest
  • update_backtest
  • delete_backtest
  • search_backtest_logs
  • create_live_algorithm
  • read_live_algorithm
  • stop_live_algorithm
  • liquidate_live_algorithm
  • search_live_logs
  • create_optimization
  • read_optimization
  • list_optimizations
  • abort_optimizations
  • delete_optimizations
  • jupyter_create_cell
  • jupyter_read_cell
  • jupyter_update_cell
  • jupyter_delete_cell
  • jupyter_execute_cell
  • jupyter_create_notebook
  • jupyter_read_notebook
  • jupyter_execute_notebook
  • financial_data_blog_posts
  • financial_data_news_articles
  • financial_data_web_get
  • list_datasets
  • get_dataset_details
  • user_input
  • environment_library_support
  • create_kanban_card
  • get_kanban_cards
  • update_kanban_card
  • delete_kanban_card
  • get_kanban_ideas
  • select_kanban_card
  • delete_kanban_card
  • send_email_notification
  • send_sms_notification
  • send_telegram_notification
  • object_store_get
  • object_store_set

Public Support

In addition to agentic conversations, you can interact with Mia through the following support channels. In these channels, Mia simply responds to your prompts with text.

Community Forum

Mia automatically provides an initial response in the community forum.

Discord

You can ask Mia questions in our Discord server using @Mia Alissi or use the #ask-mia channel.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: