# Chat to create AI Trading Agent

Simply tell NOKS what you want to do—describe your strategy in plain language—and it will automatically turn your instructions into a fully functional AI trading agent. Whether you want to set buy/sell conditions, use technical indicators, or trade based on social media signals, just type your prompt and NOKS takes care of the rest.

For example, you can input:

* "Buy $1000 worth of \[Token] when RSI < 30."
* "Sell when price increases by 5%."

NOKS will understand and generate the agent to execute your strategy based on the conditions you specify. It’s as simple as that!

<figure><img src="https://2986215007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO5WhSde5bNcimZ1K95En%2Fuploads%2Frzc4UD3Brly9VcuAA6jS%2Fimage.png?alt=media&#x26;token=fb877ed9-d95f-4933-841f-3abb52cf2e41" alt=""><figcaption></figcaption></figure>

**Best Practices for Writing Prompt**

Creating effective **trading prompts** is key to ensuring that your **AI Trading Agent** makes the right decisions. Here’s a guide to help you write clear, precise prompts, and best practices to ensure your agent works optimally.

**1. Keep It Simple and Clear**

* Start with a **clear description** of the action you want your agent to perform. Simplicity ensures your agent can understand and follow your instructions.
* **Example**:
  * ***"Buy when the price drops by 5% in the last hour."***
  * ***"Sell when RSI exceeds 70."***

**2. Use Conditional Statements**

* Trading decisions are often made based on specific **conditions**. Use **"If X, then Y"** statements to define your agent’s actions.
* **Example**:
  * ***"If the price of \[Token] drops by 5%, buy $1000 worth."***
  * ***"If RSI < 30, buy. If RSI > 70, sell."***

**3. Specify Parameters**

* Define the **conditions** and **metrics** clearly. For example:
  * **RSI**: "Buy if RSI is below 30."
  * **Volume**: "Buy if trading volume exceeds 1 million."
  * **Price**: "Buy if price is below $2."

**4. Combine Multiple Indicators**

* To create more advanced strategies, combine different **indicators** like **RSI**, **MACD**, **EMA**, and **volume**.
* **Example**:
  * ***"Buy if RSI < 30, price is below $2, and volume exceeds 1 million."***
  * ***"Sell if MACD crosses below the signal line and RSI > 70."***

**5. Avoid Ambiguity**

* Be as **precise** as possible to avoid any ambiguity in the instructions. This will ensure that your agent follows the rules without confusion.
* **Example**: Instead of saying "Buy when the market looks good," use:
  * ***"Buy $1000 worth of \[Token] when RSI is below 30 and the price drops 5% in the last hour."***

**6. Test and Refine**

* Always **backtest** your prompts with **historical data** to ensure they work as expected. Refine your strategy based on backtest results before deploying it in real-time trading.


---

# 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://noks.gitbook.io/noks/how-to-build-ai-trading-agent/editor/chat-to-create-ai-trading-agent.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.
