Hello!
I've just dived into the world of quant trading, and as my tutorial was based on quantopian, I am trying to reconcile everything from quantopian with blueshift documentation.
Currently, I'm trying to write pipelines, but unfortunately, I can't find a suitable alternative to the Q1500US in Quantopian (morningstar to be exact). What alternative is there, if it exists? I don't want to write all the symbols of stocks in Q1500US.
Also, since I'm a noob with Blueshift documentation, please provide the code I would need to write to fetch large datasets of stock information.
Thanks!
I think it is not you but the blueshift documentation! At present the documentation is, to be honest, pretty thin. This is mostly because the library itself is in heavy development and some aspects are yet fluid. We expect the proper and complete documentation to be published by end of this year.
Having said that, you can quickly check the details of our dataset here. We have no support for mornigstar (although we will be adding fundamental data soon). For the US equities, we follow the S&P 500 universe (a thread explaining why). So the Q1500US is not available. If you are looking for the QS500US, the equivlent will be the whole universe available on blueshift.
Thanks!
So, how would I call this dataset in a pipeline? I've spent the past 3 days trying to debug this pipeline.
def make_pipeline(context):
high_dollar_volume = dollar_volume.percentile_between(90,100)
top_open_prices = USEquityPricing.open.latest.top(50,mask=high_dollar_volume)
high_close_price = USEquityPricing.open.latest.percentile_between(90,100,mask = top_open_prices)
mean_close_30 = SimpleMovingAverage(inputs = [USEquityPricing.close],window_length=30,mask=high_close_price)
mean_close_10 = SimpleMovingAverage(inputs = [USEquityPricing.close],window_length=10,mask=high_close_price)
percent_difference = (mean_close_10-mean_close_30)/mean_close_30
#combine
shorts = percent_difference < 0
longs = percent_difference > 0
securities_to_trade = (shorts | longs)
return Pipeline(columns={
'longs' :longs,
'shorts':shorts,
'perc_diff':percent_difference},
screen = securities_to_trade)
However, I keep on getting this error:
AttributeError: 'TradingAlgorithm' object has no attribute 'longs'
'TradingAlgorithm' object has no attribute 'longs'
However, as in the example of code above, it is pretty clear that the column "longs" is defined very clearly. So, I associated it with the potential of an empty Pipeline object; perhaps due to the fact that I didn't call any stocks, the "longs" attribute would return an empty list, thus generating the error.
This is my personal understanding, it could be completely wrong. Could anyone explain?
Thanks!
So, how would I call this dataset in a pipeline? I've spent the past 3 days trying to debug this pipeline.
def make_pipeline(context):
high_dollar_volume = dollar_volume.percentile_between(90,100)
top_open_prices = USEquityPricing.open.latest.top(50,mask=high_dollar_volume)
high_close_price = USEquityPricing.open.latest.percentile_between(90,100,mask = top_open_prices)
mean_close_30 = SimpleMovingAverage(inputs = [USEquityPricing.close],window_length=30,mask=high_close_price)
mean_close_10 = SimpleMovingAverage(inputs = [USEquityPricing.close],window_length=10,mask=high_close_price)
percent_difference = (mean_close_10-mean_close_30)/mean_close_30
#combine
shorts = percent_difference < 0
longs = percent_difference > 0
securities_to_trade = (shorts | longs)
return Pipeline(columns={
'longs' :longs,
'shorts':shorts,
'perc_diff':percent_difference},
screen = securities_to_trade)
However, I keep on getting this error:
AttributeError: 'TradingAlgorithm' object has no attribute 'longs'
'TradingAlgorithm' object has no attribute 'longs'
However, as in the example of code above, it is pretty clear that the column "longs" is defined very clearly. So, I associated it with the potential of an empty Pipeline object; perhaps due to the fact that I didn't call any stocks, the "longs" attribute would return an empty list, thus generating the error.
This is my personal understanding, it could be completely wrong. Could anyone explain?
And yes, I imported everything.
I think it has been solved in another thread? If not please send a mail to blueshift-support@quantinsti.com