Skip to content

Commit 09dedf0

Browse files
committed
Reset orders on chart after multiple strat runs
1 parent ff675e3 commit 09dedf0

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

finplotWindow.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def drawOrders(self, orders = None):
148148
elif order.executed.pnl < 0:
149149
color = "#FF3030"
150150

151-
fplt.add_line(posOpen, posClose, color, 2, style="--" )
151+
fplt.add_line(posOpen, posClose, color, 2, ax=self.ax0, style="--" )
152152

153153
pass
154154

@@ -300,6 +300,13 @@ def setChartData(self, data):
300300
self.data = data
301301
pass
302302

303+
def resetChart(self):
304+
305+
# Remove all previous orders arrows and informations
306+
self.orders = []
307+
308+
pass
309+
303310
def updateChart(self):
304311

305312
# Entirely reset graph

userInterface.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def initialize(self):
392392

393393
# Enable run button
394394
self.strategyTesterUI.runBacktestPB.setEnabled(False)
395-
395+
396396
self.strategyTesterUI.initialize()
397397

398398
pass
@@ -517,10 +517,8 @@ def dark_mode_toggle(self):
517517
# INDICATORS
518518
##########
519519
def resetChart(self):
520+
self.fpltWindow.resetChart()
520521
self.fpltWindow.updateChart()
521-
#self.fpltWindow.resetPlots()
522-
#self.fpltWindow.drawCandles()
523-
#self.fpltWindow.refreshChart()
524522
pass
525523

526524
def addIchimoku(self):

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