Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help needed for retrieving equity object from self serve data to place an order

I have imported my "signal" from self serve Data :
# Import Self Data Set as pipe object
pipe = Pipeline(
columns={
'signal': test.signal.latest
},
# screen=test.signal.latest.notnull()
)
return pipe

Know when I print context.output.signal in my algo this is what I have :

2018-01-02 15:31 PRINT
Equity(2 [HWM]) None
Equity(21 [AAME]) None
Equity(24 [AAPL]) 1
Equity(25 [HWM_PR]) None
Equity(31 [ABAX]) None
Equity(41 [ARCB]) None
Equity(52 [ABM]) None
Equity(53 [ABMD]) None

I would then like to create an order when my signal is 1 with the method order_percent()

But I am sturggling in retrieving the Equity obect for wich my signal is 1.

order_percent(Equity(24 [AAPL]), 100)

Thanks for your help

1 response

Ended up finding the solution :

for stock in context.security_list.index:  
    algo.order_percent(stock, weight)  

Where context.security_list.index is the list of stocks I want to buy :
Index([Equity(24 [AAPL]), Equity(1335 [C])], dtype='object')

And weight, whatever wheight i.e. % of your portfolio you want to buy

Hope it helps :)