Skip to main content

Notebooks

These notebooks document MesoSim, Q-API, and Merlin workflows for users who want to inspect or customize their Python implementation. For research and backtesting, use AI Researcher as the entry point to these services.

Start from a research question​

Many notebook examples correspond to requests you can make through AI Researcher:

Notebook topicAI Researcher starting point
Basic backtest operationsRun your first backtest
Options analytics and comparing runsInvestigate results
Sensitivity and grid-search examplesAsk AI Researcher to propose a bounded comparison of the selected parameters against your baseline
Merlin predictor discovery and strategy optimizationUse Merlin for strategy research
Portfolio analysisUse Q-API for quantitative analysis

For custom notebook work, make a copy and open it in Colab. The installation steps below apply to notebook sessions.

Installation​

Installation Steps

The notebooks rely on Merlin while accessing MesoSim and Q-API, therefore, Merlin must be installed in each notebook session. Installation of Merlin can be done using Google Drive or GitHub.

For convenience and ease of access, we recommend using Google Drive using this shared folder.

note

During your on-boarding process, you will be provided with the necessary access to the shared folder. If you do not have access, please contact us via the Support page.

During the installation process, you will:

  • Create a shortcut to the deltaray-software-releases under your Google Drive
  • Mount the Google Drive to the Colab environment
  • Install Merlin using the provided package (wheel) file

Create Shortcut​

Open Google Drive and navigate to "Shared with me".

  1. Right-click on the "deltaray-software-releases" folder and select Organize / Add Shortcut.

    Add Shortcut - Step 1
  2. Select 'My Drive' and click 'Add'.

    Add Shortcut - Step 2
  3. Validate that "deltaray-software-releases" is now available in "My Drive".

    Add Shortcut - Result

Use it from Colab​

During the first use in Colab, Google will ask for permission to access your Google Drive.

Access Drive - Step 1

You need to accept all permissions to proceed:

Access Drive - Step 2
Access Drive - Step 3

Once done, you will be able to attach your drive to the Colab environment and install Merlin.

Notebook list​

The current set of notebooks is available via Resources → Software Releases in the top navigation bar.

NameDescriptionColab Link
MesoSim API Samples: Basic OperationsLearn how to create and manage backtests, retrieve events, and analyze results with MesoSim APILink
MesoSim API Samples: Options AnalyticsSet up a backtest, load event data into a DataFrame, and analyze results with scatter and quantile plots.Link
MesoSim API Samples: Space ManagementFree up space on the cluster by deleting backtests using the API.Link
Sensitivity Analysis: MonteCarlo-like analysis with randomized EntriesRun a Monte Carlo analysis on NetZero trades with random entries. Compare NAV/Equity curves.Link
Sensitivity Analysis: Using Grid Search to identify stable rangesAnalyze trade sensitivity using grid search over Delta and Expiration ranges.Link
Trade Exploration using Genetic OptimizationFind high-performing trades in a large search-space using Genetic Algorithms.Link
MesoSim and Q-API: Continuous backtest of PortfolioBuild a portfolio using three strategies with Mean Variance Optimization.Link
Merlin: Strategy OptimizationShowcasing Merlin's Predictor Discover and Strategy Optimization features.Link
Merlin: Portfolio OptimizationPortfolio Build using Optimized Strategies with MerlinLink