Return a Handle object for a guid string. The Handle object type is derived from str, itself.
Interface:
get_handle(guid)
Sample - Calling Method
service.symbol_list.get_handle('448CBB9E-CFDE-4A55-BB7B-7521080E5A0B')
Name | Type | Default | Information |
---|---|---|---|
guid | string | required | Lists |
Type | Notes |
---|---|
object | Object to reference in in_list() |
- Goes with in_list()
- Per class, you only need to get handle once.
- Lists
Get handle for list "Earnings Today After"
from cloudquant.interfaces import Strategy
class GetHandleExample(Strategy):
@classmethod
def is_symbol_qualified(cls, symbol, md, service, account):
return symbol == "AAPL"
def on_start(self, md, order, service, account):
vol_over_one_million_list = service.symbol_list.get_handle('c5673334-de39-4ad2-b517-82b591cdb928')
print service.symbol_list.in_list(vol_over_one_million_list, 'AAPL')
service.terminate()
Console
True