[Add]mongoengine into requirements.txt
This commit is contained in:
parent
a5550d42c7
commit
4da519bd2c
@ -13,3 +13,4 @@ futu-api
|
|||||||
tigeropen
|
tigeropen
|
||||||
ta-lib
|
ta-lib
|
||||||
ibapi
|
ibapi
|
||||||
|
mongoengine
|
||||||
|
@ -16,10 +16,12 @@ def init(_: Driver, settings: dict):
|
|||||||
username = settings["user"]
|
username = settings["user"]
|
||||||
password = settings["password"]
|
password = settings["password"]
|
||||||
authentication_source = settings["authentication_source"]
|
authentication_source = settings["authentication_source"]
|
||||||
|
|
||||||
if not username: # if username == '' or None, skip username
|
if not username: # if username == '' or None, skip username
|
||||||
username = None
|
username = None
|
||||||
password = None
|
password = None
|
||||||
authentication_source = None
|
authentication_source = None
|
||||||
|
|
||||||
connect(
|
connect(
|
||||||
db=database,
|
db=database,
|
||||||
host=host,
|
host=host,
|
||||||
@ -28,6 +30,7 @@ def init(_: Driver, settings: dict):
|
|||||||
password=password,
|
password=password,
|
||||||
authentication_source=authentication_source,
|
authentication_source=authentication_source,
|
||||||
)
|
)
|
||||||
|
|
||||||
return MongoManager()
|
return MongoManager()
|
||||||
|
|
||||||
|
|
||||||
@ -51,7 +54,8 @@ class DbBarData(Document):
|
|||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
"indexes": [
|
"indexes": [
|
||||||
{"fields": ("datetime", "interval", "symbol", "exchange"), "unique": True}
|
{"fields": ("datetime", "interval", "symbol",
|
||||||
|
"exchange"), "unique": True}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +145,8 @@ class DbTickData(Document):
|
|||||||
ask_volume_4: float = FloatField()
|
ask_volume_4: float = FloatField()
|
||||||
ask_volume_5: float = FloatField()
|
ask_volume_5: float = FloatField()
|
||||||
|
|
||||||
meta = {"indexes": [{"fields": ("datetime", "symbol", "exchange"), "unique": True}]}
|
meta = {"indexes": [
|
||||||
|
{"fields": ("datetime", "symbol", "exchange"), "unique": True}]}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_tick(tick: TickData):
|
def from_tick(tick: TickData):
|
||||||
|
Loading…
Reference in New Issue
Block a user