MyPet Stocks icon

MyPet Stocks

Interact with MyPet Stocks quantitative trading system

Overview

This node interacts with the MyPet Stocks quantitative trading system to retrieve detailed trading statistics for a specific trading account. It allows users to query comprehensive trading data scoped by various time frames such as all time, daily, weekly, monthly, quarterly, yearly, or a custom date range.

Typical use cases include:

  • Monitoring performance metrics of a particular trading account over different periods.
  • Generating reports on trading activity and results for analysis or compliance.
  • Integrating trading statistics into automated workflows for portfolio management or alerting.

For example, a user can select a trading account and request its monthly trading details to analyze recent performance trends or specify a custom date range to audit trades during a specific period.

Properties

Name Meaning
Account Select the trading account to query.
Time Scope Time scope for the trading details query. Options: All Time, Daily, Weekly, Monthly, Quarterly, Yearly, Custom Range.
Start Date (Required if Time Scope is "Custom Range") Start date for the custom time range in YYYY-MM-DD format.
End Date (Required if Time Scope is "Custom Range") End date for the custom time range in YYYY-MM-DD format.

Output

The node outputs a JSON object containing:

  • message: Response message from the API.
  • code: Status code indicating success or failure.
  • accountId: The queried trading account ID.
  • scope: The selected time scope.
  • timeRange: If a custom range is used, an object with startTime and endTime.
  • total: Total summary value (if available).
  • details: An array of detailed trading statistics records for the account within the specified time scope.
  • summary: Summary information including:
    • totalRecords: Number of detail records returned.
    • scopeDescription: Human-readable description of the time scope.

This output provides both granular and summarized trading statistics for the selected account and time frame.

Dependencies

  • Requires an API key credential or username/password authentication configured in n8n credentials for the MyPet Stocks API.
  • The node makes HTTP requests to the MyPet Stocks API endpoints.
  • Proper network access to the API base URL is necessary.

Troubleshooting

  • Authentication Errors: If authentication fails, ensure that the correct authentication method is selected in credentials (either token or username/password) and that credentials are valid.
  • Missing Required Parameters: For custom time scopes, both start and end dates must be provided; otherwise, the node will throw an error.
  • API Errors: If the API returns an error code, the node surfaces the message. Check the message for details such as invalid account IDs or unsupported time scopes.
  • No Credentials Found: The node requires configured credentials; verify that credentials are set up correctly in n8n.
  • Network Issues: Ensure that the n8n instance has internet access and can reach the API endpoint.

Links and References

Discussion