/// <summary>
/// List personal trading history Spot and margin trades are queried by default. If cross margin trades are needed, `account` must be set to `cross_margin` You can also set `from` and(or) `to` to query by time range Time range parameters are handled as order finish time.
/// </summary>
/// <exception cref="Io.Gate.GateApi.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="currencyPair">Retrieve results with specified currency pair. **It is required for open orders, but optional for finished ones.**</param>
/// <param name="limit">Maximum number of records to be returned in a single list (optional, default to 100)</param>
/// <param name="page">Page number (optional, default to 1)</param>
/// <param name="orderId">Filter trades with specified order ID. `currency_pair` is also required if this field is present (optional)</param>
/// <param name="account">Specify operation account. Default to spot and margin account if not specified. Set to `cross_margin` to operate against margin account (optional)</param>
/// <param name="from">Start timestamp of the query (optional)</param>
/// <param name="to">Time range ending, default to current time (optional)</param>
/// <returns>ApiResponse of List<Trade></returns>
public ApiResponse<List<Trade>> ListMyTradesWithHttpInfo (string currencyPair, int? limit = default(int?), int? page = default(int?), string orderId = default(string), string account = default(string), long? from = default(long?), long? to = default(long?))
{
// verify the required parameter 'currencyPair' is set
**if (currencyPair == null)
throw new ApiException(400, "Missing required parameter 'currencyPair' when calling SpotApi->ListMyTrades");**