Back

Stringing together Modules

Im trying to string together basic core modules in order to achieve having a coarse universe able to scan during premarket and regular market hours. For alpha creation, I'm basing signals off ema crossovers, which I can make into a ribbon later. For execution Im trying to use vwap seeking execution model, Although I do not currently have any risk management, I was going to try and have a trailing stop loss based off price. Im using this combination because a stripped down alpha creation when backtesting with manual equity selection I was able to have a compounding annual return over 1000% which from my research having premarket scanning and trading will greatly improve this. Im currently stuck with this error code and cannot find a solution so any help with the code to fix this would be fantastic!

 

Error : 

Algorithm.Initialize() Error: Loader.TryCreatePythonAlgorithm(): Unable to import python module ./cache/algorithm/main.pyc. AlgorithmPythonWrapper(): Please ensure that one class inherits from QCAlgorithm or QCAlgorithmFramework. Try re-building algorithm. Stack Trace: at QuantConnect.Lean.Engine.Setup.BacktestingSetupHandler.CreateAlgorithmInstance (QuantConnect.Packets.AlgorithmNodePacket algorithmNodePacket, System.String assemblyPath) [0x00061] in <2caed54565be465db25fe6e7c00ef877>:0
at QuantConnect.Lean.Engine.Engine.Run (QuantConnect.Packets.AlgorithmNodePacket job, QuantConnect.Lean.Engine.AlgorithmManager manager, System.String assemblyPath) [0x000e9] in <2caed54565be465db25fe6e7c00ef877>:0 (Open Stacktrace)

  

https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_4071eb859057c9d6ad72bedd7cd17412.html

Update Backtest







Having a similar issue, if one of the developerrs could take a look at this, it would be greatly appreciated.

1

I'm dealing with a similar issue and help would be appreciated from anyone. Thanks

1

Super cool you're getting into the framework! It looks like you've got everything except the primary algorithm which joins them together. The BasicTemplateFramework algorithm demonstrates these setters for telling LEAN what models to use so you need to add the class. In the back test below you can check out class BasicTemplateFrameworkAlgorithm(QCAlgorithmFramework). This is the part of the framework that was missing. You can see how it initializes the classes (models) that were chosen above.

1


Thank you ! 

Is using framework the best option for what I am trying to do?

0

The algorithm framework gives a defined structure for designing strategies. This strategy in specific has enough complexity where the framework helps break it down. And since universe selection seems to be a critical part of the algorithm you can focus more on as a result of the framework. 

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