Lean  $LEAN_TAG$
QuantConnect.Interfaces.IApi Interface Reference

API for QuantConnect.com More...

Inheritance diagram for QuantConnect.Interfaces.IApi:
[legend]

Public Member Functions

void Initialize (int userId, string token, string dataFolder)
 Initialize the control system 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)
 Read in a project from the QuantConnect.com API. 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 ReadProjectFile (int projectId, string fileName)
 Read a file in a project 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...
 
RestResponse DeleteProjectFile (int projectId, string name)
 Delete a file in a project More...
 
RestResponse DeleteProject (int projectId)
 Delete a specific project owned by the user from QuantConnect.com More...
 
ProjectResponse ListProjects ()
 Read back a list of all projects on the account for a user. 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...
 
Backtest CreateBacktest (int projectId, string compileId, string backtestName)
 Create a new backtest from a specified projectId and compileId More...
 
Backtest ReadBacktest (int projectId, string backtestId, bool getCharts=true)
 Read out the full result of a specific backtest More...
 
RestResponse UpdateBacktest (int projectId, string backtestId, string name="", string note="")
 Update the backtest name More...
 
RestResponse DeleteBacktest (int projectId, string backtestId)
 Delete a backtest from the specified project and backtestId. More...
 
BacktestSummaryList ListBacktests (int projectId, bool includeStatistics=false)
 Get a list of backtest summaries for a specific project id More...
 
