FAQ

Deployment

Q1: Failed to load Backtest plugin during initialization.

Ensure that all nodes (including controller, compute, and data nodes) have correctly installed and loaded Backtest and MatchingEngineSimulator plugins.

Q2: Failed to access Starfish after restarting DolphinDB server: Failed to load module [starfish::facplfRun].

Make sure all nodes have preloaded the backtest plugin. Add the following line to the configuration files:

preloadModules=plugins::MatchingEngineSimulator,plugins::Backtest

Q3: Failed to run init.dos:Can’t find module [starfish::facplfEnv].

Use getHomeDir() function to check whether the Starfish modules files exist in the DolphinDB server modules directory. In cluster deployment, make sure every node’s modules directory contains the Starfish modules files.

Q4: Starfish is accessible via URL after initialization while cannot be accessed through Web Interface.

Ensure that you have logged into the Web Interface of the control node.

Platform

Q1: Cannot find Factors & Evaluation or Strategy & Backtest modules after login.

System admin can follow these steps om System Managementpage:

  1. Assign the user to a department.
  2. Grant the user Factor Module or Strategy Module permissions.

After completing, the user can refresh the page to see the modules accordingly.

Q2: How to delete an approved factor or strategy?

Department admins or reviewers can follow these steps:

  1. Go to Public Library module.
  2. Select the department from which the factor or strategy is submitted.
  3. Click Delete.

Factor

Q1: Can I wrap an existing factor or develop a derived factor?

Yes. You can call public or private factor modules. For example, if a module factor1 has a factor ma, you can use it in module factor2 by factor1::ma.

Q2: What are the built-in factors in Starfish?

You can go to Public Library > Factor Module to view the built-in factors, including WorldQuant Alpha 101 and other common libraries.

Q3: What’s the difference between My Factors, Run Templates, and Evaluation Templates?

  • My Factors: Contains modules of multiple factors.
  • Run Templates: Defines how to apply factor code to the data. For example, how to extract the data required for calculating a factor from the data source, and how to map the fields in the data source to the parameters of the factor.
  • Evaluation Templates: Evaluates the results of factor calculations.

Q4: What are the parameters required for factor run templates?

A factor run template is a function. Therefore, the parameters of the function are the inputs required to execute the template. The data types is the same with the type of content being passed in. Special data types include:

  • Database selection: Passes the selected database handle.
  • Table selection: Passes the selected table.
  • Column selection: Passes the selected column.
  • Previous template result: Passes the output from the previous factor run template.
  • Factor parameter: Passes the selected factor and its factor module. For exam: alpha::alpha101.

Q5: Failed to run Alphalens evaluation template: Column index is out of range.

Check the parameter period. Currently, users can only specify 3 rebalance period. For example: 1,5,10.

Q6: Failed to run Alphalens evaluation template: Not allowed to create a void vector. RefId:S05005.

Check whether the factor values are all null values.

Q7: Why are the factor results displayed partially?

Only 100 records are displayed to help users check whether the results meet the expectation.

Strategy

Q1: How to use factors from the Public Library to backtest indicators?Use Factor Module name::Factor name format. For example, to use rsi from the ta library:

def initialize(mutable context) {
    d=dict(STRING,ANY)
	d["RSI"]=<ta::rsi(close, 14)>
	Backtest::subscribeIndicator(context["engine"], "kline", d)
}

Workflow

Q1: Are tasks in the workflow executed sequentially?

Yes. Each task waits for the previous task to finish. If any task fails, the subsequent tasks will not be executed.

Q2: What’s the difference between running factor task in workflow and running factor tests directly?

You can choose whether to load the results into a database when running factor task in workflow and specify the database and table if needed.

Visualization Template

Q1: What are the types of visualization templates?

There are two types:

  • Templates based on executed tasks, including factor run, factor evaluation, strategy backtest, and attribution.

  • Custom templates for any data.

The first type does not support additional parameters, while custom templates allow user-defined parameters.

Q2: What is the resultList parameter in templates based on executed tasks?

For templates based on executed tasks, execution results are passed as tuples to the code. For example, if two exec histories of factors are selected: resultList[0] is a table indicating exec history of the first factor and resultList[1] is a table indicating exec history of the second factor. In practice, you can merge two exec histories for correlation analysis. For example:

def prepareData(resultList) {
  factor1 = resultList[0]
  factor2 = resultList[1]
  unionFactor = select *, corr(factor1.value, factor2.value) as corr from lj(factor1, factor2, `tradeTime`securityid) limit 100
  return dict(['rest'], [unionFactor])
}