otp.Source.to_symbol_param#

Source.to_symbol_param()#

Creates a read-only instance with the same columns except Time. It is used as a result of a first stage query with symbol params.

Examples

>>> symbols = otp.Ticks({'SYMBOL_NAME': ['S1', 'S2'], 'PARAM': ['A', 'B']})
>>> symbol_params = symbols.to_symbol_param()
>>> t = otp.DataSource('SOME_DB', tick_type='TT')
>>> t['S_PARAM'] = symbol_params['PARAM']
>>> result = otp.run(t, symbols=symbols)
>>> result['S1']
                     Time  X S_PARAM
0 2003-12-01 00:00:00.000  1       A
1 2003-12-01 00:00:00.001  2       A
2 2003-12-01 00:00:00.002  3       A