Mariner Backtesting - Earnings

service.symbol_list.get_handle()

 

The most common use for these lists is to narrow your universe of symbols in is_symbol_qualified.
See example below for returning only those symbols that had earnings yesterday after the close or this morning before the open...

 

 @classmethod
def is_symbol_qualified(cls, symbol, md, service, account):
    EarningsYesterdayAfterGUID = '288d5e0a-9ab2-4e52-9e10-420eaf2adc2b'
    EarningsYesterdayAfter = service.symbol_list.in_list(service.symbol_list.get_handle(EarningsYesterdayAfterGUID),symbol)
    EarningsTodayBeforeGUID = '0774ba76-e53e-4293-9674-489e65c2581b'
    # This combination of service calls returns a 1 if the current symbol is in the specified list, a zero if it is not
    EarningsTodayBefore = service.symbol_list.in_list(service.symbol_list.get_handle(EarningsTodayBeforeGUID),symbol)
    return EarningsYesterdayAfter or EarningsTodayBefore 
Note:
  • GUIDs are lowercase.
List GUID
Today After 448cbb9e-cfde-4a55-bb7b-7521080e5a0b
Today Before 0774ba76-e53e-4293-9674-489e65c2581b
Today During 37149d13-14a6-4892-8cbb-234edfa038a8
Today Undefined 464e4997-ef15-4cb5-b047-b08962afd294
Tomorrow After e2163676-d1fb-4253-9cb8-0ec3b739d459
Tomorrow Before 49ebe00b-a114-46c3-9c91-a80762bc948e
Tomorrow During 1ef4e286-0261-46b3-bbb8-d07f8e55026b
Tomorrow Undefined d4a57084-60a6-4fd4-951e-55c02185cce3
Yesterday After 288d5e0a-9ab2-4e52-9e10-420eaf2adc2b
Yesterday Before 5ece500b-7308-428b-ab6a-0255b1342f76
Yesterday During 20961a18-223f-4548-9112-f7f40e0dff40
Yesterday Undefined 9c914529-e398-437f-84d8-07f8d86349eb