> 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/pcl/pcl-engines.md).

# PCL Engines

Profit Closes Loss, one of the most important sections of configuration in the EA.

{% hint style="info" %}
We strongly recommend watching our videos on PCL in order to fully understand how these engines work in relation to the selected PCL strategy. Using these without complete understanding can result in confusion and incorrect configuration.
{% endhint %}

### Dynamic PCL

{% hint style="warning" %}
We advise watching our introduction videos on PCL before attempting customization
{% endhint %}

By default PCL is the pairing of 2 positions (one in profit and one in loss), using an average price engine including all costs and a profit target. This pairing results in both positions being closed once the market hits the PCL average price, resulting in a small clipping fee, the Profit Target.

In addition to the profit, the grid is de-risked, and is either compacted or has been curated for a PCL strategy.

{% hint style="info" %}
Grid Compaction - The process of reducing the overall size of the grid, which is a price measure from the highest position to the lowest position. This is the default behaviour of PCL
{% endhint %}

{% hint style="info" %}
Grid Curation - The process of curating the positions inside the grid to enable to execution of a PCL strategy, such as Bounce. A by-product of curation would also be reduction of volume and reduced density. Compaction is generally not achieved during curation
{% endhint %}

{% hint style="info" %}
Grid De-Risking - The process of targeting high risk positions (generally mid-grid). Activates automatically once a strategy has been invalidated or the grid de-risk thresholds have been breached
{% endhint %}

<details>

<summary>Dynamic PCL Enabled</summary>

`Boolean`

Default: true

Enable Dynamic PCL (important to note that at least one of the PCL engines must be enabled)

</details>

<details>

<summary>Dynamic PCL Feasability threshold (Step Factor)</summary>

`Double`

Default: 3.0

Dynamic PCL measures how far the market must retrace to reach the PCL average price. If that retrace exceeds this threshold (value \* step size), the standard single PCL close is treated as not feasible, and Dynamic PCL escalates to a Double close (see below). The same limit applies to Bounce and [De-Risk](/ea-configuration/ea-settings/pcl/pcl-de-risking.md#pcl-de-risk-tuning) closes. If no close is feasible, PCL switches to Forced, the best available PCL. This is a safety feature, which if used correctly would activate in deep grids where larger retraces are required.

De-Risk is separate from this setting: whenever the grid qualifies for [De-Risk](/ea-configuration/ea-settings/pcl/pcl-de-risking.md#pcl-de-risk-tuning), the De-Risk close competes with the strategy's close and is used when it needs the smaller retrace.

</details>

<details>

<summary>% minimum retrace improvement to prefer double close</summary>

`Double`

Default: 0.15

In high density grids, Dynamic PCL will use 2 profit positions to close a single loss position, when the Average Price gain of using double exceeds a single PCL. The value is a fraction: 0.15 = 15%, 0.10 = 10%. A Double close is only considered when the single close is not feasible (see the feasibility threshold above) and there are 2 profit positions to work with. It is used when its retrace is shorter than the single close's retrace by at least this fraction. On the Bounce strategy a Double close is only used once the anchor has gone, because it closes the anchor. Leave as default if unsure.

</details>

### Whole PCL

Grid trading as you know it. Close all grid positions when grid VWAP (average price) is hit.

<details>

<summary>Whole Grid Enabled</summary>

`Boolean`

Default: false

Enable Whole PCL (important to note that at least one of the PCL engines must be enabled)

</details>

<details>

<summary>Start Count</summary>

`Integer`

Default: 2

Minimum position count to activate

</details>

<details>

<summary>End Count</summary>

`Integer`

Default: 100

Maximum position count to activate

</details>
