zarovnani baru u not div60 resolutions, +ind na FE

This commit is contained in:
David Brazda
2023-09-13 18:03:53 +02:00
parent e8f5805faf
commit cd51cfbccd
10 changed files with 62 additions and 10 deletions
+3 -3
View File
@@ -271,8 +271,10 @@ class TradeAggregator:
self.newBar['open'] = data['p']
#UPRAVENO - pouze pro prvni bar a ROUND, jinak bereme cas baru podle noveho tradu
#TODO: do budoucna vymyslet, kdyz bude mene tradu, tak to radit vzdy do spravneho intervalu
#zarovname time prvniho baru podle timeframu kam patří (např. 5, 10, 15 ...) (ROUND)
if self.align:
if self.align == StartBarAlign.ROUND and self.bar_start == 0:
t = datetime.fromtimestamp(data['t'])
t = t - timedelta(seconds=t.second % self.timeframe,microseconds=t.microsecond)
self.bar_start = datetime.timestamp(t)
@@ -282,9 +284,7 @@ class TradeAggregator:
t = datetime.fromtimestamp(int(data['t']))
#timestamp
self.bar_start = int(data['t'])
self.newBar['time'] = t
self.newBar['resolution'] = self.timeframe
+1 -1
View File
@@ -196,7 +196,7 @@ class Trade_Offline_Streamer(Thread):
#homogenizace timestampu s online streamem
t['t'] = Timestamp.from_unix(to_datetime(t['t']).timestamp())
print("PROGRESS ",cnt,"/",celkem)
#print("PROGRESS ",cnt,"/",celkem)
#print(t)
#na rozdil od wwebsocketu zde nemame v zaznamu symbol ['S']
#vsem streamum na tomto symbolu posilame data - tbd mozna udelat i per stream vlakno