InsightResponse ReadBacktestInsights (int projectId, string backtestId, int start=0, int end=0)
 Read out the insights of a backtest 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< OptimizationSummaryListOptimizations (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...
 
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...
 
PortfolioResponse ReadLivePortfolio (int projectId)
 Read out the portfolio state of 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...
 
ReadChartResponse ReadBacktestChart (int projectId, string name, int start, int end, uint count, string backtestId)
 Returns a requested chart object from a backtest More...
 
bool DownloadData (string filePath, string organizationId)
 Method to download and save the data purchased through QuantConnect 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...
 
CreateLiveAlgorithmResponse CreateLiveAlgorithm (int projectId, string compileId, string nodeId, Dictionary< string, object > brokerageSettings, string versionId="-1", Dictionary< string, object > dataProviders=null)
 Create a new live algorithm for a logged in user. More...
 
LiveList ListLiveAlgorithms (AlgorithmStatus? status=null, DateTime? startTime=null, DateTime? endTime=null)
 Get a list of live running algorithms for a logged in user. More...
 
LiveAlgorithmResults ReadLiveAlgorithm (int projectId, string deployId)
 Read out a live algorithm in the project id specified. More...
 
RestResponse LiquidateLiveAlgorithm (int projectId)
 Liquidate a live algorithm from the specified project. More...
 
RestResponse StopLiveAlgorithm (int projectId)
 Stop a live algorithm from the specified project. More...
 
RestResponse SendNotification (Notification notification, int projectId)
 Sends a notification More...
 
AlgorithmControl GetAlgorithmStatus (string algorithmId)
 Get the algorithm current status, active or cancelled from the user More...
 
void SetAlgorithmStatus (string algorithmId, AlgorithmStatus status, string message="")
 Set the algorithm status from the worker to update the UX e.g. if there was an error. More...
 
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...
 
void SendUserEmail (string algorithmId, string subject, string body)
 Send an email to the user associated with the specified algorithm id More...
 
string Download (string address, IEnumerable< KeyValuePair< string, string >> headers, string userName, string password)
 Local implementation for downloading data to algorithms More...
 
byte[] DownloadBytes (string address, IEnumerable< KeyValuePair< string, string >> headers, string userName, string password)
 Local implementation for downloading data to algorithms More...
 
bool GetObjectStore (string organizationId, List< string > keys, string destinationFolder=null)
 Download the object store 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...
 
VersionsResponse ReadLeanVersions ()
 Gets a list of LEAN versions with their corresponding basic descriptions More...
 

Detailed Description

API for QuantConnect.com

Definition at line 32 of file IApi.cs.

Member Function Documentation

◆ Initialize()

void QuantConnect.Interfaces.IApi.Initialize ( int  userId,
string  token,
string  dataFolder 
)

Initialize the control system

Implemented in QuantConnect.Api.Api.

Here is the caller graph for this function:

◆ CreateProject()

ProjectResponse QuantConnect.Interfaces.IApi.CreateProject ( string  name,
Language  language,
string  organizationId = null 
)

Create a project with the specified name and language via QuantConnect.com API

Parameters
nameProject name
languageProgramming language to use
organizationIdOrganization to create this project under
Returns
ProjectResponse that includes information about the newly created project

Implemented in QuantConnect.Api.Api.

◆ ReadProject()

ProjectResponse QuantConnect.Interfaces.IApi.ReadProject ( int  projectId)

Read in a project from the QuantConnect.com API.

Parameters
projectIdProject id you own
Returns
ProjectResponse about a specific project

Implemented in QuantConnect.Api.Api.

◆ AddProjectFile()

RestResponse QuantConnect.Interfaces.IApi.AddProjectFile ( int  projectId,
string  name,
string  content 
)

Add a file to a project

Parameters
projectIdThe project to which the file should be added
nameThe name of the new file
contentThe content of the new file
Returns
ProjectFilesResponse that includes information about the newly created file

Implemented in QuantConnect.Api.Api.

◆ UpdateProjectFileName()

RestResponse QuantConnect.Interfaces.IApi.UpdateProjectFileName ( int  projectId,
string  oldFileName,
string  newFileName 
)

Update the name of a file

Parameters
projectIdProject id to which the file belongs
oldFileNameThe current name of the file
newFileNameThe new name for the file
Returns
RestResponse indicating success

Implemented in QuantConnect.Api.Api.

◆ UpdateProjectFileContent()

RestResponse QuantConnect.Interfaces.IApi.UpdateProjectFileContent ( int  projectId,
string  fileName,
string  newFileContents 
)

Update the contents of a file

Parameters
projectIdProject id to which the file belongs
fileNameThe name of the file that should be updated
newFileContentsThe new contents of the file
Returns
RestResponse indicating success

Implemented in QuantConnect.Api.Api.

◆ ReadProjectFile()

ProjectFilesResponse QuantConnect.Interfaces.IApi.ReadProjectFile ( int  projectId,
string  fileName 
)

Read a file in a project

Parameters
projectIdProject id to which the file belongs
fileNameThe name of the file
Returns
ProjectFilesResponse that includes the file information

Implemented in QuantConnect.Api.Api.

◆ ReadProjectFiles()

ProjectFilesResponse QuantConnect.Interfaces.IApi.ReadProjectFiles ( int  projectId)

Read all files in a project

Parameters
projectIdProject id to which the file belongs
Returns
ProjectFilesResponse that includes the information about all files in the project

Implemented in QuantConnect.Api.Api.

◆ ReadProjectNodes()

ProjectNodesResponse QuantConnect.Interfaces.IApi.ReadProjectNodes ( int  projectId)

Read all nodes in a project.

Parameters
projectIdProject id to which the nodes refer
Returns
ProjectNodesResponse that includes the information about all nodes in the project

Implemented in QuantConnect.Api.Api.

◆ UpdateProjectNodes()

ProjectNodesResponse QuantConnect.Interfaces.IApi.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.

Parameters
projectIdProject id to which the nodes refer
nodesList of node ids to update
Returns
ProjectNodesResponse that includes the information about all nodes in the project

Implemented in QuantConnect.Api.Api.

◆ DeleteProjectFile()

RestResponse QuantConnect.Interfaces.IApi.DeleteProjectFile ( int  projectId,
string  name 
)

Delete a file in a project

Parameters
projectIdProject id to which the file belongs
nameThe name of the file that should be deleted
Returns
ProjectFilesResponse that includes the information about all files in the project

Implemented in QuantConnect.Api.Api.

◆ DeleteProject()

RestResponse QuantConnect.Interfaces.IApi.DeleteProject ( int  projectId)

Delete a specific project owned by the user from QuantConnect.com

Parameters
projectIdProject id we own and wish to delete
Returns
RestResponse indicating success

Implemented in QuantConnect.Api.Api.

◆ ListProjects()

ProjectResponse QuantConnect.Interfaces.IApi.ListProjects ( )

Read back a list of all projects on the account for a user.

Returns
Container for list of projects

Implemented in QuantConnect.Api.Api.

◆ CreateCompile()

Compile QuantConnect.Interfaces.IApi.CreateCompile ( int  projectId)

Create a new compile job request for this project id.

Parameters
projectIdProject id we wish to compile.
Returns
Compile object result

Implemented in QuantConnect.Api.Api.

◆ ReadCompile()

Compile QuantConnect.Interfaces.IApi.ReadCompile ( int  projectId,
string  compileId 
)

Read a compile packet job result.

Parameters
projectIdProject id we sent for compile
compileIdCompile id return from the creation request
Returns
Compile object result

Implemented in QuantConnect.Api.Api.

◆ CreateBacktest()

Backtest QuantConnect.Interfaces.IApi.CreateBacktest ( int  projectId,
string  compileId,
string  backtestName 
)

Create a new backtest from a specified projectId and compileId

Parameters
projectId
compileId
backtestName
Returns

Implemented in QuantConnect.Api.Api.

◆ ReadBacktest()

Backtest QuantConnect.Interfaces.IApi.ReadBacktest ( int  projectId,
string  backtestId,
bool  getCharts = true 
)

Read out the full result of a specific backtest

Parameters
projectIdProject id for the backtest we'd like to read
backtestIdBacktest id for the backtest we'd like to read
getChartsTrue will return backtest charts
Returns
Backtest result object

Implemented in QuantConnect.Api.Api.

◆ UpdateBacktest()

RestResponse QuantConnect.Interfaces.IApi.UpdateBacktest ( int  projectId,
string  backtestId,
string  name = "",
string  note = "" 
)

Update the backtest name

Parameters
projectIdProject id to update
backtestIdBacktest id to update
nameNew backtest name to set
noteNote attached to the backtest
Returns
Rest response on success

Implemented in QuantConnect.Api.Api.

◆ DeleteBacktest()

RestResponse QuantConnect.Interfaces.IApi.DeleteBacktest ( int  projectId,
string  backtestId 
)

Delete a backtest from the specified project and backtestId.

Parameters
projectIdProject for the backtest we want to delete
backtestIdBacktest id we want to delete
Returns
RestResponse on success

Implemented in QuantConnect.Api.Api.

◆ ListBacktests()

BacktestSummaryList QuantConnect.Interfaces.IApi.ListBacktests ( int  projectId,
bool  includeStatistics = false 
)

Get a list of backtest summaries for a specific project id

Parameters
projectIdProject id to search
includeStatisticsTrue for include statistics in the response, false otherwise
Returns
BacktestList container for list of backtests

Implemented in QuantConnect.Api.Api.

◆ ReadBacktestInsights()

InsightResponse QuantConnect.Interfaces.IApi.ReadBacktestInsights ( int  projectId,
string  backtestId,
int  start = 0,
int  end = 0 
)

Read out the insights of a backtest

Parameters
projectIdId of the project from which to read the backtest
backtestIdBacktest id from which we want to get the insights
startStarting index of the insights to be fetched
endLast index of the insights to be fetched. Note that end - start must be less than 100
Returns
InsightResponse
Exceptions
ArgumentException

Implemented in QuantConnect.Api.Api.

◆ EstimateOptimization()

Estimate QuantConnect.Interfaces.IApi.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

Parameters
projectIdProject ID of the project the optimization belongs to
nameName of the optimization
targetTarget of the optimization, see examples in PortfolioStatistics
targetToTarget extremum of the optimization, for example "max" or "min"
targetValueOptimization target value
strategyOptimization strategy, GridSearchOptimizationStrategy
compileIdOptimization compile ID
parametersOptimization parameters
constraintsOptimization constraints
Returns
Estimate object from the API.

Implemented in QuantConnect.Api.Api.

◆ CreateOptimization()

OptimizationSummary QuantConnect.Interfaces.IApi.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

Parameters
projectIdProject ID of the project the optimization belongs to
nameName of the optimization
targetTarget of the optimization, see examples in PortfolioStatistics
targetToTarget extremum of the optimization, for example "max" or "min"
targetValueOptimization target value
strategyOptimization strategy, GridSearchOptimizationStrategy
compileIdOptimization compile ID
parametersOptimization parameters
constraintsOptimization constraints
estimatedCostEstimated cost for optimization
nodeTypeOptimization node type
parallelNodesNumber of parallel nodes for optimization
Returns
BaseOptimization object from the API.

Implemented in QuantConnect.Api.Api.

◆ ListOptimizations()

List<OptimizationSummary> QuantConnect.Interfaces.IApi.ListOptimizations ( int  projectId)

List all the optimizations for a project

Parameters
projectIdProject id we'd like to get a list of optimizations for
Returns
A list of BaseOptimization objects, BaseOptimization

Implemented in QuantConnect.Api.Api.

◆ ReadOptimization()

Optimization QuantConnect.Interfaces.IApi.ReadOptimization ( string  optimizationId)

Read an optimization

Parameters
optimizationIdOptimization id for the optimization we want to read
Returns
Optimization

Implemented in QuantConnect.Api.Api.

◆ AbortOptimization()

RestResponse QuantConnect.Interfaces.IApi.AbortOptimization ( string  optimizationId)

Abort an optimization

Parameters
optimizationIdOptimization id for the optimization we want to abort
Returns
RestResponse

Implemented in QuantConnect.Api.Api.

◆ UpdateOptimization()

RestResponse QuantConnect.Interfaces.IApi.UpdateOptimization ( string  optimizationId,
string  name = null 
)

Update an optimization

Parameters
optimizationIdOptimization id we want to update
nameName we'd like to assign to the optimization
Returns
RestResponse

Implemented in QuantConnect.Api.Api.

◆ DeleteOptimization()

RestResponse QuantConnect.Interfaces.IApi.DeleteOptimization ( string  optimizationId)

Delete an optimization

Parameters
optimizationIdOptimization id for the optimization we want to delete
Returns
RestResponse

Implemented in QuantConnect.Api.Api.

◆ ReadLiveLogs()

LiveLog QuantConnect.Interfaces.IApi.ReadLiveLogs ( int  projectId,
string  algorithmId,
int  startLine,
int  endLine 
)

Gets the logs of a specific live algorithm

Parameters
projectIdProject Id of the live running algorithm
algorithmIdAlgorithm Id of the live running algorithm
startLineStart line of logs to read
endLineEnd line of logs to read
Returns
List of strings that represent the logs of the algorithm

Implemented in QuantConnect.Api.Api.

◆ ReadLiveChart()

ReadChartResponse QuantConnect.Interfaces.IApi.ReadLiveChart ( int  projectId,
string  name,
int  start,
int  end,
uint  count 
)

Returns a chart object from a live algorithm

Parameters
projectIdProject ID of the request
nameThe requested chart name
startThe Utc start seconds timestamp of the request
endThe Utc end seconds timestamp of the request
countThe number of data points to request
Returns

Implemented in QuantConnect.Api.Api.

◆ ReadLivePortfolio()

PortfolioResponse QuantConnect.Interfaces.IApi.ReadLivePortfolio ( int  projectId)

Read out the portfolio state of a live algorithm

Parameters
projectIdId of the project from which to read the live algorithm
Returns
PortfolioResponse

Implemented in QuantConnect.Api.Api.

◆ ReadLiveInsights()

InsightResponse QuantConnect.Interfaces.IApi.ReadLiveInsights ( int  projectId,
int  start = 0,
int  end = 0 
)

Read out the insights of a live algorithm

Parameters
projectIdId of the project from which to read the live algorithm
startStarting index of the insights to be fetched
endLast index of the insights to be fetched. Note that end - start must be less than 100
Returns
InsightResponse
Exceptions
ArgumentException

Implemented in QuantConnect.Api.Api.

◆ ReadDataLink()

DataLink QuantConnect.Interfaces.IApi.ReadDataLink ( string  filePath,
string  organizationId 
)

Gets the link to the downloadable data.

Parameters
filePathFile path representing the data requested
organizationIdOrganization to purchase this data with
Returns
Link to the downloadable data.

Implemented in QuantConnect.Api.Api.

◆ ReadDataDirectory()

DataList QuantConnect.Interfaces.IApi.ReadDataDirectory ( string  filePath)

Get valid data entries for a given filepath from data/list

Returns

Implemented in QuantConnect.Api.Api.

◆ ReadDataPrices()

DataPricesList QuantConnect.Interfaces.IApi.ReadDataPrices ( string  organizationId)

Gets data prices from data/prices

Implemented in QuantConnect.Api.Api.

◆ ReadBacktestReport()

BacktestReport QuantConnect.Interfaces.IApi.ReadBacktestReport ( int  projectId,
string  backtestId 
)

Read out the report of a backtest in the project id specified.

Parameters
projectIdProject id to read
backtestIdSpecific backtest id to read
Returns
BacktestReport

Implemented in QuantConnect.Api.Api.

◆ ReadBacktestChart()

ReadChartResponse QuantConnect.Interfaces.IApi.ReadBacktestChart ( int  projectId,
string  name,
int  start,
int  end,
uint  count,
string  backtestId 
)

Returns a requested chart object from a backtest

Parameters
projectIdProject ID of the request
nameThe requested chart name
startThe Utc start seconds timestamp of the request
endThe Utc end seconds timestamp of the request
countThe number of data points to request
backtestIdAssociated Backtest ID for this chart request
Returns

Implemented in QuantConnect.Api.Api.

◆ DownloadData()

bool QuantConnect.Interfaces.IApi.DownloadData ( string  filePath,
string  organizationId 
)

Method to download and save the data purchased through QuantConnect

Parameters
filePathFile path representing the data requested
Returns
A bool indicating whether the data was successfully downloaded or not.

Implemented in QuantConnect.Api.Api.

◆ ReadAccount()

Account QuantConnect.Interfaces.IApi.ReadAccount ( string  organizationId = null)

Will read the organization account status

Parameters
organizationIdThe target organization id, if null will return default organization

Implemented in QuantConnect.Api.Api.

Here is the caller graph for this function:

◆ ReadOrganization()

Organization QuantConnect.Interfaces.IApi.ReadOrganization ( string  organizationId = null)

Fetch organization data from web API

Parameters
organizationId
Returns

Implemented in QuantConnect.Api.Api.

◆ CreateLiveAlgorithm()

CreateLiveAlgorithmResponse QuantConnect.Interfaces.IApi.CreateLiveAlgorithm ( int  projectId,
string  compileId,
string  nodeId,
Dictionary< string, object >  brokerageSettings,
string  versionId = "-1",
Dictionary< string, object >  dataProviders = null 
)

Create a new live algorithm for a logged in user.

Parameters
projectIdId of the project on QuantConnect
compileIdId of the compilation on QuantConnect
nodeIdId of the node that will run the algorithm
brokerageSettingsDictionary with Brokerage specific settings
versionIdThe version identifier
dataProvidersDictionary with data providers and their corresponding credentials
Returns
Information regarding the new algorithm CreateLiveAlgorithmResponse

Implemented in QuantConnect.Api.Api.

◆ ListLiveAlgorithms()

LiveList QuantConnect.Interfaces.IApi.ListLiveAlgorithms ( AlgorithmStatus status = null,
DateTime?  startTime = null,
DateTime?  endTime = null 
)

Get a list of live running algorithms for a logged in user.

Parameters
statusFilter the statuses of the algorithms returned from the api
startTimeEarliest launched time of the algorithms returned by the Api
endTimeLatest launched time of the algorithms returned by the Api
Returns
List of live algorithm instances

Implemented in QuantConnect.Api.Api.

◆ ReadLiveAlgorithm()

LiveAlgorithmResults QuantConnect.Interfaces.IApi.ReadLiveAlgorithm ( int  projectId,
string  deployId 
)

Read out a live algorithm in the project id specified.

Parameters
projectIdProject id to read
deployIdSpecific instance id to read
Returns
Live object with the results

Implemented in QuantConnect.Api.Api.

◆ LiquidateLiveAlgorithm()

RestResponse QuantConnect.Interfaces.IApi.LiquidateLiveAlgorithm ( int  projectId)

Liquidate a live algorithm from the specified project.

Parameters
projectIdProject for the live instance we want to stop
Returns

Implemented in QuantConnect.Api.Api.

◆ StopLiveAlgorithm()

RestResponse QuantConnect.Interfaces.IApi.StopLiveAlgorithm ( int  projectId)

Stop a live algorithm from the specified project.

Parameters
projectIdProject for the live algo we want to delete
Returns

Implemented in QuantConnect.Api.Api.

◆ SendNotification()

RestResponse QuantConnect.Interfaces.IApi.SendNotification ( Notification  notification,
int  projectId 
)

Sends a notification

Parameters
notificationThe notification to send
projectIdThe project id
Returns
RestResponse containing success response and errors

Implemented in QuantConnect.Api.Api.

◆ GetAlgorithmStatus()

AlgorithmControl QuantConnect.Interfaces.IApi.GetAlgorithmStatus ( string  algorithmId)

Get the algorithm current status, active or cancelled from the user

Parameters
algorithmId
Returns

Implemented in QuantConnect.Api.Api.

◆ SetAlgorithmStatus()

void QuantConnect.Interfaces.IApi.SetAlgorithmStatus ( string  algorithmId,
AlgorithmStatus  status,
string  message = "" 
)

Set the algorithm status from the worker to update the UX e.g. if there was an error.

Parameters
algorithmIdAlgorithm id we're setting.
statusStatus enum of the current worker
messageMessage for the algorithm status event

Implemented in QuantConnect.Api.Api.

Here is the caller graph for this function:

◆ SendStatistics()

void QuantConnect.Interfaces.IApi.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.

Parameters
algorithmIdIdentifier for algorithm
unrealizedUnrealized gainloss
feesTotal fees
netProfitNet profi
holdingsAlgorithm holdings
equityTotal equity
netReturnAlgorithm return
volumeVolume traded
tradesTotal trades since inception
sharpeSharpe ratio since inception

Implemented in QuantConnect.Api.Api.

◆ SendUserEmail()

void QuantConnect.Interfaces.IApi.SendUserEmail ( string  algorithmId,
string  subject,
string  body 
)

Send an email to the user associated with the specified algorithm id

Parameters
algorithmIdThe algorithm id
subjectThe email subject
bodyThe email message body

Implemented in QuantConnect.Api.Api.

◆ Download()

string QuantConnect.Interfaces.IApi.Download ( string  address,
IEnumerable< KeyValuePair< string, string >>  headers,
string  userName,
string  password 
)

Local implementation for downloading data to algorithms

Parameters
addressURL to download
headersKVP headers
userNameUsername for basic authentication
passwordPassword for basic authentication
Returns

Implemented in QuantConnect.Api.Api.

Here is the caller graph for this function:

◆ DownloadBytes()

byte [] QuantConnect.Interfaces.IApi.DownloadBytes ( string  address,
IEnumerable< KeyValuePair< string, string >>  headers,
string  userName,
string  password 
)

Local implementation for downloading data to algorithms

Parameters
addressURL to download
headersKVP headers
userNameUsername for basic authentication
passwordPassword for basic authentication
Returns

Implemented in QuantConnect.Api.Api.

◆ GetObjectStore()

bool QuantConnect.Interfaces.IApi.GetObjectStore ( string  organizationId,
List< string >  keys,
string  destinationFolder = null 
)

Download the object store associated with the given organization ID and key

Parameters
organizationIdOrganization ID we would like to get the Object Store from
keysKeys for the Object Store files
destinationFolderFolder in which the object will be stored
Returns
True if the object was retrieved correctly, false otherwise

Implemented in QuantConnect.Api.Api.

◆ GetObjectStoreProperties()

PropertiesObjectStoreResponse QuantConnect.Interfaces.IApi.GetObjectStoreProperties ( string  organizationId,
string  key 
)

Get Object Store properties given the organization ID and the Object Store key

Parameters
organizationIdOrganization ID we would like to get the Object Store from
keyKey for the Object Store file
Returns
PropertiesObjectStoreResponse

It does not work when the object store is a directory

Implemented in QuantConnect.Api.Api.

◆ SetObjectStore()

RestResponse QuantConnect.Interfaces.IApi.SetObjectStore ( string  organizationId,
string  key,
byte[]  objectData 
)

Upload files to the Object Store

Parameters
organizationIdOrganization ID we would like to upload the file to
keyKey to the Object Store file
objectDataFile to be uploaded
Returns
RestResponse

Implemented in QuantConnect.Api.Api.

◆ DeleteObjectStore()

RestResponse QuantConnect.Interfaces.IApi.DeleteObjectStore ( string  organizationId,
string  key 
)

Request to delete Object Store metadata of a specific organization and key

Parameters
organizationIdOrganization ID we would like to delete the Object Store file from
keyKey to the Object Store file
Returns
RestResponse

Implemented in QuantConnect.Api.Api.

◆ ReadLeanVersions()

VersionsResponse QuantConnect.Interfaces.IApi.ReadLeanVersions ( )

Gets a list of LEAN versions with their corresponding basic descriptions

Implemented in QuantConnect.Api.Api.


The documentation for this interface was generated from the following file: