Mariner Backtesting - Viewing Results client.results()

Getting Results

The results can be claimed for all jobs using the results() method of the client.

 results = client.results('submission_id')

The contents of the results includes the description of the submission and all tests that were run as part of that submission:

  • submission: Unique ID of submission group
  • description: User-provided description of submission
  • jobs: List of JobResults in backtest

The Result object contains the following methods: - results.get_info(): Return a list of info messages - get_trades(): Get a DataFrame of open positions from the entire submission group - get_positions(): Get a DataFrame of trades from the entire submission group

JobResult

The following are properties of the JobResult object:
- job: The unique id for the test - status: The status of the test (see above) - node: The name of the batch worker node that executed the simulation - date: A datetime.datetime object denoting which market day was being simulated - start_time: A datetime.datetime object denoting the time when the worker began executing the simulation - end_time: A datetime.datetime object denoting the time when the worker finished executing the simulation - duration: Number of seconds required to execute the simulation for that day - trades: CSV text of the trades executed for the simulation - positions: CSV text of the positions still open at the end of the simulation - info: A string with all the log messages from the simulation - console: A string with any text output to the console (exceptions will be seen here)

For example, you can run the following code to print any text output to the console by the strategy.

 print results.jobs[0].console
Getting Trades

There are two main formats that you can get backtest trade history in - a CSV file and a Pandas dataframe. To download the trades as a CSV, call client.get_trades_csv(submissions, filename="trade.csv") with a list of submissions and an optional filename. The following code will get trades for all previous submissions and put it in trades/all-trades.csv.

 client.get_trades_csv(client.submission_list(), filename="trades/all-trades.csv")

To get the trades as a Pandas dataframe object, use client.get_trades_df(submissions). A variety of operations can then be performed on the dataframe object.