> ## Documentation Index
> Fetch the complete documentation index at: https://help.edgeanalyzer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Risk Management

> Protect your accounts with risk rules and flatten functionality

Risk management features help protect your follower accounts from excessive losses and provide emergency controls to exit positions quickly.

## Flatten Accounts

Flattening closes all open positions on selected accounts. This is an emergency or end-of-session action available in the Cockpit.

### How to Flatten

<Steps>
  <Step title="Navigate to Cockpit">
    Go to the **Cockpit** in the sidebar.
  </Step>

  <Step title="Select Accounts">
    Select the accounts you want to flatten, or choose **Flatten All**.
  </Step>

  <Step title="Confirm">
    Confirm the action.
  </Step>

  <Step title="Execution">
    Edge Analyzer sends market orders to close all open positions on the selected accounts.
  </Step>
</Steps>

### When to Use Flatten

| Scenario                   | Action                                                      |
| -------------------------- | ----------------------------------------------------------- |
| **End of trading session** | Close all positions before market close                     |
| **Emergency exit**         | Quickly close all positions if the market moves against you |
| **Account protection**     | Flatten an account approaching prop firm rule limits        |
| **Technical issues**       | Exit all positions if you experience connectivity problems  |

### Flatten Group

You can also flatten all accounts in a copy trading group at once:

1. Navigate to **Copy Trading Groups** in the sidebar
2. Find the group you want to flatten
3. Click the menu (three dots) on the group card
4. Select **Flatten Group**
5. Confirm the action

This closes all open positions on both the leader account and all follower accounts in that group.

<Warning>
  Flatten sends market orders, which execute at the current market price. There may be slippage depending on market conditions. The action cannot be undone — positions are closed immediately.
</Warning>

## Risk Rules

Risk rules help protect your accounts from excessive losses by automatically taking action when thresholds are reached.

### Available Rules

| Rule Type             | Description                             | Example            |
| --------------------- | --------------------------------------- | ------------------ |
| **Daily Loss Limit**  | Stop copying after daily loss threshold | \$500/day max loss |
| **Max Position Size** | Limit contracts per position            | Max 5 contracts    |
| **Max Drawdown**      | Stop at percentage drawdown             | 5% max drawdown    |
| **Daily Trade Limit** | Maximum trades per day                  | 10 trades/day max  |

### Setting Up Risk Rules

<Steps>
  <Step title="Go to Risk Settings">
    Navigate to **Copy Trading** → **Risk Rules**.
  </Step>

  <Step title="Create Rule">
    Click **Add Rule** and select the rule type.
  </Step>

  <Step title="Configure Thresholds">
    Set your warning and critical thresholds.
  </Step>

  <Step title="Set Action">
    Choose what happens when the rule triggers.
  </Step>

  <Step title="Assign to Accounts">
    Select which accounts this rule applies to.
  </Step>
</Steps>

### Rule Actions

| Action                | Behavior                                              |
| --------------------- | ----------------------------------------------------- |
| **Warn Only**         | Send alert but continue copying                       |
| **Block Orders**      | Prevent new orders from being copied                  |
| **Flatten Position**  | Close all open positions on the account               |
| **Flatten & Disable** | Flatten all positions and stop the copy trading group |

### Threshold Levels

Set two thresholds for each rule:

* **Warning (80%)** — Get an alert that you're approaching the limit
* **Critical (100%)** — Trigger the configured action

## Troubleshooting

### Trades Not Copying

<AccordionGroup>
  <Accordion title="Group not active">
    Ensure the copy trading group is activated (not deactivated). Check the group status in the Cockpit.
  </Accordion>

  <Accordion title="Connection issues">
    Verify all source and target connections are active and connected. Check the connection status indicators.
  </Accordion>

  <Accordion title="Account limits reached">
    Ensure target accounts have not reached position limits set by the prop firm. Check your prop firm's rules.
  </Accordion>
</AccordionGroup>

### Partial Copy Failures

If a trade copies to some targets but fails on others:

* Edge Analyzer tracks success and failure for each target individually
* Check the failed target's connection status
* Review error messages — common causes include:
  * Insufficient margin
  * Account restrictions
  * Connection timeouts
  * Position limit reached

### Latency

Copy trading executes as fast as the broker APIs allow. There may be a small delay between the source trade execution and the target trade placement. This is normal and depends on broker API response speeds.

### Account Status Issues

If a target account is closed (e.g., blown due to rule violation), Edge Analyzer does not attempt to copy trades to that account. The trade is skipped for inactive or closed accounts.

### Missing Accounts

If you don't see all your accounts available for copy trading:

1. **Check the connection** — Navigate to Connections and verify the connection is active
2. **Refresh accounts** — Click "Refresh Accounts" on the connection to re-discover accounts
3. **Check account status** — Only active accounts appear in copy trading. Accounts marked as closed or inactive are excluded.

## Best Practices

<Check>Start with conservative limits and adjust based on your trading style</Check>
<Check>Set warning thresholds at 80% to get early alerts before hitting limits</Check>
<Check>Use daily loss limits to prevent blown accounts</Check>
<Check>Test flatten functionality before you need it in an emergency</Check>
<Check>Monitor connection status before important trading sessions</Check>
<Check>Keep accounts within prop firm rules to avoid automatic closes</Check>
