> For the complete documentation index, see [llms.txt](https://quantitative-algorithms-by-max-h.gitbook.io/predator-trading-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quantitative-algorithms-by-max-h.gitbook.io/predator-trading-system/overview/predator-script-documentation/predator-script/commands/core.md).

# Core

**Command (Abstract Base Class)**

* **Description:** The `Command` class is an abstract base class (ABC) that defines the interface for all commands in the DSL.
* **Constructor Parameters:** None
* **Methods:**
  * `execute(self, data_provider)`: An abstract method that must be implemented by any subclass. This method will act on the command using the provided `data_provider`.

***

**Open\_Command**

Retrieves the opening price of a market instrument for a specified date.

* **Constructor Parameters:**
  * `date (str)`: The date for which the open price is to be fetched.
* **Methods:**
  * `execute(self, data_provider)`: Calls `data_provider.get_open(self.date)` to retrieve the opening price for the specified date.

**Example Usage:**

```python
open_command = OpenCommand(date="2023-09-02")
open_price = open_command.execute(data_provider)
```

***

**High\_Command**

Retrieves the highest price of a market instrument for a specified date.

* **Constructor Parameters:**
  * `date (str)`: The date for which the high price is to be fetched.
* **Methods:**
  * `execute(self, data_provider)`: Calls `data_provider.get_high(self.date)` to retrieve the highest price for the specified date.

**Example Usage:**

```python
high_command = HighCommand(date="2023-09-02")
high_price = high_command.execute(data_provider)
```

***

**Low\_Command**

Retrieves the lowest price of a market instrument for a specified date.

* **Constructor Parameters:**
  * `date (str)`: The date for which the low price is to be fetched.
* **Methods:**
  * `execute(self, data_provider)`: Calls `data_provider.get_low(self.date)` to retrieve the lowest price for the specified date.

**Example Usage:**

```python
low_command = LowCommand(date="2023-09-02")
low_price = low_command.execute(data_provider)
```

***

**Close\_Command**

Retrieves the closing price of a market instrument for a specified date.

* **Constructor Parameters:**
  * `date (str)`: The date for which the close price is to be fetched.
* **Methods:**
  * `execute(self, data_provider)`: Calls `data_provider.get_close(self.date)` to retrieve the closing price for the specified date.

**Example Usage:**

```python
close_command = CloseCommand(date="2023-09-02")
close_price = close_command.execute(data_provider)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://quantitative-algorithms-by-max-h.gitbook.io/predator-trading-system/overview/predator-script-documentation/predator-script/commands/core.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.
