Back

Make a strategy

How can I make a strategy to use Lunch-Break Mean Reversion ? Thank you for your help. 

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 Petr,

This has already been created by the QC team - the reference file is here.

As the Alpha is already part of the core codebase, you can remove the actual Alpha implementation (lines 84-180), so your code would only look like this:

public class MyStrategy : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2018, 1, 1);
SetCash(100000);

// Your universe selection here - either a selection function or a manual universe
// See https://www.quantconnect.com/docs/algorithm-framework/universe-selection for examples

// Use MeanReversionLunchBreakAlphaModel to establish insights
SetAlpha(new MeanReversionLunchBreakAlphaModel());

// Equally weigh securities in portfolio, based on insights
SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());

// Set Immediate Execution Model
SetExecution(new ImmediateExecutionModel());

// Set Null Risk Management Model
SetRiskManagement(new NullRiskManagementModel());
}
}

Don't forget to implement the universe selection, as I've written in the comments.

1

Error: The type or name space name "MeanReversionLunchBreakAlphaModel" could not be found (are you missing a using directive or an assembly reference ?)  

0

My bad - this class is private, so you will need to use the entire code in the file I linked!

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