# Strategy Rule

<details>

<summary><strong>Long Only Rule</strong></summary>

This means the **Buy signal will be treated as the Entry signal** and the **Sell signal will be treated as the Exit signal**.

**Option Buying**

* Buy Signal → CE – LONG (Entry)
* Sell Signal → CE – EXIT

**Option Selling**

* Buy Signal → PE – SHORT (Entry)
* Sell Signal → PE – EXIT

**Option Hedge Buying**

* Buy Signal → PE – LONG (Entry)
* Sell Signal → PE – EXIT

**Option Hedge Selling**

* Buy Signal → CE – SHORT (Entry)
* Sell Signal → CE – EXIT

</details>

<details>

<summary><strong>Short Only Rule</strong></summary>

This means the **Sell signal will be treated as the Entry signal** and the **Buy signal will be treated as the Exit signal**.

**Option Buying**

Sell Signal → PE – LONG (Entry)\
Buy Signal → PE – EXIT

**Option Selling**

Sell Signal → CE – SHORT (Entry)\
Buy Signal → CE – EXIT

**Option Hedge Buying**

Sell Signal → CE – LONG (Entry)\
Buy Signal → CE – EXIT

**Option Hedge Selling**

Sell Signal → PE – SHORT (Entry)\
Buy Signal → PE – EXIT

</details>

<details>

<summary><strong>Long + Short (Buy + Sell) Rule</strong></summary>

This rule allows the strategy to **take both Long and Short trades**.\
If your strategy provides **separate signals for Long Entry/Exit and Short Entry/Exit**, then you should select this rule.

**Option Buying**

**Buy Signal**

* CE → **LONG (Entry)**

**Sell Signal**

* CE → **EXIT**

**Sell Signal**

* PE → **LONG (Entry)**

**Buy Signal**

* PE → **EXIT**

***

**Option Selling**

**Buy Signal**

* PE → **SHORT (Entry)**&#x20;

**Sell Signal**

* PE → **EXIT**

**Sell Signal**

* CE → **SHORT (Entry)**

**Buy Signal**

* CE → **EXIT**

***

**Option Hedge Buying**

**Buy Signal**

* PE → **LONG (Entry)**

**Sell Signal**

* PE → **EXIT**

**Sell Signal**

* CE → **LONG (Entry)**

**Buy Signal**

* CE → **EXIT**

***

**Option Hedge Selling**

**Buy Signal**

* CE → **SHORT (Entry)**

**Sell Signal**

* CE → **EXIT**

**Sell Signal**

* PE → **SHORT (Entry)**

**Buy Signal**

* PE → **EXIT**

</details>

<details>

<summary><strong>Long + Short (Buy + Sell &#x26; Short + Cover) Rule</strong></summary>

You should use this rule **only when your Strategy or Indicator provides four different signals action**:

* **BUY**
* **SELL**
* **SHORT**
* **COVER**

This rule will **separately manage Long trades and Short trades** based on these signals.

***

**Option Buying**

**Buy Signal** → CE **LONG (Entry)**\
**Sell Signal** → CE **EXIT**

**Short Signal** → PE **LONG (Entry)**\
**Cover Signal** → PE **EXIT**

***

**Option Selling**

**Buy Signal** → PE **SHORT (Entry)**\
**Sell Signal** → PE **EXIT**

**Short Signal** → CE **SHORT (Entry)**\
**Cover Signal** → CE **EXIT**

***

**Option Hedge Buying**

**Buy Signal** → PE **LONG (Entry)**\
**Sell Signal** → PE **EXIT**

**Short Signal** → CE **LONG (Entry)**\
**Cover Signal** → CE **EXIT**

***

**Option Hedge Selling**

**Buy Signal** → CE **SHORT (Entry)**\
**Sell Signal** → CE **EXIT**

**Short Signal** → PE **SHORT (Entry)**\
**Cover Signal** → PE **EXIT**

</details>

<details>

<summary><strong>Stop + Reversal (Buy + Sell &#x26; Short + Cover) Rule</strong></summary>

In this rule, the system will **always maintain one open position at a time**.

* When a **Buy signal** comes, it will **enter a Long position**.
* When a **Sell signal** comes, it will **close the previous Long position and immediately enter a Short position**.
* Similarly, when the opposite signal appears, it will **close the current position and reverse the trade**.

This is called a **Stop and Reversal strategy**, where the position **continuously switches between Long and Short**.

***

**Option Buying**

**Buy Signal** → CE **LONG (Entry)** & PE **EXIT**

**Sell Signal** → PE **LONG (Entry)** & CE **EXIT**

***

**Option Selling**

**Buy Signal** → PE **SHORT (Entry)** & CE **EXIT**

**Sell Signal** → CE **SHORT (Entry)** & PE **EXIT**

***

**Option Hedge Buying**

**Buy Signal** → PE **LONG (Entry)** & CE **EXIT**

**Sell Signal** → CE **LONG (Entry)** & PE **EXIT**

***

**Option Hedge Selling**

**Buy Signal** → CE **SHORT (Entry)** & PE **EXIT**

**Sell Signal** → PE **SHORT (Entry)** & CE **EXIT**

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.algomojo.com/algomojo/strategy-rule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
