onetick-py 1.177.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. locator_parser/__init__.py +0 -0
  2. locator_parser/acl.py +73 -0
  3. locator_parser/actions.py +262 -0
  4. locator_parser/common.py +368 -0
  5. locator_parser/io.py +43 -0
  6. locator_parser/locator.py +150 -0
  7. onetick/__init__.py +101 -0
  8. onetick/doc_utilities/__init__.py +3 -0
  9. onetick/doc_utilities/napoleon.py +40 -0
  10. onetick/doc_utilities/ot_doctest.py +140 -0
  11. onetick/doc_utilities/snippets.py +279 -0
  12. onetick/lib/__init__.py +4 -0
  13. onetick/lib/instance.py +141 -0
  14. onetick/py/__init__.py +293 -0
  15. onetick/py/_stack_info.py +89 -0
  16. onetick/py/_version.py +2 -0
  17. onetick/py/aggregations/__init__.py +11 -0
  18. onetick/py/aggregations/_base.py +648 -0
  19. onetick/py/aggregations/_docs.py +948 -0
  20. onetick/py/aggregations/compute.py +286 -0
  21. onetick/py/aggregations/functions.py +2216 -0
  22. onetick/py/aggregations/generic.py +104 -0
  23. onetick/py/aggregations/high_low.py +80 -0
  24. onetick/py/aggregations/num_distinct.py +83 -0
  25. onetick/py/aggregations/order_book.py +501 -0
  26. onetick/py/aggregations/other.py +1014 -0
  27. onetick/py/backports.py +26 -0
  28. onetick/py/cache.py +374 -0
  29. onetick/py/callback/__init__.py +5 -0
  30. onetick/py/callback/callback.py +276 -0
  31. onetick/py/callback/callbacks.py +131 -0
  32. onetick/py/compatibility.py +798 -0
  33. onetick/py/configuration.py +771 -0
  34. onetick/py/core/__init__.py +0 -0
  35. onetick/py/core/_csv_inspector.py +93 -0
  36. onetick/py/core/_internal/__init__.py +0 -0
  37. onetick/py/core/_internal/_manually_bound_value.py +6 -0
  38. onetick/py/core/_internal/_nodes_history.py +250 -0
  39. onetick/py/core/_internal/_op_utils/__init__.py +0 -0
  40. onetick/py/core/_internal/_op_utils/every_operand.py +9 -0
  41. onetick/py/core/_internal/_op_utils/is_const.py +10 -0
  42. onetick/py/core/_internal/_per_tick_scripts/tick_list_sort_template.script +121 -0
  43. onetick/py/core/_internal/_proxy_node.py +140 -0
  44. onetick/py/core/_internal/_state_objects.py +2312 -0
  45. onetick/py/core/_internal/_state_vars.py +93 -0
  46. onetick/py/core/_source/__init__.py +0 -0
  47. onetick/py/core/_source/_symbol_param.py +95 -0
  48. onetick/py/core/_source/schema.py +97 -0
  49. onetick/py/core/_source/source_methods/__init__.py +0 -0
  50. onetick/py/core/_source/source_methods/aggregations.py +809 -0
  51. onetick/py/core/_source/source_methods/applyers.py +296 -0
  52. onetick/py/core/_source/source_methods/columns.py +141 -0
  53. onetick/py/core/_source/source_methods/data_quality.py +301 -0
  54. onetick/py/core/_source/source_methods/debugs.py +272 -0
  55. onetick/py/core/_source/source_methods/drops.py +120 -0
  56. onetick/py/core/_source/source_methods/fields.py +619 -0
  57. onetick/py/core/_source/source_methods/filters.py +1002 -0
  58. onetick/py/core/_source/source_methods/joins.py +1413 -0
  59. onetick/py/core/_source/source_methods/merges.py +605 -0
  60. onetick/py/core/_source/source_methods/misc.py +1455 -0
  61. onetick/py/core/_source/source_methods/pandases.py +155 -0
  62. onetick/py/core/_source/source_methods/renames.py +356 -0
  63. onetick/py/core/_source/source_methods/sorts.py +183 -0
  64. onetick/py/core/_source/source_methods/switches.py +142 -0
  65. onetick/py/core/_source/source_methods/symbols.py +117 -0
  66. onetick/py/core/_source/source_methods/times.py +627 -0
  67. onetick/py/core/_source/source_methods/writes.py +986 -0
  68. onetick/py/core/_source/symbol.py +205 -0
  69. onetick/py/core/_source/tmp_otq.py +222 -0
  70. onetick/py/core/column.py +209 -0
  71. onetick/py/core/column_operations/__init__.py +0 -0
  72. onetick/py/core/column_operations/_methods/__init__.py +4 -0
  73. onetick/py/core/column_operations/_methods/_internal.py +28 -0
  74. onetick/py/core/column_operations/_methods/conversions.py +216 -0
  75. onetick/py/core/column_operations/_methods/methods.py +292 -0
  76. onetick/py/core/column_operations/_methods/op_types.py +160 -0
  77. onetick/py/core/column_operations/accessors/__init__.py +0 -0
  78. onetick/py/core/column_operations/accessors/_accessor.py +28 -0
  79. onetick/py/core/column_operations/accessors/decimal_accessor.py +104 -0
  80. onetick/py/core/column_operations/accessors/dt_accessor.py +537 -0
  81. onetick/py/core/column_operations/accessors/float_accessor.py +184 -0
  82. onetick/py/core/column_operations/accessors/str_accessor.py +1367 -0
  83. onetick/py/core/column_operations/base.py +1121 -0
  84. onetick/py/core/cut_builder.py +150 -0
  85. onetick/py/core/db_constants.py +20 -0
  86. onetick/py/core/eval_query.py +245 -0
  87. onetick/py/core/lambda_object.py +441 -0
  88. onetick/py/core/multi_output_source.py +232 -0
  89. onetick/py/core/per_tick_script.py +2256 -0
  90. onetick/py/core/query_inspector.py +464 -0
  91. onetick/py/core/source.py +1744 -0
  92. onetick/py/db/__init__.py +2 -0
  93. onetick/py/db/_inspection.py +1128 -0
  94. onetick/py/db/db.py +1327 -0
  95. onetick/py/db/utils.py +64 -0
  96. onetick/py/docs/__init__.py +0 -0
  97. onetick/py/docs/docstring_parser.py +112 -0
  98. onetick/py/docs/utils.py +81 -0
  99. onetick/py/functions.py +2398 -0
  100. onetick/py/license.py +190 -0
  101. onetick/py/log.py +88 -0
  102. onetick/py/math.py +935 -0
  103. onetick/py/misc.py +470 -0
  104. onetick/py/oqd/__init__.py +22 -0
  105. onetick/py/oqd/eps.py +1195 -0
  106. onetick/py/oqd/sources.py +325 -0
  107. onetick/py/otq.py +216 -0
  108. onetick/py/pyomd_mock.py +47 -0
  109. onetick/py/run.py +916 -0
  110. onetick/py/servers.py +173 -0
  111. onetick/py/session.py +1347 -0
  112. onetick/py/sources/__init__.py +19 -0
  113. onetick/py/sources/cache.py +167 -0
  114. onetick/py/sources/common.py +128 -0
  115. onetick/py/sources/csv.py +642 -0
  116. onetick/py/sources/custom.py +85 -0
  117. onetick/py/sources/data_file.py +305 -0
  118. onetick/py/sources/data_source.py +1045 -0
  119. onetick/py/sources/empty.py +94 -0
  120. onetick/py/sources/odbc.py +337 -0
  121. onetick/py/sources/order_book.py +271 -0
  122. onetick/py/sources/parquet.py +168 -0
  123. onetick/py/sources/pit.py +191 -0
  124. onetick/py/sources/query.py +495 -0
  125. onetick/py/sources/snapshots.py +419 -0
  126. onetick/py/sources/split_query_output_by_symbol.py +198 -0
  127. onetick/py/sources/symbology_mapping.py +123 -0
  128. onetick/py/sources/symbols.py +374 -0
  129. onetick/py/sources/ticks.py +825 -0
  130. onetick/py/sql.py +70 -0
  131. onetick/py/state.py +251 -0
  132. onetick/py/types.py +2131 -0
  133. onetick/py/utils/__init__.py +70 -0
  134. onetick/py/utils/acl.py +93 -0
  135. onetick/py/utils/config.py +186 -0
  136. onetick/py/utils/default.py +49 -0
  137. onetick/py/utils/file.py +38 -0
  138. onetick/py/utils/helpers.py +76 -0
  139. onetick/py/utils/locator.py +94 -0
  140. onetick/py/utils/perf.py +498 -0
  141. onetick/py/utils/query.py +49 -0
  142. onetick/py/utils/render.py +1374 -0
  143. onetick/py/utils/script.py +244 -0
  144. onetick/py/utils/temp.py +471 -0
  145. onetick/py/utils/types.py +120 -0
  146. onetick/py/utils/tz.py +84 -0
  147. onetick_py-1.177.0.dist-info/METADATA +137 -0
  148. onetick_py-1.177.0.dist-info/RECORD +152 -0
  149. onetick_py-1.177.0.dist-info/WHEEL +5 -0
  150. onetick_py-1.177.0.dist-info/entry_points.txt +2 -0
  151. onetick_py-1.177.0.dist-info/licenses/LICENSE +21 -0
  152. onetick_py-1.177.0.dist-info/top_level.txt +2 -0
