Rule reference
Rule reference
Every kind of rule the engine runs, with what it does, the settings the agent uses when you name none, and an example to try.
On this page
How to read this reference
Each rule has a plain description, the settings the Strategy Agent uses when your words name none, and an example you can open in the agent with one tap. The settings shown are the agent's own reading of the example, so they change when the agent does.
Where the house tests run the same rule, its exact wording is shown, with a link to those recorded tests beside simply holding.
Timing rules: in or out of one share
Rules that decide, each day, whether to hold a share or fund or to sit in cash.
| Rule | What it does |
|---|---|
| Moving average crossover (golden cross) | A moving average is the average closing price over the last so many days. This rule holds the share while a faster average is above a slower one, and holds cash when it falls below. |
| Exponential moving average crossover | The same idea with exponential averages, which count recent days for more, so they turn sooner after a change of direction. |
| RSI dip (mean reversion) | RSI scores the recent rises against the recent falls, from 0 to 100: a low score means mostly falls. This rule buys when the score drops below a low level and sells once it has climbed back above a higher one. |
| Breakout (Donchian channel) | Buys when the close is the highest of the last so many trading days, and sells when the close is the lowest of the same number of days. |
| MACD crossover | MACD is the gap between a fast and a slow exponential average, and its signal line is an average of that gap. The rule buys when the gap crosses above its signal line and sells when it crosses back below. |
| Bollinger bands | The bands sit a set number of standard deviations above and below a moving average, so they widen when prices swing more. The rule buys when the close falls below the lower band and sells when it is back at the middle line. |
Ranking rules: hold the leaders of a list
Rules that score a list of shares or funds and hold the ones at the top, swapping as the order changes.
| Rule | What it does |
|---|---|
| Momentum ranking | At each rebalance, it ranks a list by each one's return over a past window and holds the leaders in equal parts, swapping when the order changes. |
| Rotation (momentum and calm prices) | Like a momentum ranking, but each score blends the past return with how calmly the price moved. |
| Low volatility | Holds the names whose prices moved about the least over the past year, and scales the whole portfolio down when its ups and downs run above a target. |
| Quality ranking | Ranks on company accounts (how much profit a company makes on its owners' money) where Quantis holds them, blended with calm prices. A share with no accounts is ranked on its prices alone, and the result says which. |
Holding several things at set weights
Portfolios with no buy or sell signal: fixed weights, buying and holding, and risk parity.
| Rule | What it does |
|---|---|
| Risk parity | Holds the calmer assets of a list in equal parts, capped per asset, and scales the whole portfolio down when its ups and downs run above a target. Ask for hierarchical risk parity to weight them by how they move together instead. |
| Fixed weights | Holds set weights, such as most in a stock fund and the rest in a bond fund, and puts them back to those weights on a schedule. Weights that add up to less than the whole leave the rest in cash. |
| Buy and hold | Buys on the first day and keeps it to the last. Every result is set beside this, so a plain question like "what if I had bought it" is answered the same way. |
Conditions you can combine
The single tests a rule of several conditions is built from, each of which can also stand alone.
| Rule | What it does |
|---|---|
| Price against its moving average | The close above or below its simple or exponential moving average. On its own it is the trend filter many people know. |
| One moving average against another | A faster average above, below or crossing a slower one. Combined with a filter, it buys only when the filter also holds. |
| RSI above or below a level | The RSI over any length against a level. A short RSI, such as two days, reacts to very short dips. |
| MACD crossing its signal line | The MACD line crossing above or below its signal line, as a condition beside others. |
| Price against a Bollinger band | The close below the lower band, above the upper band, or either side of the middle line. |
| A new high or low (channel break) | The close breaking above the highest close, or below the lowest, of the last so many trading days. |
| A rise or fall over some days | The close against the close a number of trading days earlier: a fall of so much in a day, or a rise over a month. |
| A fall from a recent high | How far the close is below its highest close of the last so many trading days. |
| A market-wide series against a level (the VIX) | A stored daily series that is not a share price, against a level. Today the agent reads the VIX's close, a measure of how much traders expect prices to swing. |
| A gap at the open | The day's opening price against the day before: a gap up or down of so much from the previous close, or an open above the previous high or below the previous low. |
| A condition read on another symbol | Any condition can be read on another symbol, such as the S&P 500 fund, so a rule trades one thing while watching another. Often used as a market filter. |
Ways to sell, shorts, and what cannot run yet
Stops, profit targets and time limits, selling short, and the rules the engine does not run yet.
| Rule | What it does |
|---|---|
| Stop loss and trailing stop | A stop sells when the price falls a set amount below where it was bought. A trailing stop follows the price up and sells on a fall of that much from the highest price since the purchase. |
| Selling on a gain | Sells the whole position once it is up a set amount from the price paid. No stop is needed beside it. |
| Selling after some days | Sells a set number of trading days after the purchase, unless a stop, a target or the rule's own exit sells it first. |
| Selling short | Selling short means selling shares you have borrowed and buying them back later: it makes money when the share falls and loses when it rises. |
What cannot run yet
Some rules need data the engine does not have, such as earnings dates. The list, in the engine's own words.
Related
- Strategy patternsTrend followingBe in while prices have been rising and out while they have been falling, judged by moving averages.
- Core conceptsStrategies and rulesA strategy here is a rule a computer can follow on every trading day without judgement: what to hold, when to buy and when to sell.
- Getting startedYour first testWrite an idea in plain words, check what the agent read, and run it. This page walks through one test from the box to the result.
These pages describe how Quantis Trade works and what its tests show about the past. They are not forecasts and not advice.