Back

Add Security with real exchange not the general one not working

private int _code = 100;
private void AddMarketIfNotExist(string market)
{
var code = Market.Encode(market.ToLower());
if (code == null)
{
Market.Add(market, _code++);
}
}

AddMarketIfNotExist("NASDAQ");

var entry = MarketHoursDatabase.GetEntry(Market.USA, string.Empty, SecurityType.Equity);
MarketHoursDatabase.SetEntry("nasdaq", string.Empty, SecurityType.Equity, entry.ExchangeHours, entry.DataTimeZone);

AddSecurity(SecurityType.Equity, "AAPL", Resolution.Minute, "nasdaq", false, 0, true);

Above code first i'm adding NASDAQ market and then using default market hours for USA.

Second i'm adding AAPL equity to strategy. This code is working but never OnData method calling! Any idea about that?

Please not that i'm using IQFeed data feed but i think the problem is not related to data feed.

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.


Hey there, do you mind shaing your goals? Is it to just use IQFeed data with LEAN? Why rewrite the market? 

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.


Because want to trade other stock markets from other countries via LEAN. In my sample code NASDAQ ticker (AAPL) from IQFeed is only for trial. I don't think that Lean only for trade US equity market. At least I hope it isn't.

0

Hi Aytac, sorry at this point LEAN does not officially support international markets but its high on our todo list for this year. 

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 Jared, thanks for your clarification. I'm sorry about to hear that LEAN does not supported international markets. But i'm glad to hear that you have a plan for support that. LEAN is priceless right now. After support international markets it will definitely be more valuable.

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