Back

How to download live date logs by date

If I am only interested in logs on some particular dates, how do I download those logs? I found after I zoomed in the certain days, and hit the download logs button, it still gives all the log data.

Thanks

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


You can use the API to download a particular set of logs. Example below gets the last 10 days worth of logs.

using System;
using QuantConnect.Api;

namespace LeanApiTool
{
class Program
{
public const int ProjectId = xxxx;
public const string DeploymentId = "L-xxx";
public static Api Qc;

static void Main( string[] args )
{
// Create and initialise connection
Qc = new Api();
Console.WriteLine( "Initializing API connection." );
Qc.Initialize( xxx, "xxxx", "notused" );

// Check for successful connection
if ( !Qc.Connected )
throw new Exception( "API connection unsuccessful!" );
else
Console.WriteLine( "API connection successful." );

// Read logs
var logs = Qc.ReadLiveLogs( ProjectId, DeploymentId, DateTime.UtcNow.AddDays( -10 ), DateTime.UtcNow.AddDays( 1 ) );
}
}
}

 

1

Thanks Douglas, I haven't ran QC locally before and if I want to download the logs from the web console, how should I do? 

0

Hi Douglas, I have a follow up question that where can I find the projectId / delpoymentId?

Thanks!

0

You cannot specify logs from a particular date when downloading from the web console, unfortunately. You will have to download all your logs and then sort through them.

  • ProjectID is shown at the end of the URL when you are in your project in the terminal, e.g. /terminal/#openLive/xxxxx
  • DeploymentID and ProjectID are both shown at the end of the URL for when you download your logs (copy the link for Download Logs), e.g. .../api/v2/live/read/log?algorithmId=L-xxxxx&projectId=xxxxx
0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed