> For the complete documentation index, see [llms.txt](https://docs.finandy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finandy.com/algo-trading/signals-tradingview/signal-processing-logic.md).

# Signal processing logic

Position adjustment logic: **Both**

<figure><img src="https://t24536365.p.clickup-attachments.com/t24536365/6783a6d4-9cf4-4c2c-b4d2-6c21d8151da8/image.png" alt="" width="563"><figcaption></figcaption></figure>

## Buy signal

```
"side": "buy",
```

| **Position opening** | **Action**                                                           |
| -------------------- | -------------------------------------------------------------------- |
| No opened position   | Open a **Long** position.                                            |
| Long                 | **Long** position averaging if allowed in signal settings.           |
| Short                | Close or reverse a **Short** position if allowed in signal settings. |

## Sell signal

```
"side": "sell",
```

| **Position opening** | **Action**                                                          |
| -------------------- | ------------------------------------------------------------------- |
| No opened position   | Open a **Short** position.                                          |
| Long                 | Close or reverse a **Long** position if allowed in signal settings. |
| Short                | **Short** position averaging if allowed in signal settings.         |

**Do you have any questions? We can help you in our Telegram chat.**

{% embed url="<https://t.me/finandy>" %}
