Lean
$LEAN_TAG$
|
QuantConnect.com Interaction Via API. More...
Public Member Functions | |
Api () | |
Creates a new instance of Api More... | |
virtual void | Initialize (int userId, string token, string dataFolder) |
Initialize the API with the given variables More... | |
ProjectResponse | CreateProject (string name, Language language, string organizationId=null) |
Create a project with the specified name and language via QuantConnect.com API More... | |
ProjectResponse | ReadProject (int projectId) |
Get details about a single project More... | |
ProjectResponse | ListProjects () |
List details of all projects More... | |
RestResponse | AddProjectFile (int projectId, string name, string content) |
Add a file to a project More... | |
RestResponse | UpdateProjectFileName (int projectId, string oldFileName, string newFileName) |
Update the name of a file More... | |
RestResponse | UpdateProjectFileContent (int projectId, string fileName, string newFileContents) |
Update the contents of a file More... | |
ProjectFilesResponse | ReadProjectFiles (int projectId) |
Read all files in a project More... | |
ProjectNodesResponse | ReadProjectNodes (int projectId) |
Read all nodes in a project. More... | |
ProjectNodesResponse | UpdateProjectNodes (int projectId, string[] nodes) |
Update the active state of some nodes to true. If you don't provide any nodes, all the nodes become inactive and AutoSelectNode is true. More... | |
ProjectFilesResponse | ReadProjectFile (int projectId, string fileName) |
Read a file in a project More... | |
VersionsResponse | ReadLeanVersions () |
Gets a list of LEAN versions with their corresponding basic descriptions More... | |
RestResponse | DeleteProjectFile (int projectId, string name) |
Delete a file in a project More... | |
RestResponse | DeleteProject (int projectId) |
Delete a project More... | |
Compile | CreateCompile (int projectId) |
Create a new compile job request for this project id. More... | |
Compile | ReadCompile (int projectId, string compileId) |
Read a compile packet job result. More... | |
virtual RestResponse | SendNotification (Notification notification, int projectId) |
Sends a notification More... | |
Backtest | CreateBacktest (int projectId, string compileId, string backtestName) |
Create a new backtest request and get the id. More... | |
Backtest | ReadBacktest (int projectId, string backtestId, bool getCharts=true) |
Read out a backtest in the project id specified. More... | |
List< ApiOrderResponse > | ReadBacktestOrders (int projectId, string backtestId, int start=0, int end=100) |
Returns the orders of the specified backtest and project id. More... | |
ReadChartResponse | ReadBacktestChart (int projectId, string name, int start, int end, uint count, string backtestId) |
Returns a requested chart object from a backtest More... | |
RestResponse | UpdateBacktest (int projectId, string backtestId, string name="", string note="") |
Update a backtest name More... | |
BacktestSummaryList | ListBacktests (int projectId, bool includeStatistics=true) |
List all the backtest summaries for a project More... | |
RestResponse | DeleteBacktest (int projectId, string backtestId) |
Delete a backtest from the specified project and backtestId. More... | |
RestResponse | UpdateBacktestTags (int projectId, string backtestId, IReadOnlyCollection< string > tags) |
Updates the tags collection for a backtest More... | |
InsightResponse | ReadBacktestInsights (int projectId, string backtestId, int start=0, int end=0) |
Read out the insights of a backtest More... | |
CreateLiveAlgorithmResponse | CreateLiveAlgorithm (int projectId, string compileId, string nodeId, Dictionary< string, object > brokerageSettings, string versionId="-1", Dictionary< string, object > dataProviders=null) |
Create a live algorithm. More... | |
CreateLiveAlgorithmResponse | CreateLiveAlgorithm (int projectId, string compileId, string nodeId, PyObject brokerageSettings, string versionId="-1", PyObject dataProviders=null) |
Create a live algorithm. More... | |
LiveList | ListLiveAlgorithms (AlgorithmStatus? status=null, DateTime? startTime=null, DateTime? endTime=null) |
Get a list of live running algorithms for user More... | |
LiveAlgorithmResults | ReadLiveAlgorithm (int projectId, string deployId) |
Read out a live algorithm in the project id specified. More... | |
PortfolioResponse | ReadLivePortfolio (int projectId) |
Read out the portfolio state of a live algorithm More... | |
List< ApiOrderResponse > | ReadLiveOrders (int projectId, int start=0, int end=100) |
Returns the orders of the specified project id live algorithm. More... | |
RestResponse | LiquidateLiveAlgorithm (int projectId) |
Liquidate a live algorithm from the specified project and deployId. More... | |
RestResponse | StopLiveAlgorithm (int projectId) |
Stop a live algorithm from the specified project and deployId. More... | |
RestResponse | CreateLiveCommand (int projectId, object command) |
Create a live command More... | |
LiveLog | ReadLiveLogs (int projectId, string algorithmId, int startLine, int endLine) |
Gets the logs of a specific live algorithm More... | |
ReadChartResponse | ReadLiveChart (int projectId, string name, int start, int end, uint count) |
Returns a chart object from a live algorithm More... | |
InsightResponse | ReadLiveInsights (int projectId, int start=0, int end=0) |
Read out the insights of a live algorithm More... | |
DataLink | ReadDataLink (string filePath, string organizationId) |
Gets the link to the downloadable data. More... | |
DataList | ReadDataDirectory (string filePath) |
Get valid data entries for a given filepath from data/list More... | |
DataPricesList | ReadDataPrices (string organizationId) |
Gets data prices from data/prices More... | |
BacktestReport | ReadBacktestReport (int projectId, string backtestId) |
Read out the report of a backtest in the project id specified. More... | |
bool | DownloadData (string filePath, string organizationId) |
Method to purchase and download data from QuantConnect More... | |
virtual AlgorithmControl | GetAlgorithmStatus (string algorithmId) |
Get the algorithm status from the user with this algorithm id. More... | |
virtual void | SetAlgorithmStatus (string algorithmId, AlgorithmStatus status, string message="") |
Algorithm passes back its current status to the UX. More... | |
virtual void | SendStatistics (string algorithmId, decimal unrealized, decimal fees, decimal netProfit, decimal holdings, decimal equity, decimal netReturn, decimal volume, int trades, double sharpe) |
Send the statistics to storage for performance tracking. More... | |
virtual void | SendUserEmail (string algorithmId, string subject, string body) |
Send an email to the user associated with the specified algorithm id More... | |
virtual string | Download (string address, IEnumerable< KeyValuePair< string, string >> headers, string userName, string password) |
Local implementation for downloading data to algorithms More... | |
virtual byte[] | DownloadBytes (string address, IEnumerable< KeyValuePair< string, string >> headers, string userName, string password) |
Local implementation for downloading data to algorithms More... | |
virtual void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
Account | ReadAccount (string organizationId=null) |
Will read the organization account status More... | |
Organization | ReadOrganization (string organizationId=null) |
Fetch organization data from web API More... | |
Estimate | EstimateOptimization (int projectId, string name, string target, string targetTo, decimal? targetValue, string strategy, string compileId, HashSet< OptimizationParameter > parameters, IReadOnlyList< Constraint > constraints) |
Estimate optimization with the specified parameters via QuantConnect.com API More... | |
OptimizationSummary | CreateOptimization (int projectId, string name, string target, string targetTo, decimal? targetValue, string strategy, string compileId, HashSet< OptimizationParameter > parameters, IReadOnlyList< Constraint > constraints, decimal estimatedCost, string nodeType, int parallelNodes) |
Create an optimization with the specified parameters via QuantConnect.com API More... | |
List< OptimizationSummary > | ListOptimizations (int projectId) |
List all the optimizations for a project More... | |
Optimization | ReadOptimization (string optimizationId) |
Read an optimization More... | |
RestResponse | AbortOptimization (string optimizationId) |
Abort an optimization More... | |
RestResponse | UpdateOptimization (string optimizationId, string name=null) |
Update an optimization More... | |
RestResponse | DeleteOptimization (string optimizationId) |
Delete an optimization More... | |
bool | GetObjectStore (string organizationId, List< string > keys, string destinationFolder=null) |
Download the object store files associated with the given organization ID and key More... | |
PropertiesObjectStoreResponse | GetObjectStoreProperties (string organizationId, string key) |
Get Object Store properties given the organization ID and the Object Store key More... | |
RestResponse | SetObjectStore (string organizationId, string key, byte[] objectData) |
Upload files to the Object Store More... | |
RestResponse | DeleteObjectStore (string organizationId, string key) |
Request to delete Object Store metadata of a specific organization and key More... | |
ListObjectStoreResponse | ListObjectStore (string organizationId, string path) |
Request to list Object Store files of a specific organization and path More... | |
Static Public Member Functions | |
static string | CreateSecureHash (int timestamp, string token) |
Generate a secure hash for the authorization headers. More... | |
static string | FormatPathForDataRequest (string filePath, string dataFolder=null) |
Helper method to normalize path for api data requests More... | |
Public Attributes | |
bool | Connected => ApiConnection.Connected |
Check if Api is successfully connected with correct credentials More... | |
Properties | |
JsonSerializerSettings | SerializerSettings [get, set] |
Serializer settings to use More... | |
ApiConnection | ApiConnection [get] |
Returns the underlying API connection More... | |
QuantConnect.Api.Api.Api | ( | ) |
|
virtual |
Initialize the API with the given variables
Implements QuantConnect.Interfaces.IApi.
ProjectResponse QuantConnect.Api.Api.CreateProject | ( | string | name, |
Language | language, | ||
string | organizationId = null |
||
) |
Create a project with the specified name and language via QuantConnect.com API
name | Project name |
language | Programming language to use |
organizationId | Optional param for specifying organization to create project under. If none provided web defaults to preferred. |
Implements QuantConnect.Interfaces.IApi.
ProjectResponse QuantConnect.Api.Api.ReadProject | ( | int | projectId | ) |
Get details about a single project
projectId | Id of the project |
Implements QuantConnect.Interfaces.IApi.
ProjectResponse QuantConnect.Api.Api.ListProjects | ( | ) |
List details of all projects
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.AddProjectFile | ( | int | projectId, |
string | name, | ||
string | content | ||
) |
Add a file to a project
projectId | The project to which the file should be added |
name | The name of the new file |
content | The content of the new file |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.UpdateProjectFileName | ( | int | projectId, |
string | oldFileName, | ||
string | newFileName | ||
) |
Update the name of a file
projectId | Project id to which the file belongs |
oldFileName | The current name of the file |
newFileName | The new name for the file |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.UpdateProjectFileContent | ( | int | projectId, |
string | fileName, | ||
string | newFileContents | ||
) |
Update the contents of a file
projectId | Project id to which the file belongs |
fileName | The name of the file that should be updated |
newFileContents | The new contents of the file |
Implements QuantConnect.Interfaces.IApi.
ProjectFilesResponse QuantConnect.Api.Api.ReadProjectFiles | ( | int | projectId | ) |
Read all files in a project
projectId | Project id to which the file belongs |
Implements QuantConnect.Interfaces.IApi.
ProjectNodesResponse QuantConnect.Api.Api.ReadProjectNodes | ( | int | projectId | ) |
Read all nodes in a project.
projectId | Project id to which the nodes refer |
Implements QuantConnect.Interfaces.IApi.
ProjectNodesResponse QuantConnect.Api.Api.UpdateProjectNodes | ( | int | projectId, |
string[] | nodes | ||
) |
Update the active state of some nodes to true. If you don't provide any nodes, all the nodes become inactive and AutoSelectNode is true.
projectId | Project id to which the nodes refer |
nodes | List of node ids to update |
Implements QuantConnect.Interfaces.IApi.
ProjectFilesResponse QuantConnect.Api.Api.ReadProjectFile | ( | int | projectId, |
string | fileName | ||
) |
Read a file in a project
projectId | Project id to which the file belongs |
fileName | The name of the file |
Implements QuantConnect.Interfaces.IApi.
VersionsResponse QuantConnect.Api.Api.ReadLeanVersions | ( | ) |
Gets a list of LEAN versions with their corresponding basic descriptions
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.DeleteProjectFile | ( | int | projectId, |
string | name | ||
) |
Delete a file in a project
projectId | Project id to which the file belongs |
name | The name of the file that should be deleted |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.DeleteProject | ( | int | projectId | ) |
Delete a project
projectId | Project id we own and wish to delete |
Implements QuantConnect.Interfaces.IApi.
Compile QuantConnect.Api.Api.CreateCompile | ( | int | projectId | ) |
Create a new compile job request for this project id.
projectId | Project id we wish to compile. |
Implements QuantConnect.Interfaces.IApi.
Compile QuantConnect.Api.Api.ReadCompile | ( | int | projectId, |
string | compileId | ||
) |
Read a compile packet job result.
projectId | Project id we sent for compile |
compileId | Compile id return from the creation request |
Implements QuantConnect.Interfaces.IApi.
|
virtual |
Sends a notification
notification | The notification to send |
projectId | The project id |
Implements QuantConnect.Interfaces.IApi.
Backtest QuantConnect.Api.Api.CreateBacktest | ( | int | projectId, |
string | compileId, | ||
string | backtestName | ||
) |
Create a new backtest request and get the id.
projectId | Id for the project to backtest |
compileId | Compile id for the project |
backtestName | Name for the new backtest |
Implements QuantConnect.Interfaces.IApi.
Backtest QuantConnect.Api.Api.ReadBacktest | ( | int | projectId, |
string | backtestId, | ||
bool | getCharts = true |
||
) |
Read out a backtest in the project id specified.
projectId | Project id to read |
backtestId | Specific backtest id to read |
getCharts | True will return backtest charts |
Implements QuantConnect.Interfaces.IApi.
List<ApiOrderResponse> QuantConnect.Api.Api.ReadBacktestOrders | ( | int | projectId, |
string | backtestId, | ||
int | start = 0 , |
||
int | end = 100 |
||
) |
Returns the orders of the specified backtest and project id.
projectId | Id of the project from which to read the orders |
backtestId | Id of the backtest from which to read the orders |
start | Starting index of the orders to be fetched. Required if end > 100 |
end | Last index of the orders to be fetched. Note that end - start must be less than 100 |
Will throw an WebException if there are any API errors
ReadChartResponse QuantConnect.Api.Api.ReadBacktestChart | ( | int | projectId, |
string | name, | ||
int | start, | ||
int | end, | ||
uint | count, | ||
string | backtestId | ||
) |
Returns a requested chart object from a backtest
projectId | Project ID of the request |
name | The requested chart name |
start | The Utc start seconds timestamp of the request |
end | The Utc end seconds timestamp of the request |
count | The number of data points to request |
backtestId | Associated Backtest ID for this chart request |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.UpdateBacktest | ( | int | projectId, |
string | backtestId, | ||
string | name = "" , |
||
string | note = "" |
||
) |
Update a backtest name
projectId | Project for the backtest we want to update |
backtestId | Backtest id we want to update |
name | Name we'd like to assign to the backtest |
note | Note attached to the backtest |
Implements QuantConnect.Interfaces.IApi.
BacktestSummaryList QuantConnect.Api.Api.ListBacktests | ( | int | projectId, |
bool | includeStatistics = true |
||
) |
List all the backtest summaries for a project
projectId | Project id we'd like to get a list of backtest for |
includeStatistics | True for include statistics in the response, false otherwise |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.DeleteBacktest | ( | int | projectId, |
string | backtestId | ||
) |
Delete a backtest from the specified project and backtestId.
projectId | Project for the backtest we want to delete |
backtestId | Backtest id we want to delete |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.UpdateBacktestTags | ( | int | projectId, |
string | backtestId, | ||
IReadOnlyCollection< string > | tags | ||
) |
Updates the tags collection for a backtest
projectId | Project for the backtest we want to update |
backtestId | Backtest id we want to update |
tags | The new backtest tags |
InsightResponse QuantConnect.Api.Api.ReadBacktestInsights | ( | int | projectId, |
string | backtestId, | ||
int | start = 0 , |
||
int | end = 0 |
||
) |
Read out the insights of a backtest
projectId | Id of the project from which to read the backtest |
backtestId | Backtest id from which we want to get the insights |
start | Starting index of the insights to be fetched |
end | Last index of the insights to be fetched. Note that end - start must be less than 100 |
ArgumentException |
Implements QuantConnect.Interfaces.IApi.
CreateLiveAlgorithmResponse QuantConnect.Api.Api.CreateLiveAlgorithm | ( | int | projectId, |
string | compileId, | ||
string | nodeId, | ||
Dictionary< string, object > | brokerageSettings, | ||
string | versionId = "-1" , |
||
Dictionary< string, object > | dataProviders = null |
||
) |
Create a live algorithm.
projectId | Id of the project on QuantConnect |
compileId | Id of the compilation on QuantConnect |
nodeId | Id of the node that will run the algorithm |
brokerageSettings | Dictionary with brokerage specific settings. Each brokerage requires certain specific credentials in order to process the given orders. Each key in this dictionary represents a required field/credential to provide to the brokerage API and its value represents the value of that field. For example: "brokerageSettings: { "id": "Binance", "binance-api-secret": "123ABC", "binance-api-key": "ABC123"}. It is worth saying, that this dictionary must always contain an entry whose key is "id" and its value is the name of the brokerage (see <see cref="Brokerages.BrokerageName"/>)</param> <param name="versionId">The version of the Lean used to run the algorithm. -1 is master, however, sometimes this can create problems with live deployments. If you experience problems using, try specifying the version of Lean you would like to use. |
dataProviders | Dictionary with data providers credentials. Each data provider requires certain credentials in order to retrieve data from their API. Each key in this dictionary describes a data provider name and its corresponding value is another dictionary with the required key-value pairs of credential names and values. For example: "dataProviders: { "InteractiveBrokersBrokerage" : { "id": 12345, "environment" : "paper", "username": "testUsername", "password": "testPassword"}}" |
Implements QuantConnect.Interfaces.IApi.
Definition at line 813 of file Api.cs.
CreateLiveAlgorithmResponse QuantConnect.Api.Api.CreateLiveAlgorithm | ( | int | projectId, |
string | compileId, | ||
string | nodeId, | ||
PyObject | brokerageSettings, | ||
string | versionId = "-1" , |
||
PyObject | dataProviders = null |
||
) |
Create a live algorithm.
projectId | Id of the project on QuantConnect |
compileId | Id of the compilation on QuantConnect |
nodeId | Id of the node that will run the algorithm |
brokerageSettings | Python Dictionary with brokerage specific settings. Each brokerage requires certain specific credentials in order to process the given orders. Each key in this dictionary represents a required field/credential to provide to the brokerage API and its value represents the value of that field. For example: "brokerageSettings: { "id": "Binance", "binance-api-secret": "123ABC", "binance-api-key": "ABC123"}. It is worth saying, that this dictionary must always contain an entry whose key is "id" and its value is the name of the brokerage (see <see cref="Brokerages.BrokerageName"/>)</param> <param name="versionId">The version of the Lean used to run the algorithm. -1 is master, however, sometimes this can create problems with live deployments. If you experience problems using, try specifying the version of Lean you would like to use. |
dataProviders | Python Dictionary with data providers credentials. Each data provider requires certain credentials in order to retrieve data from their API. Each key in this dictionary describes a data provider name and its corresponding value is another dictionary with the required key-value pairs of credential names and values. For example: "dataProviders: { "InteractiveBrokersBrokerage" : { "id": 12345, "environment" : "paper", "username": "testUsername", "password": "testPassword"}}" |
Definition at line 862 of file Api.cs.
LiveList QuantConnect.Api.Api.ListLiveAlgorithms | ( | AlgorithmStatus? | status = null , |
DateTime? | startTime = null , |
||
DateTime? | endTime = null |
||
) |
Get a list of live running algorithms for user
status | Filter the statuses of the algorithms returned from the api |
startTime | Earliest launched time of the algorithms returned by the Api |
endTime | Latest launched time of the algorithms returned by the Api |
Implements QuantConnect.Interfaces.IApi.
Definition at line 888 of file Api.cs.
LiveAlgorithmResults QuantConnect.Api.Api.ReadLiveAlgorithm | ( | int | projectId, |
string | deployId | ||
) |
Read out a live algorithm in the project id specified.
projectId | Project id to read |
deployId | Specific instance id to read |
Implements QuantConnect.Interfaces.IApi.
PortfolioResponse QuantConnect.Api.Api.ReadLivePortfolio | ( | int | projectId | ) |
Read out the portfolio state of a live algorithm
projectId | Id of the project from which to read the live algorithm |
Implements QuantConnect.Interfaces.IApi.
List<ApiOrderResponse> QuantConnect.Api.Api.ReadLiveOrders | ( | int | projectId, |
int | start = 0 , |
||
int | end = 100 |
||
) |
Returns the orders of the specified project id live algorithm.
projectId | Id of the project from which to read the live orders |
start | Starting index of the orders to be fetched. Required if end > 100 |
end | Last index of the orders to be fetched. Note that end - start must be less than 100 |
Will throw an WebException if there are any API errors
RestResponse QuantConnect.Api.Api.LiquidateLiveAlgorithm | ( | int | projectId | ) |
Liquidate a live algorithm from the specified project and deployId.
projectId | Project for the live instance we want to stop |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.StopLiveAlgorithm | ( | int | projectId | ) |
Stop a live algorithm from the specified project and deployId.
projectId | Project for the live instance we want to stop |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.CreateLiveCommand | ( | int | projectId, |
object | command | ||
) |
Create a live command
projectId | Project for the live instance we want to run the command against |
command | The command to run |
LiveLog QuantConnect.Api.Api.ReadLiveLogs | ( | int | projectId, |
string | algorithmId, | ||
int | startLine, | ||
int | endLine | ||
) |
Gets the logs of a specific live algorithm
projectId | Project Id of the live running algorithm |
algorithmId | Algorithm Id of the live running algorithm |
startLine | Start line of logs to read |
endLine | End line of logs to read |
Implements QuantConnect.Interfaces.IApi.
ReadChartResponse QuantConnect.Api.Api.ReadLiveChart | ( | int | projectId, |
string | name, | ||
int | start, | ||
int | end, | ||
uint | count | ||
) |
Returns a chart object from a live algorithm
projectId | Project ID of the request |
name | The requested chart name |
start | The Utc start seconds timestamp of the request |
end | The Utc end seconds timestamp of the request |
count | The number of data points to request |
Implements QuantConnect.Interfaces.IApi.
InsightResponse QuantConnect.Api.Api.ReadLiveInsights | ( | int | projectId, |
int | start = 0 , |
||
int | end = 0 |
||
) |
Read out the insights of a live algorithm
projectId | Id of the project from which to read the live algorithm |
start | Starting index of the insights to be fetched |
end | Last index of the insights to be fetched. Note that end - start must be less than 100 |
ArgumentException |
Implements QuantConnect.Interfaces.IApi.
DataLink QuantConnect.Api.Api.ReadDataLink | ( | string | filePath, |
string | organizationId | ||
) |
Gets the link to the downloadable data.
filePath | File path representing the data requested |
organizationId | Organization to download from |
Implements QuantConnect.Interfaces.IApi.
Definition at line 1180 of file Api.cs.
DataList QuantConnect.Api.Api.ReadDataDirectory | ( | string | filePath | ) |
Get valid data entries for a given filepath from data/list
Implements QuantConnect.Interfaces.IApi.
Definition at line 1210 of file Api.cs.
DataPricesList QuantConnect.Api.Api.ReadDataPrices | ( | string | organizationId | ) |
Gets data prices from data/prices
Implements QuantConnect.Interfaces.IApi.
BacktestReport QuantConnect.Api.Api.ReadBacktestReport | ( | int | projectId, |
string | backtestId | ||
) |
Read out the report of a backtest in the project id specified.
projectId | Project id to read |
backtestId | Specific backtest id to read |
Implements QuantConnect.Interfaces.IApi.
bool QuantConnect.Api.Api.DownloadData | ( | string | filePath, |
string | organizationId | ||
) |
Method to purchase and download data from QuantConnect
filePath | File path representing the data requested |
organizationId | Organization to buy the data with |
Implements QuantConnect.Interfaces.IApi.
Definition at line 1297 of file Api.cs.
|
virtual |
Get the algorithm status from the user with this algorithm id.
algorithmId | String algorithm id we're searching for. |
Implements QuantConnect.Interfaces.IApi.
|
virtual |
Algorithm passes back its current status to the UX.
status | Status of the current algorithm |
algorithmId | String algorithm id we're setting. |
message | Message for the algorithm status event |
Implements QuantConnect.Interfaces.IApi.
|
virtual |
Send the statistics to storage for performance tracking.
algorithmId | Identifier for algorithm |
unrealized | Unrealized gainloss |
fees | Total fees |
netProfit | Net profi |
holdings | Algorithm holdings |
equity | Total equity |
netReturn | Net return for the deployment |
volume | Volume traded |
trades | Total trades since inception |
sharpe | Sharpe ratio since inception |
Implements QuantConnect.Interfaces.IApi.
|
virtual |
Send an email to the user associated with the specified algorithm id
algorithmId | The algorithm id |
subject | The email subject |
body | The email message body |
Implements QuantConnect.Interfaces.IApi.
|
virtual |
Local implementation for downloading data to algorithms
address | URL to download |
headers | KVP headers |
userName | Username for basic authentication |
password | Password for basic authentication |
Implements QuantConnect.Interfaces.IApi.
Definition at line 1406 of file Api.cs.
|
virtual |
Local implementation for downloading data to algorithms
address | URL to download |
headers | KVP headers |
userName | Username for basic authentication |
password | Password for basic authentication |
Stream.Close() most be called to avoid running out of resources
Implements QuantConnect.Interfaces.IApi.
Definition at line 1420 of file Api.cs.
|
virtual |
|
static |
Account QuantConnect.Api.Api.ReadAccount | ( | string | organizationId = null | ) |
Will read the organization account status
organizationId | The target organization id, if null will return default organization |
Implements QuantConnect.Interfaces.IApi.
Organization QuantConnect.Api.Api.ReadOrganization | ( | string | organizationId = null | ) |
Fetch organization data from web API
organizationId |
Implements QuantConnect.Interfaces.IApi.
Estimate QuantConnect.Api.Api.EstimateOptimization | ( | int | projectId, |
string | name, | ||
string | target, | ||
string | targetTo, | ||
decimal? | targetValue, | ||
string | strategy, | ||
string | compileId, | ||
HashSet< OptimizationParameter > | parameters, | ||
IReadOnlyList< Constraint > | constraints | ||
) |
Estimate optimization with the specified parameters via QuantConnect.com API
projectId | Project ID of the project the optimization belongs to |
name | Name of the optimization |
target | Target of the optimization, see examples in PortfolioStatistics |
targetTo | Target extremum of the optimization, for example "max" or "min" |
targetValue | Optimization target value |
strategy | Optimization strategy, QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy |
compileId | Optimization compile ID |
parameters | Optimization parameters |
constraints | Optimization constraints |
Implements QuantConnect.Interfaces.IApi.
OptimizationSummary QuantConnect.Api.Api.CreateOptimization | ( | int | projectId, |
string | name, | ||
string | target, | ||
string | targetTo, | ||
decimal? | targetValue, | ||
string | strategy, | ||
string | compileId, | ||
HashSet< OptimizationParameter > | parameters, | ||
IReadOnlyList< Constraint > | constraints, | ||
decimal | estimatedCost, | ||
string | nodeType, | ||
int | parallelNodes | ||
) |
Create an optimization with the specified parameters via QuantConnect.com API
projectId | Project ID of the project the optimization belongs to |
name | Name of the optimization |
target | Target of the optimization, see examples in PortfolioStatistics |
targetTo | Target extremum of the optimization, for example "max" or "min" |
targetValue | Optimization target value |
strategy | Optimization strategy, QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy |
compileId | Optimization compile ID |
parameters | Optimization parameters |
constraints | Optimization constraints |
estimatedCost | Estimated cost for optimization |
nodeType | Optimization node type OptimizationNodes |
parallelNodes | Number of parallel nodes for optimization |
Implements QuantConnect.Interfaces.IApi.
List<OptimizationSummary> QuantConnect.Api.Api.ListOptimizations | ( | int | projectId | ) |
List all the optimizations for a project
projectId | Project id we'd like to get a list of optimizations for |
Implements QuantConnect.Interfaces.IApi.
Optimization QuantConnect.Api.Api.ReadOptimization | ( | string | optimizationId | ) |
Read an optimization
optimizationId | Optimization id for the optimization we want to read |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.AbortOptimization | ( | string | optimizationId | ) |
Abort an optimization
optimizationId | Optimization id for the optimization we want to abort |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.UpdateOptimization | ( | string | optimizationId, |
string | name = null |
||
) |
Update an optimization
optimizationId | Optimization id we want to update |
name | Name we'd like to assign to the optimization |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.DeleteOptimization | ( | string | optimizationId | ) |
Delete an optimization
optimizationId | Optimization id for the optimization we want to delete |
Implements QuantConnect.Interfaces.IApi.
bool QuantConnect.Api.Api.GetObjectStore | ( | string | organizationId, |
List< string > | keys, | ||
string | destinationFolder = null |
||
) |
Download the object store files associated with the given organization ID and key
organizationId | Organization ID we would like to get the Object Store files from |
keys | Keys for the Object Store files |
destinationFolder | Folder in which the object store files will be stored |
Implements QuantConnect.Interfaces.IApi.
Definition at line 1755 of file Api.cs.
PropertiesObjectStoreResponse QuantConnect.Api.Api.GetObjectStoreProperties | ( | string | organizationId, |
string | key | ||
) |
Get Object Store properties given the organization ID and the Object Store key
organizationId | Organization ID we would like to get the Object Store from |
key | Key for the Object Store file |
It does not work when the object store is a directory
Implements QuantConnect.Interfaces.IApi.
Definition at line 1838 of file Api.cs.
RestResponse QuantConnect.Api.Api.SetObjectStore | ( | string | organizationId, |
string | key, | ||
byte[] | objectData | ||
) |
Upload files to the Object Store
organizationId | Organization ID we would like to upload the file to |
key | Key to the Object Store file |
objectData | File (as an array of bytes) to be uploaded |
Implements QuantConnect.Interfaces.IApi.
RestResponse QuantConnect.Api.Api.DeleteObjectStore | ( | string | organizationId, |
string | key | ||
) |
Request to delete Object Store metadata of a specific organization and key
organizationId | Organization ID we would like to delete the Object Store file from |
key | Key to the Object Store file |
Implements QuantConnect.Interfaces.IApi.
ListObjectStoreResponse QuantConnect.Api.Api.ListObjectStore | ( | string | organizationId, |
string | path | ||
) |
Request to list Object Store files of a specific organization and path
organizationId | Organization ID we would like to list the Object Store files from |
path | Path to the Object Store files |
|
static |
bool QuantConnect.Api.Api.Connected => ApiConnection.Connected |
|
getsetprotected |
|
getprotected |