Skip to content

Commit 863b18a

Browse files
author
michael xu
committed
update to pyqt6
2 parents 530f189 + 919b5ac commit 863b18a

File tree

13 files changed

+40
-50
lines changed

13 files changed

+40
-50
lines changed

.qt_for_python/uic/indicatorParameters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
# Form implementation generated from reading ui file 'c:\perso\trading\anaconda3\backtrader-ichimoku\ui\indicatorParameters.ui'
44
#
5-
# Created by: PyQt5 UI code generator 5.15.5
5+
# Created by: PyQt6 UI code generator 5.15.5
66
#
77
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
88
# run again. Do not edit this file unless you know what you are doing.
99

1010

11-
from PyQt5 import QtCore, QtGui, QtWidgets
11+
from PyQt6 import QtCore, QtGui, QtWidgets
1212

1313

1414
class Ui_Dialog(object):

.qt_for_python/uic/loadDataFiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# run again. Do not edit this file unless you know what you are doing.
99

1010

11-
from PyQt5 import QtCore, QtGui, QtWidgets
11+
from PyQt6 import QtCore, QtGui, QtWidgets
1212

1313

1414
class Ui_Form(object):

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ pip install git+https://github.com/backtrader2/backtrader matplotlib requests \
2020

2121
# How to use it ?
2222

23-
* Put your CSV Data in the *data* folder
24-
* Create your strategy and put it in the *strategies* folder
25-
Your strategy *file* name should be exactly the same as the strategy *class* name
23+
* Put your CSV Data in the *data* folder
24+
* Create your strategy and put it in the *strategies* folder
25+
Your strategy *file* name should be exactly the same as the strategy *class* name
2626
You can take a look at the provided exemples
2727

2828

SkinokBacktraderUI.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717
#
1818
###############################################################################
1919

20-
import pandas
21-
2220
#import sys
2321
#sys.path.append('D:/perso/trading/anaconda3/backtrader2')
2422
import backtrader as bt
2523
from CerebroEnhanced import *
2624

2725
import sys, os
28-
from backtrader.order import BuyOrder, SellOrder
2926
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/observers')
3027
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/strategies')
3128
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../finplot')
@@ -69,7 +66,6 @@ def __init__(self):
6966

7067
pass
7168

72-
7369
def resetCerebro(self):
7470

7571
# create a "Cerebro" engine instance
@@ -101,7 +97,6 @@ def resetCerebro(self):
10197

10298
pass
10399

104-
105100
# Return True if loading is successfull & the error string if False
106101
def loadData(self, dataPath, datetimeFormat, separator):
107102

@@ -277,7 +272,6 @@ def run(self):
277272

278273
pass
279274

280-
281275
def displayStrategyResults(self):
282276
# Stats on trades
283277
#portfolio_stats = self.strat_results.analyzers.getbyname('PyFolio')

finplotWindow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,10 @@ def zoomTo(self, dateStr1, dateStr2):
411411

412412
for win in fplt.windows:
413413
for ax in win.axs:
414-
x1 = self._date_str2x(ax, dateStr1)
415-
x2 = self._date_str2x(ax, dateStr2)
414+
# x1 = self._date_str2x(ax, dateStr1)
415+
# x2 = self._date_str2x(ax, dateStr2)
416+
x1 = fplt._dateStr2x(ax, dateStr1)
417+
x2 = fplt._dateStr2x(ax, dateStr2)
416418

417419
# Do not zoom exactly on the trade, so take a little bit before & after
418420
date1 = x1[0]

indicatorParametersUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from PyQt5 import QtCore, QtWidgets, QtGui, uic
1+
from PyQt6 import QtCore, QtWidgets, QtGui, uic
22

33
import os
44

loadDataFilesUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from PyQt5 import QtCore, QtWidgets, uic
1+
from PyQt6 import QtCore, QtWidgets, uic
22
import pandas as pd
33
import os
44

main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@
1818
###############################################################################
1919

2020
from SkinokBacktraderUI import SkinokBacktraderUI
21-
2221
skinokTrader = SkinokBacktraderUI()
23-
skinokTrader.displayUI()
22+
skinokTrader.displayUI()

qt.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Platforms]
2+
WindowsArguments = dpiawareness=2

strategies/sma_crossover.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ class sma_crossover(mt.MetaStrategy):
5353

5454
params = (
5555
# period for the fast Moving Average
56-
('fast', 15),
56+
('fast', 5),
5757
# period for the slow moving average
5858
('slow', 30),
5959
# Trade size
60-
('tradeSize', 2000)
60+
('tradeSize', 500)
6161
)
6262

6363
def __init__(self, *argv):

0 commit comments

Comments
 (0)