Local backtesting

Back

I'm trying to run a local backtest.
I have succesfully cloned, built and run LEAN "Launcher" on linux.

1. First problem is with universe selection. When I stop with a breakpoint in MyCoarseFilterFunction, IEnumerable<CoarseFundamental> coarseFundamentals is empty. Same code pasted on quantconnect.com runs great and produces result in debug so the code is correct (see below).

2. Skylight does not work on my linux mint xfce. When I run from a terminal, all I get is:
"
2020-10-21T19:33:52.786Z TRACE:: Main(): Starting Skylight v0.1.11 (production)
(electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false".  It will change to be "true" in Electron 9.  For more information please check https://github.com/electron/electron/issues/18397
Checking for update
"
after which prompt returns. "ps aux | grep sky" and "ps aux | grep quant" does not return anything.

https://github.com/QuantConnect/Lean#installation-instructionshttps://github.com/QuantConnect/Lean#installation-instructions public class MyAlgorithm : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2007, 1, 1);
SetEndDate(2010, 1, 1);
SetCash(10 * 1000);

UniverseSettings.Resolution = Resolution.Daily;
AddUniverse(MyCoarseFilterFunction, FineSelectionFunction);
AddAlpha(new MyAlphaModel(this));
SetPortfolioConstruction(new BlackLittermanOptimizationPortfolioConstructionModel());
SetExecution(new StandardDeviationExecutionModel(60, 2, Resolution.Daily));
SetRiskManagement(new TrailingStopRiskManagementModel(0.03m));
}

private IEnumerable<Symbol> MyCoarseFilterFunction(IEnumerable<CoarseFundamental> coarseFundamentals)
{
var x = coarseFundamentals
.Select(symbol =>
{
Debug(symbol.Symbol);
Log(symbol.Symbol);
return symbol;
})
.Where(coarseFundamental => coarseFundamental.HasFundamentalData)
.Select(coarseFundamental => coarseFundamental.Symbol);

Debug("MyCoarseFilterFunction2");

foreach (var symbol in coarseFundamentals)
{
Debug(">" + symbol.Symbol);
}

return x;
}

private IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fineFundamentals) => fineFundamentals
.Select(fineFundamental => fineFundamental.Symbol)
.Select(symbol =>
{
Debug(symbol);
return symbol;
});

/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
/// Slice object keyed by symbol containing the stock data
public override void OnData(Slice data)
{
if (Portfolio.Invested)
{
SetHoldings("SPY", 0);
}
else
{
SetHoldings("SPY", 1);
Debug("Purchased Stock");
Log("Purchased Stock");
}
}
}

 

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.


Hi Quanter,

(1) Fundamental data is only available for free when backtesting on our web platform. To backtest with fundamental data locally, you'll need a MorningStar subscription.

(2) We have been experiencing issues with running on Linux Mint. Send support@quantconnect.com the logs from your system found at: ~/.config/{app name}/logs/

Best,
Derek Melchin

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.


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