forked from robcarver17/pysystemtrade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_futures_sim_data.py
49 lines (37 loc) · 1.52 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
40
41
42
43
44
45
46
47
48
49
"""
Get data from mongo and arctic used for futures trading
"""
from syscore.constants 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.csv.csv_instrument_data import csvFuturesInstrumentData
from sysdata.csv.csv_roll_parameters import csvRollParametersData
from sysdata.mongodb.mongo_spread_costs import mongoSpreadCostData
from sysdata.data_blob import dataBlob
from sysdata.sim.futures_sim_data_with_data_blob import genericBlobUsingFuturesSimData
from syslogging.logger import *
class dbFuturesSimData(genericBlobUsingFuturesSimData):
def __init__(
self, data: dataBlob = arg_not_supplied, log=get_logger("dbFuturesSimData")
):
if data is arg_not_supplied:
data = dataBlob(
log=log,
class_list=[
arcticFuturesAdjustedPricesData,
arcticFuturesMultiplePricesData,
arcticFxPricesData,
csvFuturesInstrumentData,
csvRollParametersData,
mongoSpreadCostData,
],
)
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()