Skip to content

Commit cf7cf57

Browse files
committed
Orders and Profit chart is now well displayed in multi-timeframes
1 parent 69fd088 commit cf7cf57

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def displayStrategyResults(self):
289289
pnl_data['time'] = list(self.dataframes.values())[0].index
290290

291291
# draw charts
292-
df = pd.DataFrame(pnl_data)
292+
df = pd.DataFrame(pnl_data)
293293
self.interface.displayPnL( df )
294294

295295
pass

indicatorParametersUI.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ def __init__(self, parent = None):
2929
py = parent.y()
3030

3131
myH = self.height()
32+
mySzH=self.sizeHint().height()
3233

33-
self.move( parent.sizeHint().width() - (self.width() / 2), (parent.sizeHint().height() / 2) - (self.height() / 2))
34+
self.move( parent.sizeHint().width() - (self.sizeHint().width() / 2), (parent.sizeHint().height() / 2) - (self.sizeHint().height() / 2))
3435

3536
self.layout().setSizeConstraint( QtWidgets.QLayout.SetFixedSize )
3637

userInterface.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self,controller):
7575

7676
# Resize windows properties
7777
self.win.resize(1600,1100)
78-
self.win.setWindowTitle("Skinok Backtrader UI")
78+
self.win.setWindowTitle("Skinok Backtrader UI v0.3")
7979

8080
# Set width/height of QSplitter
8181
self.app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
@@ -477,20 +477,21 @@ def drawChart(self, data, timeframe):
477477
#########
478478
# Draw orders on chart
479479
#########
480-
def setOrders(self, orders, timeframe):
481-
#self.fillOrdersUI(self.myOrders)
482-
self.fpltWindow[timeframe].drawOrders(orders)
480+
def setOrders(self, orders):
481+
for timeframe,fpltWindow in self.fpltWindow.items():
482+
fpltWindow.drawOrders(orders)
483483
pass
484484

485485
#########
486486
# Draw PnL chart
487487
# A python expert could do waaaaay better optimized on this function
488488
# But anyway... it works...
489489
#########
490-
def displayPnL(self, pnl_dataframe, timeframe):
490+
def displayPnL(self, pnl_dataframe):
491491

492492
# draw charts
493-
self.fpltWindow[timeframe].drawPnL(pnl_dataframe)
493+
for timeframe, fpltwindow in self.fpltWindow.items():
494+
fpltwindow.drawPnL(pnl_dataframe)
494495
pass
495496

496497
#########

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy