optimizer – Parallel optimizers

class quantworks.optimizer.server.Results(parameters, result)

Bases: object

The results of the strategy executions.

getParameters()

Returns a sequence of parameter values.

getResult()

Returns the result for a given set of parameters.

quantworks.optimizer.server.serve(barFeed, strategyParameters, address, port, batchSize=200)

Executes a server that will provide bars and strategy parameters for workers to use.

Parameters:
  • barFeed (quantworks.barfeed.BarFeed.) – The bar feed that each worker will use to backtest the strategy.
  • strategyParameters – The set of parameters to use for backtesting. An iterable object where each element is a tuple that holds parameter values.
  • address (string.) – The address to listen for incoming worker connections.
  • port (int.) – The port to listen for incoming worker connections.
  • batchSize (int.) – The number of strategy executions that are delivered to each worker.
Return type:

A Results instance with the best results found or None if no results were obtained.

Note

  • The server component will split strategy executions in chunks which are distributed among the different workers. You can optionally set the chunk size by passing in batchSize to the constructor of quantworks.optimizer.xmlrpcserver.Server.
  • The quantworks.strategy.BaseStrategy.getResult() method is used to select the best strategy execution. You can override that method to rank executions using a different criteria.