> For the complete documentation index, see [llms.txt](https://help.hydravision.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.hydravision.ai/ea-configuration/ea-settings/smartentry/market-regime.md).

# Market Regime

The Market Regime the grid is proposing to run in

Market Regimes have long been the hallmark of pain for auto traders. Often Market Regimes can change quite quickly and without warning when macro level market events are released. This could be political statements, election results, fundamental news events or world events such as wars.

{% hint style="danger" %}
If the asset being traded is susceptible to regime shifts, we offer some reprieve. However, we always caution that if you are uncertain, it is best to stop trading and wait until the regime shift is clear to avoid issues. Hydra Vision has many capabilities, but it is not able to trade through extreme events without some account pain, which could exceed your risk tolerance.
{% endhint %}

<i class="fa-lightbulb" style="color:$success;">:lightbulb:</i> Learn more about Market Regimes <a href="/concepts/concepts/market-regimes.md" class="button primary">Learn --></a>

Market Regime qualification is an anchor veto: it decides which side (buy or sell) may open a new grid. Grids that are already open are not affected by it.

## Market Context

Hydra Vision embeds a monthly lookback feature - Context, for example 3 months. The Market Context measures the Peak and Trough of the last x Months on a rolling basis (on daily bars), and tags the High, Low and Mid Point.

A score is then produced from 100 to -100 (0 being the mid-point), and this is the Context Score. The score is -100 at the low of the range and +100 at the high.

Anchor entries are then restricted based on the Context Score. With Buy Low/Sell High on (the default):

* Buys may open only when the score is from -80 to -10.
* Sells may open only when the score is from +10 to +80.
* Between -10 and +10 (close to the mid-point) neither side may open a new grid.
* Below -80 no buys, and above +80 no sells: the market is extending too strongly to trade against it. So beyond ±80 neither side may open a new grid.

With Buy Low/Sell High off, the sides swap: buys only from +10 to +80, sells only from -80 to -10. The band between -10 and +10 still blocks both sides. Above +80 buys are blocked and below -80 sells are blocked, so beyond ±80 neither side may open a new grid in either mode.

Together with other Vetoes and the MA Cross, this alone cuts out a huge amount of noise.

## High Timeframe Moving Average

An alternative, and probably more traditional, approach would be to use a High Timeframe MA. The MA is an EMA with the period set by [MA Period for Anchor Vetoes](/ea-configuration/ea-settings/smartentry/anchor-vetoes.md) (default 50), on the Market Regime Timeframe (default H4). There is no separate period setting for it here.

With Buy Low/Sell High on (the default), buys open only when price is below the MA, and sells only when price is above it. With Buy Low/Sell High off, it is the reverse: when the market is above the MA we are long, and below the MA we are short. If the MA has no data yet, this check does not block.

Our internal testing has shown this to be less reliable. However, we offer this option for completeness.

{% hint style="success" %}
To restrict entries by their distance from an MA, see [Block Late Entries (Extended Price)](/ea-configuration/ea-settings/smartentry/anchor-vetoes.md#block-late-entries-extended-price) on the Anchor Vetoes page.
{% endhint %}

<details>

<summary>Market Regime qualification</summary>

`Enumerator`

Default: Market Context

Select a Market Regime strategy to use

1. No Regime Check - Disabled
2. Market Context
3. MA Higher Time Frame

</details>

<details>

<summary>Buy Low/Sell High</summary>

`Boolean`

Default: True

If enabled, the Anchors will Buy when the market is low (a negative Context Score, or price below the MA) and Sell when it is high (a positive Context Score, or price above the MA).

If disabled, the reverse is true.

Shown only when a Market Regime is selected.

</details>

<details>

<summary>Months to look back for Market Context</summary>

`Integer`

Default: 3

Hydra uses a lookback function to understand the current price of the market in relation to the last X months (the regime). 1-3 months is the usual range.

The current price will be given a score from 100 to -100 depending on its regime relation, and this is in turn used by SmartEntry to assist with decision making.

The same range is used by Breakout Lag and Breakout Re-entries, whichever Market Regime is selected.

We recommend watching our videos on SmartEntry.

</details>

<details>

<summary>Market Regime Timeframe</summary>

`Enumerator`

Default: H4

The Timeframe to be used by the High TF Moving Average. Shown only when Market Regime qualification is MA Higher Time Frame. Market Context does not use it.

</details>

<details>

<summary>Max Market Density % (0-100)</summary>

`Double`

Default: 60

Maximum Market Density % (0-100). This uses the current market price as the frontier instead of the Frontier position, which is a lower density %. Prevents potential new grid positions from compacting at extremes. A lower value is more restrictive.

It acts only when a Market Regime is selected, and is shown only then. It applies to re-entries, not to anchors, and not to Static Zone positions.

</details>

<details>

<summary>Breakout Lag: range ignores the last N days (0 = off)</summary>

`Integer`

Default: 0

The number of days for the Regime High/Low tracking to lag. 0 = Current Regime period's High/Low. Lagging the Regime lets price move beyond the range high or low, which is a breakout, with N days gap. With 0, no breakout can happen.

It is shown, and acts, only when [Breakout Re-entries](/ea-configuration/ea-settings/trade-settings.md) is not Off.

</details>
