hello there, I am very new, I am trying to do the scan of the market and select top 10 bullish stock and select top 10 bearish stock
Then apply buying and selling,
since the list is dynamic change for in interday and intraday
Is there way to do this?
Michael Handschuh
Victor Tong
Victor Tong
Michael Handschuh
SetUniverse(coarse => { return from c in coarse where c.Price > 1 orderby c.DollarVolume descending select c; });
Victor Tong
UniverseSettings.Leverage = 2.0m; UniverseSettings.Resolution = Resolution.Daily; SetStartDate(2001, 01, 01); //Set Start Date SetEndDate(2002, 01, 01); //Set End Date SetCash(10000000); //Set Strategy Cash var averages = new ConcurrentDictionary();
SetUniverse(coarse =>
{
return (from cf in coarse
let avg = averages.GetOrAdd(cf.Symbol, sym => new SelectionData())
where avg.Update(cf.EndTime, cf.Price)
// only pick symbols who have their 50 day ema over their 100 day ema
where avg.EMA50 > avg.EMA100
// prefer symbols with a larger delta by percentage between the two averages
orderby (avg.EMA50 - avg.EMA100)/cf.Price descending
select cf).Take(Count);
});
Should I do this in Initialize() ? Then updates changes in the onData(Slice data)?Michael Handschuh
Victor Tong
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!