38
38
39
39
40
40
class DbBarData (Model ):
41
- """K-Line Data Table Mapping Objects"""
41
+ """Bar Data Table Mapping Objects"""
42
42
43
43
id : AutoField = AutoField ()
44
44
@@ -115,7 +115,7 @@ class Meta:
115
115
116
116
117
117
class DbBarOverview (Model ):
118
- """K-Line Summary Data Table Mapping Objects"""
118
+ """Bar Summary Data Table Mapping Objects"""
119
119
120
120
id : AutoField = AutoField ()
121
121
@@ -157,7 +157,7 @@ def __init__(self) -> None:
157
157
self .db .create_tables ([DbBarData , DbTickData , DbBarOverview , DbTickOverview ])
158
158
159
159
def save_bar_data (self , bars : List [BarData ], stream : bool = False ) -> bool :
160
- """Save K-Line Data"""
160
+ """Save Bar Data"""
161
161
# Read the primary key parameters
162
162
bar : BarData = bars [0 ]
163
163
symbol : str = bar .symbol
@@ -198,7 +198,7 @@ def save_bar_data(self, bars: List[BarData], stream: bool = False) -> bool:
198
198
),
199
199
).execute ()
200
200
201
- # Updated K-line summary data
201
+ # Updated bar summary data
202
202
overview : DbBarOverview = DbBarOverview .get_or_none (
203
203
DbBarOverview .symbol == symbol ,
204
204
DbBarOverview .exchange == exchange .value ,
@@ -343,7 +343,7 @@ def load_bar_data(
343
343
start : datetime ,
344
344
end : datetime ,
345
345
) -> List [BarData ]:
346
- """Read K-line data"""
346
+ """Read bar data"""
347
347
s : ModelSelect = (
348
348
DbBarData .select ()
349
349
.where (
@@ -439,15 +439,15 @@ def load_tick_data(
439
439
def delete_bar_data (
440
440
self , symbol : str , exchange : Exchange , interval : Interval
441
441
) -> int :
442
- """Delete K-line data"""
442
+ """Delete bar data"""
443
443
d : ModelDelete = DbBarData .delete ().where (
444
444
(DbBarData .symbol == symbol )
445
445
& (DbBarData .exchange == exchange .value )
446
446
& (DbBarData .interval == interval .value )
447
447
)
448
448
count : int = d .execute ()
449
449
450
- # Delete K-line summary data
450
+ # Delete bar summary data
451
451
d2 : ModelDelete = DbBarOverview .delete ().where (
452
452
(DbBarOverview .symbol == symbol )
453
453
& (DbBarOverview .exchange == exchange .value )
@@ -473,8 +473,8 @@ def delete_tick_data(self, symbol: str, exchange: Exchange) -> int:
473
473
return count
474
474
475
475
def get_bar_overview (self ) -> List [BarOverview ]:
476
- """Query the K-line summary information in the database"""
477
- # If there is already a K-line , but summary information is missing, perform initialization
476
+ """Query the bar summary information in the database"""
477
+ # If there is already a bar , but summary information is missing, perform initialization
478
478
data_count : int = DbBarData .select ().count ()
479
479
overview_count : int = DbBarOverview .select ().count ()
480
480
if data_count and not overview_count :
@@ -498,7 +498,7 @@ def get_tick_overview(self) -> List[TickOverview]:
498
498
return overviews
499
499
500
500
def init_bar_overview (self ) -> None :
501
- """Initialize the K-line summary information in the database"""
501
+ """Initialize the bar summary information in the database"""
502
502
s : ModelSelect = DbBarData .select (
503
503
DbBarData .symbol ,
504
504
DbBarData .exchange ,
0 commit comments