Skip to content

Incantations

Incantations are the building blocks used to create QuantMage spells. In addition to the base Ticker incantation, QuantMage provides three distributor incantations: Weighted, Filtered, and Mixed, and three selector incantations: If/Else, Switch, and Enter/Exit.

This is the basic asset node in a spell. It lets you choose a ticker, inspect how much historical data is available, check whether the asset supports fractional trading, and explore other tickers with positive, negative, or near-zero Pearson correlation.

Use this incantation to distribute capital across multiple tickers or sub-incantations. It supports equal, custom, and inverse-volatility weighting. With inverse volatility, a steadier ticker or sub-incantation receives a larger weight. See volatility for the underlying definition.

Use this incantation to invest in the top-ranked or bottom-ranked tickers or sub-incantations according to a chosen indicator. After filtering, you can configure the resulting weights in the same way as Weighted.

Use this incantation to branch your spell based on conditions. You can combine multiple conditions and require that all or any of them be satisfied before the then branch is selected. Conditions can compare an indicator with another indicator, a fixed value, or the current month for seasonality-based logic. You can also use indicator percentile or stochastic values and require a condition to hold for a specified duration.

This incantation selects a branch based on how many conditions are met. For example, with two conditions, you can define separate outcomes for both conditions met, only one met, or neither met. If a more specific case is not configured, the incantation falls back to a lower-case behavior. The base case must still be defined.

This incantation is similar to If/Else, but it uses separate entry and exit conditions. It is useful when you want the exit signal to differ from the entry signal, such as in trend-following logic.

This incantation dynamically balances between two assets based on an indicator reading. Within a specified range, it adjusts the allocation continuously. Outside that range, it behaves like a decisive If/Else branch.


Use these incantations as the core components of your spell logic and portfolio construction.