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

# Use Cases

## 1 Master to 1 Slave Account

```mermaid theme={null}
    flowchart LR
        subgraph Port 51124
            direction LR
            A1[Master Account] -->|Copy Trade| B1[Slave Account]
        end
```

This is the most common use case where you have a single master account and a single slave account.

The master account sends trade instructions to the slave account, which then executes the trades.

<Accordion title="Example configuration for 1 Master to 1 Slave">
  ```# Master Account #1 and Slave Account #1 theme={null}
  Server address: tcp://127.0.0.1:51124
  ```
</Accordion>

## 1 Master to Multiple Slave Accounts

```mermaid theme={null}
    flowchart LR
        subgraph Port 51124
            direction LR
            A1[Master Account] -->|Copy Trade| B1[Slave Account #1]
            A1 -->|Copy Trade| B2[Slave Account #2]
            A1 -->|Copy Trade| B3[Slave Account #3]
        end
```

In this scenario, you have a single master account that sends trade instructions to multiple slave accounts.

This is useful if you want to copy trades to multiple accounts simultaneously.

<Accordion title="Example configuration for 1 Master to Multiple Slave">
  ```# Master Account #1 and Slave Account #1, #2, #3 theme={null}
  Server address: tcp://127.0.0.1:51124
  ```
</Accordion>

## Multiple Master to Multiple Slave Accounts

```mermaid theme={null}
    flowchart LR
        subgraph Multiple different ports
        direction LR
            subgraph Port 51126
                direction LR
                A3[Master Account #3] -->|Copy Trade| B7[Slave Account #6]
            end
            subgraph Port 51125
                direction LR
                A2[Master Account #2] -->|Copy Trade| B4[Slave Account #4]
                A2 -->|Copy Trade| B5[Slave Account #5]
            end
            subgraph Port 51124
                direction LR
                A1[Master Account #1] -->|Copy Trade| B1[Slave Account #1]
                A1 -->|Copy Trade| B2[Slave Account #2]
                A1 -->|Copy Trade| B3[Slave Account #3]
            end
        end
```

In this scenario, you have multiple master accounts that send trade instructions to multiple slave accounts.

This is useful if you have multiple trading strategies running on different accounts and want to copy trades to multiple accounts simultaneously.

<Accordion title="Example configuration for Multiple Master to Multiple Slave">
  ```# First group: Master Account #1 and Slave Account #1, #2, #3 theme={null}
  Server address: tcp://127.0.0.1:51124
  ```

  ```# Second group: Master Account #2 and Slave Account #4 & Slave Account #5 theme={null}
  Server address: tcp://127.0.0.1:51125
  ```

  ```# Third group: Master Account #3 and Slave Account #6 theme={null}
  Server address: tcp://127.0.0.1:51126
  ```
</Accordion>

## Multiple Master to 1 Slave Account

```mermaid theme={null}
    flowchart LR
        subgraph Multiple different ports
            direction LR
            A1[Master Account #1] -->|Copy Trade via Port 51124| B1[Slave Account]
            A2[Master Account #2] -->|Copy Trade via Port 51125| B1
            A3[Master Account #3] -->|Copy Trade via Port 51126| B1
        end
```

In this scenario, you have multiple master accounts that send trade instructions to a single slave account.

This is useful if you have multiple trading strategies running on different accounts and want to consolidate the trades into a single account.

<Accordion title="Example configuration for Multiple Master to 1 Slave">
  ```# Master Account #1 theme={null}
  Server address: tcp://127.0.0.1:51124
  ```

  ```# Master Account #2 theme={null}
  Server address: tcp://127.0.0.1:51125
  ```

  ```# Master Account #3 theme={null}
  Server address: tcp://127.0.0.1:51126
  ```

  ```# 3 Slave Copier Applications logging into the same exact account theme={null}
  Server address for 1st instance: tcp://127.0.0.1:51124
  Server address for 2nd instance: tcp://127.0.0.1:51125
  Server address for 3rd instance: tcp://127.0.0.1:51126
  ```
</Accordion>

## Cross-VPS Copying

```mermaid theme={null}
    flowchart LR
        subgraph Cross-VPS Copying
            direction LR
            subgraph VPS2
                direction LR
                B4[Slave Account #4]
            end
            subgraph VPS1
                direction LR
                A1[Master Account] -->|Copy Trade| B1[Slave Account #1]
                A1[Master Account] -->|Copy Trade| B2[Slave Account #2]
                A1[Master Account] -->|Copy Trade| B3[Slave Account #3]
            end

            A1 -->|Cross-VPS Copying| B4
        end
```

Heron Copier supports cross-VPS copying, which allows you to copy trades between accounts on different VPS servers.

This feature is useful if you have multiple accounts on different VPS servers and want to copy trades between them.

To set up cross-VPS copying, please refer to the [Cross-VPS Setup](../misc/crossvpssetup) guide.

## Or... Any Combinations of the Above

You can mix and match the above scenarios to suit your trading needs.

Just remember the [basic principles](/howdoesthecopierwork#basic-principles) and you'll be able to set up Heron Copier to copy trades in any way you want.

Below is an example of a really complicated setup utilizing all the above scenarios:

```mermaid theme={null}
flowchart LR
    subgraph "VPS 3 - Third Server"
        direction TB
        MA4[Master Account D<br/>Intraday Trading] --> SA8[Slave Account #8]
        MA4 --> SA9[Slave Account #9]
    end

    subgraph "VPS 2 - Second Server"
        direction TB
        subgraph "Port 51124 - Strategy C"
            MA3[Master Account C<br/>News Trading] --> SA6[Slave Account #7]
        end

        subgraph "Multiple Masters to 1 Slave"
            SA7[Slave Account #6<br/>listening to<br/>Multiple Masters]
        end
    end

    subgraph "VPS 1 - Primary Server"
        direction TB
        subgraph "Port 51125 - Strategy B"
            MA2[Master Account B<br/>Swing Trading] --> SA4[Slave Account #4]
            MA2 --> SA5[Slave Account #5]
        end

        subgraph "Port 51124 - Strategy A"
            MA1[Master Account A<br/>Scalping Strategy] --> SA1[Slave Account #1]
            MA1 --> SA2[Slave Account #2]
            MA1 --> SA3[Slave Account #3]
        end
    end

    %% Cross-VPS connections
    MA1 -.->|Cross-VPS Copy| SA7
    MA2 -.->|Cross-VPS Copy| SA7
    MA3 -.->|Cross-VPS Copy| SA7
    MA4 -.->|Cross-VPS Copy| SA7
```

Of course you don't have to use all the above scenarios. You can pick and choose the ones that suit your needs.

Most people are comfortable with either [1 master to multiple slaves setup](#1-master-to-multiple-slave-accounts) or [multiple master to multiple slaves setup](#multiple-master-to-multiple-slave-accounts).
