Moonshot Benchmarks

This repository provides equal-weighted and dollar-volume-weighted benchmark strategies for Moonshot.

You can construct the benchmark strategy with the same universe of securities used in the trading strategy you want to compare to create a more meaningful benchmark than standard indexes like the S&P 500.

Usage

The strategies provided in benchmark.py are base classes and must be subclassed. Provide a CODE and DB (and optionally UNIVERSES and EXCLUDE_UNIVERSES):

from codeload.benchmark import EqualWeightedIndex

class CanadaEqualWeightedIndex(EqualWeightedIndex):

    CODE = "canada-benchmark"
    DB = "canada-stk-1d"

You can filter the universe by minimum average dollar volume:

class CanadaEqualWeightedIndex(EqualWeightedIndex):

    CODE = "canada-benchmark"
    DB = "canada-stk-1d"
    MIN_DOLLAR_VOLUME = 1e6

Or by dollar volume rank:

class CanadaEqualWeightedIndex(EqualWeightedIndex):

    CODE = "canada-benchmark"
    DB = "canada-stk-1d"
    DOLLAR_VOLUME_TOP_N_PCT = 50

A dollar-volume weighted variant is also provided:

from codeload.benchmark import DollarVolumeWeightedIndex

class JapanDollarVolumeWeightedIndex(DollarVolumeWeightedIndex):

    CODE = "japan-benchmark"
    DB = "japan-stk-1d"

Adapt the strategies as needed to mirror the trading rules, minus alpha factors, of the strategy you want to compare.