onetick/py/oqd/eps.py ADDED
@@ -0,0 +1,1195 @@
1
+ import os
2
+ from inspect import getframeinfo, stack
3
+ from onetick.py.otq import otq
4
+
5
+ _graph_components = otq.graph_components
6
+ _internal_utils = otq._internal_utils
7
+
8
+
9
+ def _get_reference_counted_prefix():
10
+ try:
11
+ return _internal_utils.get_reference_counted_prefix()
12
+ except AttributeError:
13
+ return _internal_utils.get_referance_counted_prefix()
14
+
15
+
16
+ class BaseOqdEp(_graph_components.EpBase): # type: ignore[name-defined]
17
+ """
18
+ Base class for all OQD EPs
19
+ """
20
+ class Parameters:
21
+ shared_state_variables = "SHARED_STATE_VARIABLES"
22
+
23
+ @staticmethod
24
+ def list_parameters():
25
+ list_val = ["shared_state_variables"]
26
+ return list_val
27
+
28
+ __slots__ = ["shared_state_variables", "_default_shared_state_variables", "stack_info", "_used_strings"]
29
+
30
+ def __init__(self, shared_state_variables=""):
31
+ _graph_components.EpBase.__init__(self, self._get_name())
32
+ self._default_shared_state_variables = ""
33
+ self.shared_state_variables = shared_state_variables
34
+ self._used_strings = {}
35
+ for param_name in type(self).__dict__:
36
+ param_val = getattr(self, param_name, '')
37
+ if (
38
+ isinstance(param_val, str) and
39
+ _get_reference_counted_prefix() in param_val and
40
+ param_val not in self._used_strings
41
+ ):
42
+ _internal_utils.inc_ref_count(param_val)
43
+ self._used_strings[param_val] = 1
44
+ caller = getframeinfo(stack()[1][0])
45
+ self.stack_info = caller.filename + ":" + str(caller.lineno)
46
+
47
+ def _get_name(self):
48
+ raise NotImplementedError()
49
+
50
+ def set_shared_state_variables(self, value):
51
+ self.shared_state_variables = value
52
+ return self
53
+
54
+ def __repr__(self):
55
+ return self._to_string(for_repr=True)
56
+
57
+ def __str__(self):
58
+ return self._to_string()
59
+
60
+ def __del__(self):
61
+ for param_name in self._used_strings:
62
+ _internal_utils.dec_ref_count(param_name)
63
+ if _internal_utils.get_ref_count(param_name) == 0:
64
+ _internal_utils.remove_from_memory(param_name)
65
+
66
+ def _to_string(self, ep_name=None, for_repr=False):
67
+ name = ep_name
68
+ if name is None:
69
+ name = self._get_name()
70
+ desc = name + "("
71
+ py_to_str = repr if for_repr else str
72
+ if self.shared_state_variables:
73
+ desc += "shared_state_variables=" + py_to_str(self.shared_state_variables) + ","
74
+ desc = desc[:-1]
75
+ if desc != name:
76
+ desc += ")"
77
+ if for_repr:
78
+ return desc + '()' if desc == name else desc
79
+ desc += "\n"
80
+ if len(self._symbols) > 0:
81
+ desc += "symbols=[" + ", ".join(self._symbols) + "]\n"
82
+ if len(self._tick_types) > 0:
83
+ desc += "tick_types=[" + ', '.join(self._tick_types) + "]\n"
84
+ if self._process_node_locally:
85
+ desc += "process_node_locally=True\n"
86
+ if self._node_name:
87
+ desc += "node_name=" + self._node_name + "\n"
88
+ return desc
89
+
90
+
91
+ class OqdSourceDprcMain(BaseOqdEp):
92
+ """
93
+ OQD_SOURCE_DPRC_MAIN
94
+
95
+  
96
+
97
+ Type: Other
98
+
99
+ Description: A
100
+ OneQuantData™ source EP to retrieve a time series of unadjusted
101
+ prices for a symbol for the main pricing exchange.
102
+
103
+ The OQD_SOURCE_DPRC_MAIN EP retrieves a single daily time series
104
+ corresponding to the main pricing line for a symbol.
105
+ OQD_SOURCE_DPRC_MAIN differs from OQD_SOURCE_DPRC_EXCH in that it
106
+ doesn't require specification of an exchange. The most appropriate
107
+ exchange will be chosen by the EP.
108
+
109
+ The main pricing line is defined as the composite price for countries
110
+ where a composite price is available. If no composite price is
111
+ available, then the exchange of primary listing is used, except for
112
+ Germany where XETRA is chosen as the main pricing source.
113
+
114
+ To adjust the data for corporate actions, use either the
115
+ OQD_CORP_ACTION EP or the CORP_ACTION EP.
116
+
117
+ To retrieve a price series for only one particular exchange, see
118
+ OQD_SOURCE_DPRC_EXCH. For all available price series, see
119
+ OQD_SOURCE_DPRC_ALL.
120
+
121
+ Set the tick type for this EP to __OQD__::*
122
+ The correct database and
123
+ tick type will be set by the EP.
124
+
125
+ Input: None
126
+
127
+ Output: A series of ticks.
128
+
129
+ Parameters: There are no parameters for this EP.
130
+ """
131
+
132
+ def _get_name(self):
133
+ return "OTQ::OQD_SOURCE_DPRC_MAIN.otq"
134
+
135
+
136
+ class OqdCorpAction(BaseOqdEp):
137
+ """
138
+ OQD_CORP_ACTION
139
+
140
+  
141
+
142
+ Type: Other
143
+
144
+ Description: A
145
+ OneQuantData™ source EP to generate a sparse multiplicative
146
+ adjustment series for use in queries requiring explicit corporate
147
+ action adjustments.
148
+
149
+ This EP is used for writing queries that require finer control over
150
+ the corporate action adjustment process than is provided by the
151
+ CORP_ACTION EP or for queries that don't set the symbol date and
152
+ utilize the Onetick Reference File.
153
+
154
+ For a simpler method of applying corporate action adjustments, see the
155
+ CORP_ACTION EP.
156
+
157
+ When adjusting historical data for corporate
158
+ actions using multiplicative factors, each data point is adjusted by
159
+ all future corporate actions. This means that multiplicative corporate
160
+ action adjustments are cumulative going backwards in time.
161
+
162
+ The OQD_CORP_ACTION EP generates the correct time series of adjustment factors
163
+ for use in a query utilizing the JOIN_BY_TIME EP. The output of this
164
+ EP is guaranteed to start at the query start time. If a symbol has no
165
+ corporate actions over the queried time range, this EP will return a
166
+ single tick at the query start time with a value of 1.0 for the
167
+ adjustment factors.
168
+
169
+ Price and volume adjustments are applied inversely. Each tick from
170
+ the OQD_CORP_ACTION EP will return 2 fields of adjustment factors: MADJ_PRICE and
171
+ MADJ_VOLUME.
172
+
173
+ To adjust prices or other data items stated on a per share
174
+ basis, multiple the data series by the value in the MADJ_PRICE column.
175
+
176
+ To adjust volume or other data items stated on a share basis, multiple
177
+ the data series by the MADJ_VOLUME column. The factors for spinoff are
178
+ not include in the MADJ_VOLUME factor.
179
+
180
+ The typical usage of this EP is to pass the output of the EP into a
181
+ JOIN_BY_TIME node to join the adjustment factors with a data series
182
+ that needs adjustments applied, and then perform the adjustments in
183
+ and ADD_FIELD or UPDATE_FIELD EP.
184
+
185
+ Because the OQD_CORP_ACTION EP goes directly to the OneQuantData
186
+ databases, it does not require that a Onetick reference file has been
187
+ configured and loaded and may be used even when SYMBOL_DATE is set to 0.
188
+
189
+ Set the tick type for this EP to __OQD__::*
190
+ The correct database and
191
+ tick type will be set by the EP.
192
+
193
+ Input: None
194
+
195
+ Output: A series of ticks.
196
+
197
+ Parameters:
198
+
199
+
200
+ ADJUST_TYPES
201
+ (string)
202
+
203
+
204
+
205
+ A string containing a comma separate list of adjustment types to
206
+ apply. The types may be any of: SPLIT, STOCK_DIVIDEND, RIGHTS, or
207
+ SPINOFF. The default is SPLIT,STOCK_DIVIDEND,RIGHTS,SPINOFF.
208
+ """
209
+
210
+ class Parameters:
211
+ adjust_types = "ADJUST_TYPES"
212
+ shared_state_variables = "SHARED_STATE_VARIABLES"
213
+
214
+ @staticmethod
215
+ def list_parameters():
216
+ list_val = ["adjust_types", "shared_state_variables"]
217
+ return list_val
218
+
219
+ __slots__ = ["adjust_types", "_default_adjust_types"]
220
+
221
+ def __init__(self, adjust_types="SPLIT,STOCK_DIVIDEND,RIGHTS,SPINOFF", shared_state_variables=""):
222
+ BaseOqdEp.__init__(self, shared_state_variables)
223
+ self._default_adjust_types = "SPLIT,STOCK_DIVIDEND,RIGHTS,SPINOFF"
224
+ self.adjust_types = adjust_types
225
+
226
+ def set_adjust_types(self, value):
227
+ self.adjust_types = value
228
+ return self
229
+
230
+ def _get_name(self):
231
+ return "OTQ::OQD_CORP_ACTION.otq"
232
+
233
+ def _to_string(self, ep_name=None, for_repr=False):
234
+ name = ep_name
235
+ if name is None:
236
+ name = self._get_name()
237
+ desc = name + "("
238
+ py_to_str = repr if for_repr else str
239
+ if self.adjust_types != "SPLIT,STOCK_DIVIDEND,RIGHTS,SPINOFF":
240
+ desc += "adjust_types=" + py_to_str(self.adjust_types) + ","
241
+ py_to_str = repr if for_repr else str
242
+ if self.shared_state_variables:
243
+ desc += "shared_state_variables=" + py_to_str(self.shared_state_variables) + ","
244
+ desc = desc[:-1]
245
+ if desc != name:
246
+ desc += ")"
247
+ if for_repr:
248
+ return desc + '()' if desc == name else desc
249
+ desc += "\n"
250
+ if len(self._symbols) > 0:
251
+ desc += "symbols=[" + ", ".join(self._symbols) + "]\n"
252
+ if len(self._tick_types) > 0:
253
+ desc += "tick_types=[" + ', '.join(self._tick_types) + "]\n"
254
+ if self._process_node_locally:
255
+ desc += "process_node_locally=True\n"
256
+ if self._node_name:
257
+ desc += "node_name=" + self._node_name + "\n"
258
+ return desc
259
+
260
+
261
+ class OqdCorpDailyFactor(BaseOqdEp):
262
+ """
263
+ OQD_CORP_DAILY_FACTOR
264
+
265
+  
266
+
267
+ Type: Other
268
+
269
+ Description:A
270
+ OneQuantData™ source EP to generate a daily series of
271
+ multiplicative corporate action adjustment factors.
272
+
273
+ This EP will generate a time series containing the total
274
+ multiplicative adjustment factors for each day over the query range.
275
+ For days on which there were no corporate actions, the
276
+ OQD_CORP_DAILY_FACTOR EP will return values of 1.0.
277
+
278
+ For adjusting the entire history of a time series, see the CORP_ACTION
279
+ EP or the OQD_CORP_ACTION EP.
280
+
281
+ The OQD_CORP_DAILY_FACTOR EP is used when a time series is needed that
282
+ calculates the daily adjustment factor taking into account the possibility
283
+ of multiple corporate actions on the same day. This EP only
284
+ accumulates factors per day. It does not accumulate factors over
285
+ time.
286
+
287
+ Set the tick type for this EP to __OQD__::*
288
+ The correct database and
289
+ tick type will be set by the EP.
290
+
291
+ Input: None
292
+
293
+ Output: A series of ticks.
294
+
295
+ Parameters:
296
+
297
+
298
+ ADJUST_TYPES (string)
299
+
300
+
301
+ A string containing a comman separate list of adjustment types to
302
+ apply. The types may be any of: SPLIT, STOCK_DIVIDEND, RIGHTS, or
303
+ SPINOFF. The default is SPLIT,STOCK_DIVIDEND,RIGHTS,SPINOFF.
304
+ """
305
+
306
+ class Parameters:
307
+ action_type = "ACTION_TYPE"
308
+ shared_state_variables = "SHARED_STATE_VARIABLES"
309
+
310
+ @staticmethod
311
+ def list_parameters():
312
+ list_val = ["action_type", "shared_state_variables"]
313
+ return list_val
314
+
315
+ __slots__ = ["action_type", "_default_action_type"]
316
+
317
+ def __init__(self, action_type="SPLIT,STOCK_DIVIDEND,RIGHTS,SPINOFF", shared_state_variables=""):
318
+ BaseOqdEp.__init__(self, shared_state_variables)
319
+ self._default_action_type = "SPLIT,STOCK_DIVIDEND,RIGHTS,SPINOFF"
320
+ self.action_type = action_type
321
+
322
+ def set_action_type(self, value):
323
+ self.action_type = value
324
+ return self
325
+
326
+ def _get_name(self):
327
+ return "OTQ::OQD_CORP_DAILY_FACTOR.otq"
328
+
329
+ def _to_string(self, ep_name=None, for_repr=False):
330
+ name = ep_name
331
+ if name is None:
332
+ name = self._get_name()
333
+ desc = name + "("
334
+ py_to_str = repr if for_repr else str
335
+ if self.action_type != "SPLIT,STOCK_DIVIDEND,RIGHTS,SPINOFF":
336
+ desc += "action_type=" + py_to_str(self.action_type) + ","
337
+ py_to_str = repr if for_repr else str
338
+ if self.shared_state_variables:
339
+ desc += "shared_state_variables=" + py_to_str(self.shared_state_variables) + ","
340
+ desc = desc[:-1]
341
+ if desc != name:
342
+ desc += ")"
343
+ if for_repr:
344
+ return desc + '()' if desc == name else desc
345
+ desc += "\n"
346
+ if len(self._symbols) > 0:
347
+ desc += "symbols=[" + ", ".join(self._symbols) + "]\n"
348
+ if len(self._tick_types) > 0:
349
+ desc += "tick_types=[" + ', '.join(self._tick_types) + "]\n"
350
+ if self._process_node_locally:
351
+ desc += "process_node_locally=True\n"
352
+ if self._node_name:
353
+ desc += "node_name=" + self._node_name + "\n"
354
+ return desc
355
+
356
+
357
+ class OqdSourceBbgbsym(BaseOqdEp):
358
+ """
359
+ OQD_SOURCE_BBGBSYM
360
+
361
+  
362
+
363
+ Type: Other
364
+
365
+ Description: A OneQuantData™ source EP to retrieve OpenFIGI symbology
366
+ using a symbol in the full Bloomberg ticker format, {TICKER} {EXCH_CODE} {Yellow Key} .
367
+
368
+ This EP will return a time series that includes the OneMarketData OID, the venue FIGI,
369
+ Bloomberg yellow key, Bloomberg exchange code, Bloomberg ticker, composite FIGI,
370
+ share class FIGI, Bloomberg security type, and Bloomberg security name.
371
+
372
+ Coverage for OpenFIGI symbology begins on October 6th, 2014.
373
+
374
+ The OQD_SOURCE_BBGBSYM EP performs an automatic lookback in the database
375
+ and is guaranteed to return output at the start time of the query if
376
+ the security existed on that day. After the first tick, there will only be ticks
377
+ on days when some field in the data changes.
378
+
379
+ Pass the output of OQD_SOURCE_BBGBSYM through a JOIN_BY_TIME EP or an
380
+ aggregation EP to create a daily series of descriptive data.
381
+
382
+ The tick type for this EP may be set to OQD::*
383
+ The correct database and tick type will be supplied by the EP.
384
+
385
+ Input: None
386
+
387
+ Output: A series of ticks.
388
+
389
+ Parameters: There are no parameters for this EP.
390
+ """
391
+
392
+ def _get_name(self):
393
+ return "OTQ::OQD_SOURCE_BBGBSYM.otq"
394
+
395
+
396
+ class OqdSourceBbgbtkr(BaseOqdEp):
397
+ """
398
+ OQD_SOURCE_BBGBTKR
399
+
400
+  
401
+
402
+ Type: Other
403
+
404
+ Description: A OneQuantData™ source EP to retrieve OpenFIGI symbology using a symbol
405
+ in the short Bloomberg ticker format, {TICKER} {EXCH_CODE} .
406
+
407
+ This EP will return a time series that includes the OneMarketData OID, the venue FIGI,
408
+ Bloomberg yellow key, Bloomberg exchange code, Bloomberg ticker, composite FIGI,
409
+ share class FIGI, Bloomberg security type, and Bloomberg security name.
410
+
411
+ Coverage for OpenFIGI symbology begins on October 6th, 2014.
412
+
413
+ The OQD_SOURCE_BBGBTKR EP performs an automatic lookback in the database
414
+ and is guaranteed to return output at the start time of the query if
415
+ the security existed on that day. After the first tick, there will only be ticks
416
+ on days when some field in the data changes.
417
+
418
+ Pass the output of OQD_SOURCE_BBGBTKR through a JOIN_BY_TIME EP or an
419
+ aggregation EP to create a daily series of descriptive data.
420
+
421
+ The tick type for this EP may be set to OQD::*
422
+ The correct database and tick type will be supplied by the EP.
423
+
424
+ Input: None
425
+
426
+ Output: A series of ticks.
427
+
428
+ Parameters: There are no parameters for this EP.
429
+ """
430
+
431
+ def _get_name(self):
432
+ return "OTQ::OQD_SOURCE_BBGBTKR.otq"
433
+
434
+
435
+ class OqdSourceBbgfgc(BaseOqdEp):
436
+ """
437
+ OQD_SOURCE_BBGFGC
438
+
439
+  
440
+
441
+ Type: Other
442
+
443
+ Description: A OneQuantData™ source EP to retrieve OpenFIGI symbology
444
+ using a symbol that is a Composite FIGI.
445
+
446
+ Multiple FIGI identifiers may be associated with a single composite FIGI.
447
+ This EP will return multiple ticks per day for each FIGI associated with the composite FIGI.
448
+
449
+ This EP will return a time series that includes the OneMarketData OID, the venue FIGI,
450
+ Bloomberg yellow key, Bloomberg exchange code, Bloomberg ticker, composite FIGI,
451
+ share class FIGI, Bloomberg security type, and Bloomberg security name.
452
+
453
+ Coverage for OpenFIGI symbology begins on October 6th, 2014.
454
+
455
+ The OQD_SOURCE_BBGFGC EP performs an automatic lookback in the database
456
+ and is guaranteed to return output at the start time of the query if
457
+ the security existed on that day. After the first tick, there will only be ticks
458
+ on days when some field in the data changes.
459
+
460
+ Pass the output of OQD_SOURCE_BBGFGC through a JOIN_BY_TIME EP or an
461
+ aggregation EP to create a daily series of descriptive data.
462
+
463
+ The tick type for this EP may be set to OQD::*
464
+ The correct database and tick type will be supplied by the EP.
465
+
466
+ Input: None
467
+
468
+ Output: A series of ticks.
469
+
470
+ Parameters: There are no parameters for this EP.
471
+ """
472
+
473
+ def _get_name(self):
474
+ return "OTQ::OQD_SOURCE_BBGFGC.otq"
475
+
476
+
477
+ class OqdSourceBbgfgs(BaseOqdEp):
478
+ """
479
+ OQD_SOURCE_BBGFGS
480
+
481
+  
482
+
483
+ Type: Other
484
+
485
+ Description: A OneQuantData™ source EP to retrieve OpenFIGI symbology
486
+ using a symbol that is a share class FIGI.
487
+
488
+ Multiple FIGI identifiers may be associated with a single share class FIGI.
489
+ This EP will return multiple ticks per day for each FIGI associated with the share class FIGI.
490
+ The share class FIGI may be used to find alternate venues where a security trades.
491
+
492
+ This EP will return a time series that includes the OneMarketData OID, the venue FIGI,
493
+ Bloomberg yellow key, Bloomberg exchange code, Bloomberg ticker, composite FIGI,
494
+ share class FIGI, Bloomberg security type, and Bloomberg security name.
495
+
496
+ Coverage for OpenFIGI symbology begins on October 6th, 2014.
497
+
498
+ The OQD_SOURCE_BBGFGS EP performs an automatic lookback in the database
499
+ and is guaranteed to return output at the start time of the query if
500
+ the security existed on that day. After the first tick, there will only be ticks
501
+ on days when some field in the data changes.
502
+
503
+ Pass the output of OQD_SOURCE_BBGFGS through a JOIN_BY_TIME EP or an
504
+ aggregation EP to create a daily series of descriptive data.
505
+
506
+ The tick type for this EP may be set to OQD::*
507
+ The correct database and tick type will be supplied by the EP.
508
+
509
+ Input: None
510
+
511
+ Output: A series of ticks.
512
+
513
+ Parameters: There are no parameters for this EP.
514
+ """
515
+
516
+ def _get_name(self):
517
+ return "OTQ::OQD_SOURCE_BBGFGS.otq"
518
+
519
+
520
+ class OqdSourceBbgfgv(BaseOqdEp):
521
+ """
522
+ OQD_SOURCE_BBGFGV
523
+
524
+  
525
+
526
+ Type: Other
527
+
528
+ Description: A OneQuantData™ source EP to retrieve OpenFIGI symbology
529
+ using a symbol that is a venue FIGI, which is the FIGI associated
530
+ with a particular trading line on a particular venue.
531
+
532
+ This EP will return a time series that includes the OneMarketData OID, the venue FIGI,
533
+ Bloomberg yellow key, Bloomberg exchange code, Bloomberg ticker, composite FIGI,
534
+ share class FIGI, Bloomberg security type, and Bloomberg security name.
535
+
536
+ Coverage for OpenFIGI symbology begins on October 6th, 2014.
537
+
538
+ The OQD_SOURCE_BBGFGV EP performs an automatic lookback in the database
539
+ and is guaranteed to return output at the start time of the query if
540
+ the security existed on that day. After the first tick, there will only be ticks
541
+ on days when some field in the data changes.
542
+
543
+ Pass the output of OQD_SOURCE_BBGFGV through a JOIN_BY_TIME EP or an
544
+ aggregation EP to create a daily series of descriptive data.
545
+
546
+ The tick type for this EP may be set to OQD::*
547
+ The correct database and tick type will be supplied by the EP.
548
+
549
+ Input: None
550
+
551
+ Output: A series of ticks.
552
+
553
+ Parameters: There are no parameters for this EP.
554
+ """
555
+
556
+ def _get_name(self):
557
+ return "OTQ::OQD_SOURCE_BBGFGV.otq"
558
+
559
+
560
+ class OqdSourceBbgoid(BaseOqdEp):
561
+ """
562
+ OQD_SOURCE_BBGOID
563
+
564
+  
565
+
566
+ Type: Other
567
+
568
+ Description: A OneQuantData™ source EP to retrieve OpenFIGI symbology
569
+ using a symbol that is a OneMarketData OID.
570
+
571
+ Multiple FIGI identifiers may map to a single OID.
572
+ This EP may return multiple ticks per day for each FIGI associated with an OID.
573
+
574
+ This EP will return a time series that includes the OneMarketData OID, the venue FIGI,
575
+ Bloomberg yellow key, Bloomberg exchange code, Bloomberg ticker, composite FIGI,
576
+ share class FIGI, Bloomberg security type, and Bloomberg security name.
577
+
578
+ Coverage for OpenFIGI symbology begins on October 6th, 2014.
579
+
580
+ The OQD_SOURCE_BBGOID EP performs an automatic lookback in the database
581
+ and is guaranteed to return output at the start time of the query if
582
+ the security existed on that day. After the first tick, there will only be ticks
583
+ on days when some field in the data changes.
584
+
585
+ Pass the output of OQD_SOURCE_BBGOID through a JOIN_BY_TIME EP or an
586
+ aggregation EP to create a daily series of descriptive data.
587
+
588
+ The tick type for this EP may be set to OQD::*
589
+ The correct database and tick type will be supplied by the EP.
590
+
591
+ Input: None
592
+
593
+ Output: A series of ticks.
594
+
595
+ Parameters: There are no parameters for this EP.
596
+ """
597
+
598
+ def _get_name(self):
599
+ return "OTQ::OQD_SOURCE_BBGOID.otq"
600
+
601
+
602
+ class OqdSourceCacs(BaseOqdEp):
603
+ """
604
+ OQD_SOURCE_CACS
605
+
606
+  
607
+
608
+ Type: Other
609
+
610
+ Description:A
611
+ OneQuantData™ source EP to retrieve a time series of corporate
612
+ actions for a symbol.
613
+
614
+ This EP will return all corporate action fields available for a symbol
615
+ with EX-Dates between the query start time and end time. The
616
+ timestamp of the series is equal to the EX-Date of the corporate
617
+ action with a time of 0:00:00 GMT.
618
+
619
+ Set the tick type for this EP to __OQD__::*
620
+ The correct database and
621
+ tick type will be set by the EP.
622
+
623
+ Input: None
624
+
625
+ Output: A series of ticks.
626
+
627
+ Parameters: There are no parameters for this EP.
628
+ """
629
+
630
+ def _get_name(self):
631
+ return "OTQ::OQD_SOURCE_CACS.otq"
632
+
633
+
634
+ class OqdSourceCact(BaseOqdEp):
635
+ """
636
+ OQD_SOURCE_CACT
637
+  
638
+ Type: Other
639
+ Description: A
640
+ OneQuantData™ source EP to retrieve a time series of corporate
641
+ actions for all symbols.
642
+
643
+ This EP will return a subset of corporate action fields for all
644
+ symbols.
645
+
646
+ The OQD_SOURCE_CACT EP is used in conjunction with the special symbols EX_DATE,
647
+ ANN_DATE, PAY_DATE, and REC_DATE. It will return all corporate
648
+ actions for all symbols with the specified type of date between the query
649
+ start time and query end time.
650
+
651
+ For example, if the special symbol EX_DATE is used, then the timestamp
652
+ of the series is the corporate action EX-date with a time of 0:00:00
653
+ GMT and the EP will return all corporate actions with EX-dates between
654
+ the query start time and the query end time. If the symbol is
655
+ REC_DATE, then all of the timestamps would correspond to corporate
656
+ action record dates.
657
+
658
+ The OQD_SOURCE_CACT EP is typically used in stage 1 queries to quickly
659
+ discover a list of securities involved in corporate actions. Please
660
+ note that if using one of the special symbols other than EX_DATE, the
661
+ EX-date of the corporate action may fall outside of the query time
662
+ range.
663
+
664
+ Set the tick type for this EP to __OQD__::*
665
+ The correct database and
666
+ tick type will be set by the EP.
667
+
668
+ Input: None
669
+
670
+ Output: A series of ticks.
671
+
672
+ Parameters: There are no parameters for this EP.
673
+ """
674
+
675
+ def _get_name(self):
676
+ return "OTQ::OQD_SOURCE_CACT.otq"
677
+
678
+
679
+ class OqdSourceDes(BaseOqdEp):
680
+ """
681
+ OQD_SOURCE_DES
682
+
683
+  
684
+
685
+ Type: Other
686
+
687
+ Description: A OneQuantData™ source EP to retrieve a time series of
688
+ descriptive fields for a symbol.
689
+
690
+ This EP will return the history of descriptive fields for a symbol.
691
+ There will only be ticks on days when some field in the descriptive
692
+ data changes.
693
+
694
+ The OQD_SOURCE_DES EP performs an automatic lookback in the database
695
+ and is guaranteed to return output at the start time of the query if
696
+ the security existed on that day.
697
+
698
+ Pass the output of OQD_SOURCE_DES through a JOIN_BY_TIME EP or an
699
+ aggregation EP to create a daily series of descriptive data.
700
+
701
+ Set the tick type for this EP to __OQD__::*
702
+ The correct database and
703
+ tick type will be set by the EP.
704
+
705
+ Input: None
706
+
707
+ Output: A series of ticks.
708
+
709
+ Parameters: There are no parameters for this EP.
710
+ """
711
+
712
+ def _get_name(self):
713
+ return "OTQ::OQD_SOURCE_DES.otq"
714
+
715
+
716
+ class OqdSourceDprcAll(BaseOqdEp):
717
+ """
718
+ OQD_SOURCE_DPRC_ALL
719
+
720
+  
721
+
722
+ Type: Other
723
+
724
+ Description: A
725
+ OneQuantData™ source EP to retrieve a time series of unadjusted
726
+ prices for a symbol for all available pricing exchanges.
727
+
728
+ The OQD_SOURCE_DPRC_ALL EP retrieves a time series of all available
729
+ daily unadjusted prices for a symbol. The OneQuantData exchange code for each
730
+ price series is in the EXCH field.
731
+
732
+ To adjust the data for corporate actions, use either the
733
+ OQD_CORP_ACTION EP or the CORP_ACTION EP.
734
+
735
+ To retrieve a price series for only one particular exchange, see
736
+ OQD_SOURCE_DPRC_EXCH. For a price series that tracks either the
737
+ composite series or the primary exchange series, see
738
+ OQD_SOURCE_DPRC_MAIN.
739
+
740
+ Set the tick type for this EP to __OQD__::*
741
+ The correct database and
742
+ tick type will be set by the EP.
743
+
744
+ Input: None
745
+
746
+ Output: A series of ticks.
747
+
748
+ Parameters: There are no parameters for this EP.
749
+ """
750
+
751
+ def _get_name(self):
752
+ return "OTQ::OQD_SOURCE_DPRC_ALL.otq"
753
+
754
+
755
+ class OqdSourceDprcExch(BaseOqdEp):
756
+ """
757
+ OQD_SOURCE_DPRC_EXCH
758
+
759
+  
760
+
761
+ Type: Other
762
+
763
+ Description: A
764
+ OneQuantData™ source EP to retrieve a time series of unadjusted
765
+ prices for a symbol for one particular pricing exchange.
766
+
767
+ The OQD_SOURCE_DPRC_ALL EP retrieves a time series of daily unadjusted
768
+ prices for a symbol. A OneQuantData exchange code must be supplied as
769
+ an argument to the EP.
770
+
771
+ To adjust the data for corporate actions, use either the
772
+ OQD_CORP_ACTION EP or the CORP_ACTION EP.
773
+
774
+ To retrieve a price series for all exchanges available in OneQuantData, see
775
+ OQD_SOURCE_DPRC_ALL. For a price series that tracks either the
776
+ composite series or the primary exchange series, see
777
+ OQD_SOURCE_DPRC_MAIN.
778
+
779
+ Set the tick type for this EP to __OQD__::*
780
+ The correct database and
781
+ tick type will be set by the EP.
782
+
783
+ Input: None
784
+
785
+ Output: A series of ticks.
786
+
787
+ Parameters:
788
+
789
+
790
+ EXCH (string)
791
+
792
+
793
+ The OneQuantData exchange code for the desired price series.
794
+
795
+ The OneQuantData exchange code is formed from the 2 letter ISO country
796
+ code plus the 4 letter ISO MIC code. For countries that have a
797
+ composite price series, use COMP for the exchange portion of the
798
+ code. For example, USCOMP is the code for US composite pricing.
799
+ """
800
+
801
+ class Parameters:
802
+ exch = "EXCH"
803
+ shared_state_variables = "SHARED_STATE_VARIABLES"
804
+
805
+ @staticmethod
806
+ def list_parameters():
807
+ list_val = ["exch", "shared_state_variables"]
808
+ return list_val
809
+
810
+ __slots__ = ["exch", "_default_exch"]
811
+
812
+ def __init__(self, exch="USCOMP", shared_state_variables=""):
813
+ BaseOqdEp.__init__(self, shared_state_variables)
814
+ self._default_exch = "USCOMP"
815
+ self.exch = exch
816
+
817
+ def set_exch(self, value):
818
+ self.exch = value
819
+ return self
820
+
821
+ def _get_name(self):
822
+ return "OTQ::OQD_SOURCE_DPRC_EXCH.otq"
823
+
824
+ def _to_string(self, ep_name=None, for_repr=False):
825
+ name = ep_name
826
+ if name is None:
827
+ name = self._get_name()
828
+ desc = name + "("
829
+ py_to_str = repr if for_repr else str
830
+ if self.exch != "USCOMP":
831
+ desc += "exch=" + py_to_str(self.exch) + ","
832
+ py_to_str = repr if for_repr else str
833
+ if self.shared_state_variables:
834
+ desc += "shared_state_variables=" + py_to_str(self.shared_state_variables) + ","
835
+ desc = desc[:-1]
836
+ if desc != name:
837
+ desc += ")"
838
+ if for_repr:
839
+ return desc + '()' if desc == name else desc
840
+ desc += "\n"
841
+ if len(self._symbols) > 0:
842
+ desc += "symbols=[" + ", ".join(self._symbols) + "]\n"
843
+ if len(self._tick_types) > 0:
844
+ desc += "tick_types=[" + ', '.join(self._tick_types) + "]\n"
845
+ if self._process_node_locally:
846
+ desc += "process_node_locally=True\n"
847
+ if self._node_name:
848
+ desc += "node_name=" + self._node_name + "\n"
849
+ return desc
850
+
851
+
852
+ class OqdSourceSho(BaseOqdEp):
853
+ """
854
+ OQD_SOURCE_SHO
855
+
856
+  
857
+
858
+ Type: Other
859
+
860
+ Description: A
861
+ OneQuantData™ source EP to retrieve a time series of shares
862
+ outstanding for a stock.
863
+
864
+ The OQD_SOURCE_SHO EP retrieves a time series of shares outstanding
865
+ for a stock. This EP only applies to stocks or securities that have
866
+ published shares outstanding data.
867
+
868
+ The series represents total shares outstanding and is not free float
869
+ adjusted.
870
+
871
+ Set the tick type for this EP to __OQD__::*
872
+ The correct database and
873
+ tick type will be set by the EP.
874
+
875
+ Input: None
876
+
877
+ Output: A series of ticks.
878
+
879
+ Parameters: There are no parameters for this EP.
880
+ """
881
+
882
+ def _get_name(self):
883
+ return "OTQ::OQD_SOURCE_SHO.otq"
884
+
885
+
886
+ class OqdSourceXoid(BaseOqdEp):
887
+ """
888
+ OQD_SOURCE_XOID
889
+
890
+  
891
+
892
+ Type: Other
893
+
894
+ Description: A
895
+ OneQuantData™ source EP to retrieve raw ticks from the OQD_XOID
896
+ database.
897
+
898
+ The OQD_XOID database translates internal OneQuantData IDs (OIDs) into
899
+ standard identifiers like CUSIP, SEDOL, or TICKER.
900
+
901
+ The OQD_SOURCE_XOID EP will return a consolidated time series of
902
+ symbol translations keyed by exchange code (EXCH) and symbol type (ID_TYPE). Each
903
+ translation is valid from the timestamp of the tick until the
904
+ timestamp given in field END_DATE.
905
+
906
+ This EP performs a lookback to ensure that ticks are available for the
907
+ query start time, if there are valid ticks that cover that time.
908
+
909
+ Use the OQD_SOURCE_XOID EP to write custom symbol translation queries.
910
+
911
+ Set the tick type for this EP to OQD::*
912
+ The correct database and
913
+ tick type will be set by the EP.
914
+
915
+ Input: None
916
+
917
+ Output: A series of ticks.
918
+
919
+ Parameters:
920
+
921
+
922
+ FIGI_COMPOSITE_FILTER
923
+ (boolean)
924
+
925
+
926
+
927
+ When set to false, all Bloomberg tickers and FIGIs associated with an OID will be returned.
928
+ When set to true, only the composite Bloomberg ticker and FIGI are returned.
929
+ This option does not have an effect on any other symbol types. The default is false.
930
+ """
931
+
932
+ class Parameters:
933
+ figi_composite_filter = "FIGI_COMPOSITE_FILTER"
934
+ shared_state_variables = "SHARED_STATE_VARIABLES"
935
+
936
+ @staticmethod
937
+ def list_parameters():
938
+ list_val = ["figi_composite_filter", "shared_state_variables"]
939
+ return list_val
940
+
941
+ __slots__ = ["figi_composite_filter", "_default_figi_composite_filter"]
942
+
943
+ def __init__(self, figi_composite_filter=False, shared_state_variables=""):
944
+ BaseOqdEp.__init__(self, shared_state_variables)
945
+ self._default_figi_composite_filter = False
946
+ self.figi_composite_filter = figi_composite_filter
947
+
948
+ def set_figi_composite_filter(self, value):
949
+ self.figi_composite_filter = value
950
+ return self
951
+
952
+ def _get_name(self):
953
+ return "OTQ::OQD_SOURCE_XOID.otq"
954
+
955
+ def _to_string(self, ep_name=None, for_repr=False):
956
+ name = ep_name
957
+ if name is None:
958
+ name = self._get_name()
959
+ desc = name + "("
960
+ py_to_str = repr if for_repr else str
961
+ if self.figi_composite_filter:
962
+ desc += "figi_composite_filter=" + py_to_str(self.figi_composite_filter) + ","
963
+ py_to_str = repr if for_repr else str
964
+ if self.shared_state_variables:
965
+ desc += "shared_state_variables=" + py_to_str(self.shared_state_variables) + ","
966
+ desc = desc[:-1]
967
+ if desc != name:
968
+ desc += ")"
969
+ if for_repr:
970
+ return desc + '()' if desc == name else desc
971
+ desc += "\n"
972
+ if len(self._symbols) > 0:
973
+ desc += "symbols=[" + ", ".join(self._symbols) + "]\n"
974
+ if len(self._tick_types) > 0:
975
+ desc += "tick_types=[" + ', '.join(self._tick_types) + "]\n"
976
+ if self._process_node_locally:
977
+ desc += "process_node_locally=True\n"
978
+ if self._node_name:
979
+ desc += "node_name=" + self._node_name + "\n"
980
+ return desc
981
+
982
+
983
+ class OqdSourceXref(BaseOqdEp):
984
+ """
985
+ OQD_SOURCE_XREF
986
+
987
+  
988
+
989
+ Type: Other
990
+
991
+ Description: A OneQuantData™ source EP to retrieve raw ticks from the XREF database.
992
+ The XREF database contains records used to translate external symbols to the OneQuantData internal identifier (OID).
993
+
994
+ The OQD_SOURCE_XREF EP will return a consolidated time series of symbol translations
995
+ keyed by exchange code and symbol type.
996
+ Each translation is valid from the timestamp of the tick until the timestamp given in field END_DATE.
997
+ The symbols for this EP should be of the form SYMBOL^SYMBOL_TYPE
998
+ where SYMBOL is the external symbol and SYMBOL_TYPE is the code for one of of the supported symbol types.
999
+
1000
+ The currently supported symbol types are TKR, SED, CUS, ISN, and TAQ for ticker,
1001
+ SEDOL, CUSIP, ISIN, and TAQ ticker (US only), respectively.
1002
+
1003
+ This EP performs a lookback to ensure that ticks are available for the query start time,
1004
+ if there are valid ticks that cover that time.
1005
+
1006
+ Use the OQD_SOURCE_XREF EP to write custom symbol translation queries.
1007
+
1008
+ Set the tick type for this EP to "__OQD__::*". The correct database and tick type will be set by the EP.
1009
+
1010
+ Input: None
1011
+
1012
+ Output: A series of ticks.
1013
+
1014
+ Parameters: There are no parameters for this EP.
1015
+ """
1016
+
1017
+ def _get_name(self):
1018
+ return "OTQ::OQD_SOURCE_XREF.otq"
1019
+
1020
+
1021
+ class OqdSourceXsym(BaseOqdEp):
1022
+ """
1023
+ OQD_SOURCE_XSYM
1024
+
1025
+  
1026
+
1027
+ Type: Other
1028
+
1029
+ Description: A
1030
+ OneQuantData™ source EP to retrieve raw ticks from the OQD_XSYM
1031
+ database.
1032
+
1033
+ The OQD_XSYM database translates external identifiers like CUSIP,
1034
+ SEDOL, or TICKER to internal OneQuantData IDs (OIDs).
1035
+
1036
+ The OQD_SOURCE_XSYM EP will return a consolidated time series of
1037
+ symbol translations keyed by exchange code and symbol type. Each
1038
+ translation is valid from the timestamp of the tick until the
1039
+ timestamp given in field END_DATE.
1040
+
1041
+ The symbols for this EP should be of the form SYMBOL^SYMBOL_TYPE where SYMBOL is the
1042
+ external symbol and SYMBOL_TYPE is the code for one of of the
1043
+ supported symbol types. For example, a symbol IBM^TKR would return a
1044
+ set of ticks supplying the OID for stock ticker IBM.
1045
+
1046
+ Other symbol types include CUS, SED, or ISN for CUSIP, SEDOL, or ISIN,
1047
+ if those symbol types are included in your OneQuantData subscription.
1048
+
1049
+ Use the OQD_SOURCE_XREF EP to write custom symbol translation queries.
1050
+
1051
+ Set the tick type for this EP to __OQD__::*
1052
+ The correct database and
1053
+ tick type will be set by the EP.
1054
+
1055
+ Input: None
1056
+
1057
+ Output: A series of ticks.
1058
+
1059
+ Parameters: There are no parameters for this EP.
1060
+ """
1061
+
1062
+ def _get_name(self):
1063
+ return "OTQ::OQD_SOURCE_XSYM.otq"
1064
+
1065
+
1066
+ class OqdTranslate(BaseOqdEp):
1067
+ """
1068
+ OQD_TRANSLATE
1069
+
1070
+  
1071
+
1072
+ Type: Other
1073
+
1074
+ Description: A
1075
+ OneQuantData™ source EP to perform symbol translation.
1076
+
1077
+
1078
+ This EP is maintained for backwards compatibility and may be deprecated
1079
+ in future releases of OneQuantData.
1080
+
1081
+ The OQD_TRANSLATE EP may be used to write custom symbol translation
1082
+ queries.
1083
+
1084
+ For access to the raw underlying data used by the OQD_TRANSLATE EP,
1085
+ see the OQD_SOURCE_XSYM and OQD_SOURCE_XOID EPs.
1086
+
1087
+ Symbols supplied to the OQD_TRANSLATE EP should be of the form SYMBOL^SYMBOL_TYPE where SYMBOL is the
1088
+ external symbol and SYMBOL_TYPE is the code for one of of the
1089
+ supported symbol types. For example, a symbol IBM^TKR would be used
1090
+ in the symbol list to translate the stock ticker IBM into another alternate
1091
+ symbology like CUSIP.
1092
+
1093
+ The OQD_TRANSLATE EP does not require that a Onetick reference file is
1094
+ loaded or configured. It may be used in queries where symbol date is
1095
+ set to 0.
1096
+
1097
+ See also the REF_DATA and SYMBOLOGY_MAPPING EPs, which require that
1098
+ a Onetick reference file is configured and loaded.
1099
+
1100
+ Input: None
1101
+
1102
+ Output: A series of ticks.
1103
+
1104
+ Parameters:
1105
+
1106
+
1107
+ ASOF_DATE (integer)
1108
+
1109
+
1110
+ The date on which the translation should apply
1111
+
1112
+
1113
+ TO_ID (string)
1114
+
1115
+
1116
+ The symbol type that should be returned.
1117
+ The type should be specified as a OneQuantData symbol type abbreviation
1118
+
1119
+
1120
+ EXCH (string)
1121
+
1122
+
1123
+ The exchange to which the symbol translation applies.
1124
+ The exchange code should be specified as a OneQuantData exchange code
1125
+ """
1126
+
1127
+ class Parameters:
1128
+ asof_date = "ASOF_DATE"
1129
+ to_id = "TO_ID"
1130
+ exch = "EXCH"
1131
+ shared_state_variables = "SHARED_STATE_VARIABLES"
1132
+
1133
+ @staticmethod
1134
+ def list_parameters():
1135
+ list_val = ["asof_date", "to_id", "exch", "shared_state_variables"]
1136
+ return list_val
1137
+
1138
+ __slots__ = ["asof_date", "_default_asof_date", "to_id", "_default_to_id", "exch", "_default_exch"]
1139
+
1140
+ def __init__(self, asof_date="", to_id="OID", exch="USCOMP", shared_state_variables=""):
1141
+ BaseOqdEp.__init__(self, shared_state_variables)
1142
+ self._default_asof_date = ""
1143
+ self.asof_date = asof_date
1144
+ self._default_to_id = "OID"
1145
+ self.to_id = to_id
1146
+ self._default_exch = "USCOMP"
1147
+ self.exch = exch
1148
+
1149
+ def set_asof_date(self, value):
1150
+ self.asof_date = value
1151
+ return self
1152
+
1153
+ def set_to_id(self, value):
1154
+ self.to_id = value
1155
+ return self
1156
+
1157
+ def set_exch(self, value):
1158
+ self.exch = value
1159
+ return self
1160
+
1161
+ def _get_name(self):
1162
+ return "OTQ::OQD_TRANSLATE.otq"
1163
+
1164
+ def _to_string(self, ep_name=None, for_repr=False):
1165
+ name = ep_name
1166
+ if name is None:
1167
+ name = self._get_name()
1168
+ desc = name + "("
1169
+ py_to_str = repr if for_repr else str
1170
+ if self.asof_date:
1171
+ desc += "asof_date=" + py_to_str(self.asof_date) + ","
1172
+ py_to_str = repr if for_repr else str
1173
+ if self.to_id != "OID":
1174
+ desc += "to_id=" + py_to_str(self.to_id) + ","
1175
+ py_to_str = repr if for_repr else str
1176
+ if self.exch != "USCOMP":
1177
+ desc += "exch=" + py_to_str(self.exch) + ","
1178
+ py_to_str = repr if for_repr else str
1179
+ if self.shared_state_variables:
1180
+ desc += "shared_state_variables=" + py_to_str(self.shared_state_variables) + ","
1181
+ desc = desc[:-1]
1182
+ if desc != name:
1183
+ desc += ")"
1184
+ if for_repr:
1185
+ return desc + '()' if desc == name else desc
1186
+ desc += "\n"
1187
+ if len(self._symbols) > 0:
1188
+ desc += "symbols=[" + ", ".join(self._symbols) + "]\n"
1189
+ if len(self._tick_types) > 0:
1190
+ desc += "tick_types=[" + ', '.join(self._tick_types) + "]\n"
1191
+ if self._process_node_locally:
1192
+ desc += "process_node_locally=True\n"
1193
+ if self._node_name:
1194
+ desc += "node_name=" + self._node_name + "\n"
1195
+ return desc