I cannot find in the documentation how to do this simple thing.
I have a simple Pipeline and want to sort the results by symbol or sid.
Here's what I am trying to do: sort the "result" by symbol --- should be simple enough?
class StdDev(CustomFactor):
def compute(self, today, asset_ids, out, values):
# Calculates the column-wise standard deviation, ignoring NaNs
out[:] = numpy.nanstd(values, axis=0)
def make_pipeline():
mean_close_10 = SimpleMovingAverage(inputs=[USEquityPricing.close], window_length=10)
volume_filter = (USEquityPricing.volume.latest > 1000000)
std_dev = StdDev(inputs=[USEquityPricing.close], window_length=5)
std_filter = (std_dev > 2)
price_filter = (USEquityPricing.close.latest > 5) and (USEquityPricing.close.latest < 50)
return Pipeline(
columns={
'10 MA of closing price' : mean_close_10,
'Volume': USEquityPricing.volume.latest,
'std_dev': std_dev
} , screen=(std_filter & price_filter & volume_filter)
)
result = run_pipeline(make_pipeline(), '2016-12-15', '2016-12-15')
result.sort_values(symbol) <----------this doesn't work. How do you sort output by Symbol/Sid ????
Help !