Actions8
- Trading Actions
- Quantitative Account Actions
Overview
This node interacts with the MyPet Stocks quantitative trading system, specifically focusing on managing and retrieving information about quantitative accounts. The "Get All Accounts" operation under the "Quantitative Account" resource allows users to fetch a paginated list of all quantitative accounts with optional filters such as account name, ID, type, nature (real or demo), and status (active or inactive).
This operation is useful for scenarios where you need to:
- Retrieve an overview of all quantitative trading accounts.
- Filter accounts based on specific criteria to analyze or report on subsets of accounts.
- Integrate account data into workflows for further processing or decision-making.
For example, a user might want to get all active real MT5 accounts on page 2 with 50 accounts per page to monitor their statuses or perform batch updates.
Properties
| Name | Meaning |
|---|---|
| Page Number | The page number of results to retrieve (pagination). |
| Page Size | The number of records to return per page. |
| Filter by Name | Optional filter to search accounts by their name. |
| Filter by Account ID | Optional filter to search accounts by their quantitative account ID. |
| Filter by Account Type | Optional filter to select account type: All, MT4, or MT5. |
| Filter by Account Nature | Optional filter to select account nature: All, Real Account, or Demo Account. |
| Filter by Status | Optional filter to select account status: All, Active, or Inactive. |
Output
The output JSON contains the following structure:
message: A message string from the API response.code: Numeric code indicating success or failure of the API call.pagination: An object containing pagination details:totalCount: Total number of matching accounts.nextPage: URL or indicator for the next page if available.previousPage: URL or indicator for the previous page if available.
accounts: An array of quantitative account objects returned by the API, each including details such as account ID, name, type, status, etc.queryParams: The query parameters used in the request, reflecting the filters and pagination applied.
Example snippet of output JSON:
{
"message": "Success",
"code": 0,
"pagination": {
"totalCount": 100,
"nextPage": "...",
"previousPage": null
},
"accounts": [
{
"id": 123,
"accountId": "ACC001",
"name": "Main Trading Account",
"account_type": "mt5",
"is_real": true,
"status": true,
...
}
],
"queryParams": {
"pageNum": "1",
"pageSize": "20",
"name": "",
"accountId": "",
"account_type": "",
"is_real": "",
"status": ""
}
}
Dependencies
- Requires an API key credential for the MyPet Stocks API with base URL and authentication details.
- The node uses HTTP requests to communicate with the MyPet Stocks API endpoints.
- Authentication can be done via token or username/password credentials.
- Proper configuration of credentials in n8n is necessary for successful API calls.
Troubleshooting
- Authentication failures: If the node throws errors related to authentication, verify that the correct authentication method is selected and credentials are valid.
- Query failed errors: These indicate issues with the API request or server-side problems. Check the error message for details.
- Empty or missing results: Ensure that the filters and pagination parameters are correctly set; incorrect filters may result in no data.
- Permission errors when deleting or updating accounts: Make sure the API user has sufficient permissions and that the account exists and is in the correct state (e.g., only inactive accounts can be deleted).
- Invalid input errors: Required fields must be provided; missing or malformed inputs will cause errors.
Links and References
- MyPet Stocks API documentation (not provided here, but typically available from the service provider)
- n8n documentation on creating and using custom nodes: https://docs.n8n.io/integrations/creating-nodes/
- General REST API usage and authentication best practices