This commit is contained in:
Ichinga Samuel
2024-02-12 21:09:28 +01:00
parent 3f53df8375
commit b01e58ee08
68 changed files with 2986 additions and 6869 deletions
+34 -40
View File
@@ -1,56 +1,50 @@
<a id="aiomql.result"></a>
# Result
# aiomql.result
<a id="aiomql.result.Result"></a>
## Result Objects
## Table of Contents
- [Result](#result)
- [__init__](#__init__)
- [get_data](#get_data)
- [to_csv](#to_csv)
<a id="result"></a>
```python
class Result()
```
A base class for handling trade results and strategy parameters for record keeping and analysis.
#### Attributes
| Name | Type | Description |
|--------------|-------------------|-----------------------------------|
| `result` | `OrderSendResult` | The result of the trade |
| `parameters` | `dict` | The parameters used for the trade |
| `name` | `str` | The name of the result object |
A base class for handling trade results and strategy parameters for record keeping and reference purpose.
The data property must be implemented in the subclass
**Attributes**:
- `config` _Config_ - The configuration object
- `name` - Any desired name for the result file object
<a id="aiomql.result.Result.__init__"></a>
#### \_\_init\_\_
<a id="__init__"></a>
### \_\_init\_\_
```python
def __init__(result: OrderSendResult, parameters: dict = None, name: str = '')
```
Prepare result data for record keeping and analysis.
#### Parameters
| Name | Type | Description |
|--------------|-------------------|-----------------------------------|
| `result` | `OrderSendResult` | The result of the trade |
| `parameters` | `dict` | The parameters used for the trade |
| `name` | `str` | The name of the result object |
Prepare result data
**Arguments**:
result:
parameters:
name:
<a id="aiomql.result.Result.to_csv"></a>
#### to\_csv
<a id="get_data"></a>
```python
def get_data(self) -> dict:
```
Get the result data as a dictionary
#### Returns
| Type | Description |
|--------|-----------------|
| `dict` | The result data |
<a id="to_csv"></a>
### to\_csv
```python
async def to_csv()
```
Record trade results and associated parameters as a csv file
<a id="aiomql.result.Result.save_csv"></a>
#### save\_csv
```python
async def save_csv()
```
Save trade results and associated parameters as a csv file in a separate thread