# Strategy Management

OpenAlgo's Strategy Management Module allows you to automate your trading strategies using webhooks. This enables seamless integration with any platform or custom system that can send HTTP requests. The Strategy class provides a simple interface to send signals that trigger orders based on your strategy configuration in OpenAlgo.

> Note: When creating a trading strategy in the *Strategy Management* section, ensure you select the platform as Python to access the webhook ID displayed in the *View Strategy* section.<br>
>
> Keep the webhook ID private, as it is sensitive information similar to API keys. Do not share it with anyone.<br>

```python

from openalgo import Strategy

# Initialize strategy client
client = Strategy(
    host_url="http://127.0.0.1:5000",  # Your OpenAlgo server URL
    webhook_id="your-webhook-id"        # Get this from OpenAlgo strategy section
)


# Example 1: Long/Short only mode (configured in OpenAlgo)
#Trading Mode - Long/Short only mode (configured in OpenAlgo)
client.strategyorder("RELIANCE", "BUY")
client.strategyorder("RELIANCE", "SELL")


#Trading Mode - BOTH - Long Entry
client.strategyorder("RELIANCE", "BUY",10)


# Example 2: BOTH mode (configured in OpenAlgo)
#Trading Mode - BOTH - Long Exit
client.strategyorder("RELIANCE", "SELL",0)


#Trading Mode - BOTH - Short Entry
client.strategyorder("RELIANCE", "SELL",10)


#Trading Mode - BOTH - Short Exit
client.strategyorder("RELIANCE", "BUY",0)
 
```


---

# 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.openalgo.in/trading-platform/python/strategy-management.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.
