submit()
Submit and run a backtest.
Interface client.submit(strategy,
start_date,
end_date,
symbols=None,
start_time=None,
end_time=None,
strategy_params={},
extra_symbols=[],
positions=None,
name=None,
description=None,
partial_fill=False,
options=None,
email=False)
Name | Type | Default | Description |
---|---|---|---|
strategy | string | required | The strategy to use in the backtest, named by the GUID on the Details tab on CQ website after removing the dashes and prefixing "CQ" to the front |
start_date | string | required | The start date for the backtest. |
end_date | string | required | The end date for the backtest. |
symbols | list | required | A list of symbols to use in the backtest. Use symbols=['__ALL_MULTI__'] for all. If you supply your own list of symbols then is_symbol_qualified will not be executed. |
start_time | string | None | The start date for the backtest. |
end_time | string | None | The end time for the backtest. |
strategy_params | dict | None | Strategy parameters for the backtest. See the init callback for more info. |
extra_symbols | list | None | Extra symbols to use in the backtest. |
name | string | None | A name for the submission. |
description | string | None | A description for the backtest. This will appear as "submission name" on CQ Website |
partial_fill | boolean | None | True or False |
options | dict | None | A dictionary of options to be given to the job server. For Fast simulation pass the key pair fast_simulation: true ie options = {"enable_line_profiling": false, "multiday_simulation": false, "fast_simulation": false, "buying_power": 5000000, "email_on_completion": false, "python_version": "2.7"} |
boolean | False | Whether or not to send an email upon submission group completion. |
Submission hash.
Example codeguid = 'ec3ba33a-9aee-49ba-aa59-8de5ea6508c7' # merely an example, which becomes:
strategy_name = 'CQ' + guid.replace('-', '') # CQec3ba33a9aee49baaa598de5ea6508c7
submission = client.submit(
strategy=strategy_name, # with "CQ" prefix and no dashes
symbols=['__ALL_MULTI__'], # or like ['SPY', 'IBM', 'HP'] etc.
start_date='2019-11-19', # ISO dates ONLY
end_date='2019-11-20',
start_time=['09:30:00', '15:57:00'], # These also accept comma-delimited
end_time=['09:31:00', '16:00:00'], # strings of times.
name='test_submit',
description='from_CQAI', # The submission name on the webpage
email=True, # Email on completion
options={'fast_simulation': False,
'python_version': '3.6'}, # Use python 3.6 (if available)
strategy_params={'ATR': 60}) # Strateegy-specific parameters
# Successful calls will print something like "Submitting <N> tests to <URL>"