Back

TradeBar Exchange filter

Hey,

Is it possible to filter tradebars from specific exchange?

Did not manage to find an 'Exchange' property, similar to Tick class .Exchange property.

Thanks!

Update Backtest








In order to create TradeBar from a given exchange, you need to subscribe to Tick data and only use ticks from a that exchange to consolidate the bars. In that case, you can not subcribe the consolidator:

private TickConsolidator _consolidator;

// In Initialize
_consolidator = new TickConsolidator(TimeSpan.FromMinutes(1));
_consolidator.DataConsolidated += OnMinuteData;

private void OnMinuteData(object sender, TradeBar bar)
{
// bar consolidated with ticks at OnData
}

public void OnData(Ticks ticks)
{
foreach (var tick in ticks[symbol])
{
// if filter condition met, continue
_consolidator.Update(tick);
}
}

 

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.


TradeBars are already pre-filtered for specific exchanges.

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.


Thank you both.

Jared, can you please elaborate your answer?

Where is it happening?  Which exchanges are filtered?  How can I select the desired exchange?

 

0

Hey Jenny S sorry for the delay: you can see the filter used in our backend processing here:

https://www.quantconnect.com/forum/discussion/963/simulation-price-is-different-with-price-on-google-and-yahoo-finance/p1/comment-2864

 

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.


Thank you Jared.

Yes, I've done this while using tick resolution, but on second resolution it's not available.

How do you do this on resolution other than tick (second, for example)?

Is there another way except TickConsolidator which Alexandre mentioned before?

0

 - "resolution other than tick" 

No -- bars are already preprocessed and stored on disk as bars. 

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