Pre-market data

Back

My understanding is that extended trading hours/pre-market trading is by default off, unless specified. So in the statement below, pre-market data should be off.

self.equity = self.AddEquity("SPY R735QTJ8XC9X", Resolution.Minute)
self.quote = self.AddEquity("SPY R735QTJ8XC9X", Resolution.Second)

However, while live trading, on random days, it seems that the algo is putting into account pre-market data while calculating the moving averages. When I set the extended to false just to make sure using the following:

self.equity = self.AddEquity("SPY R735QTJ8XC9X", Resolution.Minute, Market.USA, True, 1, False)
self.quote = self.AddEquity("SPY R735QTJ8XC9X", Resolution.Second, Market.USA, True, 1, False)

I receive an error saying: 

AttributeError : USA

I have these imported:
from System import *
from QuantConnect import *
from QuantConnect.Data import *
from QuantConnect.Algorithm import *
from QuantConnect.Indicators import *
from QuantConnect.Data.Market import TradeBar
from QuantConnect.Data.Market import QuoteBar
from QuantConnect.Securities.Option import OptionPriceModels
from QuantConnect.Brokerages import

Maurice

 

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

I was unable to reproduce the error message, however, it should be noted that pre-market data is always off on default. As for getting random pre-market bars, if you could detail the algorithm, brokerage used, and anything else that might help us identify the problem, that would be greatly appreciated.

Best,
Shile Wen

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...

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!