MyPet Stocks icon

MyPet Stocks

Interact with MyPet Stocks quantitative trading system

Overview

This node integrates with the MyPet Stocks quantitative trading system, enabling users to query and manage various aspects of their trading accounts and orders. Specifically, the "Trading" resource with the "Query Trade Orders" operation allows users to retrieve detailed trade order data filtered by multiple criteria such as account, position type, trade type, symbol, time ranges, and more.

Common scenarios for this node include:

  • Retrieving paginated lists of trade orders for analysis or reporting.
  • Filtering orders by status (open/closed), trade direction (buy/sell), or specific symbols.
  • Monitoring abnormal or suspicious orders by applying filters.
  • Querying trades within specific open or close time windows in Beijing time zone.

Practical example:
A trader wants to fetch all closed buy orders for a particular stock account within a date range to analyze performance. They can set the position filter to "Closed Positions," trade type to "Buy (Long)," specify the stock account ID, and provide open or close time start/end parameters to get the relevant orders.

Properties

Name Meaning
Page Number Page number to query (pagination control).
Page Size Number of records per page (pagination control).
Filter Abnormal Orders Boolean flag to filter only abnormal orders if true.
Stock Account ID Quantitative account ID to filter orders belonging to a specific trading account.
Position Position type to query: All, Open Positions, or Closed Positions.
Trade Type Trade type filter: All, Buy (Long), Sell (Short), or Balance (Deposit/Withdrawal).
Symbol Trading symbol filter (e.g., USDJPY, NAS100).
Ticket Number Specific trade order ticket number to filter.
Magic Number Magic number used for Expert Advisor (EA) identification.
Comment Order comment text filter.
Open Time Start (Beijing) Start datetime for filtering orders by open time (Beijing timezone).
Open Time End (Beijing) End datetime for filtering orders by open time (Beijing timezone).
Close Time Start (Beijing) Start datetime for filtering orders by close time (Beijing timezone).
Close Time End (Beijing) End datetime for filtering orders by close time (Beijing timezone).

Output

The output JSON object contains the following fields:

  • message: Response message from the API.
  • code: Status code indicating success or failure.
  • totalCount: Total number of matching trade orders.
  • nextPage: URL or indicator for the next page of results (if any).
  • previousPage: URL or indicator for the previous page of results (if any).
  • orders: Array of trade order objects containing detailed information about each order.
  • orderInfo: Additional metadata or summary information about the queried orders.
  • queryParams: The actual query parameters sent to the API, useful for debugging or logging.
  • authToken: Partial token string used for authentication (masked for security).

The node does not output binary data.

Dependencies

  • Requires an API key credential for the MyPet Stocks API with either username/password or token-based authentication.
  • The base URL for the API must be configured in the credentials.
  • The node uses HTTP requests to communicate with the MyPet Stocks API endpoints.
  • Proper permissions and valid credentials are necessary to access trading data.

Troubleshooting

  • Authentication errors: If the node throws errors like "Authentication failed," verify that the correct authentication method is selected in credentials and that the username/password or token is valid.
  • No credentials found: Ensure that the MyPet Stocks API credentials are properly set up and linked to the node.
  • Invalid authentication method: The node expects either username/password or token authentication; other methods will cause errors.
  • Query failures: Errors with messages like "Query failed" usually indicate issues with the API request parameters or server-side problems. Check the filter values and ensure they conform to expected formats.
  • Pagination issues: If pagination parameters are incorrect, the node may return empty results or fail to paginate properly.
  • Empty or missing required parameters: Some filters like custom date ranges require both start and end times; missing these will cause errors.
  • API rate limits or network issues: These can cause intermittent failures; retry or check network connectivity.

Links and References


If you need summaries for other resources or operations, please provide their names.

Discussion