forked from robcarver17/pysystemtrade
-
Notifications
You must be signed in to change notification settings - Fork 1
/
db_futures_sim_data.py
39 lines (27 loc) · 1.37 KB
/
db_futures_sim_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
Get data from mongo and arctic used for futures trading
"""
from syscore.objects import arg_not_supplied
from sysdata.arctic.arctic_adjusted_prices import arcticFuturesAdjustedPricesData
from sysdata.arctic.arctic_multiple_prices import arcticFuturesMultiplePricesData
from sysdata.arctic.arctic_spotfx_prices import arcticFxPricesData
from sysdata.mongodb.mongo_futures_instruments import mongoFuturesInstrumentData
from sysdata.mongodb.mongo_roll_data import mongoRollParametersData
from sysdata.data_blob import dataBlob
from sysdata.sim.futures_sim_data_with_data_blob import genericBlobUsingFuturesSimData
from syslogdiag.log_to_screen import logtoscreen
class dbFuturesSimData(genericBlobUsingFuturesSimData):
def __init__(self, data: dataBlob = arg_not_supplied,
log =logtoscreen("dbFuturesSimData")):
if data is arg_not_supplied:
data = dataBlob(log = log,
class_list=[arcticFuturesAdjustedPricesData, arcticFuturesMultiplePricesData,
arcticFxPricesData, mongoFuturesInstrumentData,
mongoRollParametersData])
super().__init__(data=data)
def __repr__(self):
return "dbFuturesSimData object with %d instruments" % len(
self.get_instrument_list())
if __name__ == "__main__":
import doctest
doctest.testmod()