Actions8
- Trading Actions
- Quantitative Account Actions
Overview
The "Get Account Trading Status" operation in the MyPet Stocks node retrieves real-time trading status information for multiple trading accounts. It supports pagination and various filters such as account ID, account name, status (active/inactive), account type (MT4/MT5), and account nature (real/demo). This operation is useful for monitoring the current state of trading accounts, assessing balances, equity, margin, profits, and other key trading metrics across accounts.
Practical examples:
- A portfolio manager can use this operation to get an overview of all active trading accounts and their current balances and profits.
- A risk analyst might filter accounts by type or status to focus on demo accounts or inactive accounts for auditing purposes.
- Automated workflows can periodically fetch updated trading statuses to trigger alerts or reports based on account performance.
Properties
| Name | Meaning |
|---|---|
| Page Number | The page number of results to retrieve (pagination control). |
| Page Size | Number of records per page to return (pagination control). |
| Filter by Account | Optionally filter results by a specific trading account ID. |
| Filter by Name | Optionally filter results by account name (partial match). |
| Filter by Status | Optionally filter accounts by status: All, Active, or Inactive. |
| Filter by Account Type | Optionally filter accounts by type: All, MT4, or MT5. |
| Filter by Account Nature | Optionally filter accounts by nature: All, Real Account, or Demo Account. |
Output
The output JSON contains the following main fields:
message: Response message from the API.code: Numeric status code indicating success or failure.pagination: Object with pagination details including total count, current page, page size, and flags for next/previous pages.accounts: An array of account objects, each containing:id,username,name,accountIdstatus(active/inactive)isReal(real/demo)capitalTypetradingStats: Detailed trading statistics such as balance, equity, margin, free margin, floating profit, total lots traded, buy/sell lots and profits, holding stats, remote address, last update time, and add time.
summary: Aggregated summary statistics across all returned accounts, including counts of total, active, real, and demo accounts, as well as sums of balances, equity, floating profits, and lots.filters: Echoes back the applied filter parameters.
This structured output allows users to analyze both individual account statuses and overall portfolio health.
Dependencies
- Requires an API key credential for the MyPet Stocks quantitative trading system.
- The node uses HTTP requests to the MyPet Stocks API endpoints.
- Authentication can be done via username/password or token; the node handles token retrieval automatically if needed.
- The base URL for the API must be configured in the credentials.
Troubleshooting
- Authentication failures: Errors like "Authentication failed" indicate invalid credentials or incorrect authentication method. Ensure correct username/password or valid token is provided.
- Query failures: If the API returns errors with messages, they are surfaced as node errors. Check the message for details (e.g., invalid parameters).
- Empty results: If no accounts match the filters, the accounts array will be empty. Adjust filters accordingly.
- Pagination issues: Ensure page number and size are within valid ranges supported by the API.
- Permission errors: If the API denies access, verify that the API key has sufficient permissions.
Links and References
- MyPet Stocks API Documentation (replace with actual link if available)
- n8n Documentation on Creating Custom Nodes
- General info on Trading Account Management