Back

Dynamic Switch Trading Stock

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?
Update Backtest








Hey @Victor, welcome to QuantConnect! A brand new feature we have I like to call 'coarse universe selection'. This allows the algorithm to pick securities at the end of each trading day. I can throw together a quick example for you if you could elaborate on what kind of 'scan' you're performing. Are you getting the symbols from an external source or is it the result of some filtering done within the algorithm?
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.


Hey Michael...

filtering should be done within algorithm since I hate some external dependency.

Everything looks so good, you have all the great ticks and clusters. Just everything I need

Just notice Jared said 1 K symbol at once?

Wow..that is even better than IB can provide!!!!
0

Hey Michael...

filtering should be done within algorithm since I hate some external dependency.

Everything looks so good, you have all the great ticks and clusters. Just everything I need

Just notice Jared said 1 K symbol at once?

Wow..that is even better than IB can provide!!!!

Oh for the "scan" , it just order by all the symbol by % increases

Buying decision would purely adjust base on their pass statistic
0

In the next day or two I will be posting a couple demo algorithms regarding the universe selection feature. In short, we're now able to define the universe using the SetUniverse method which accepts a filter function (Func, IEnumerable>), so you could write code like:SetUniverse(coarse =>
{
return from c in coarse
where c.Price > 1
orderby c.DollarVolume descending
select c;
});
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.


Nice,

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)?
0

Victor, this code does get performed in Initialize, but be aware, that it is not completely tested yet. You'll know it's completely tested when I release a demo algorithm on the forums. So while this code does build and run, it may not function properly yet. Use at your own risk :)
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