Skip to content

Commit 041805a

Browse files
committed
clean up strategy parameter
1 parent 1c6fd18 commit 041805a

File tree

5 files changed

+63
-40
lines changed

5 files changed

+63
-40
lines changed

Controller.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def __init__(self):
8383

8484
# Once everything is created, initialize data
8585
self.interface.initialize()
86+
87+
8688
pass
8789

8890

@@ -100,6 +102,10 @@ def loadData(self, dataPath):
100102

101103
# Draw charts based on input data
102104
self.interface.drawChart(self.dataframe)
105+
106+
# Enable run button
107+
self.interface.strategyTesterUI.runBacktestPB.setEnabled(True)
108+
103109
pass
104110

105111

File renamed without changes.

strategyTesterUI.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def __init__(self, controller):
2222
self.strategyNameCB = self.findChild(QtWidgets.QComboBox, "strategyNameCB")
2323
self.strategyNameCB.currentIndexChanged.connect(self.strategyNameActivated)
2424

25+
self.runBacktestPB.setEnabled(False)
26+
2527
def initialize(self):
2628

2729
# adding list of items to combo box

ui/strategyTester.ui

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>234</width>
9+
<width>238</width>
1010
<height>699</height>
1111
</rect>
1212
</property>
@@ -20,6 +20,22 @@
2020
<string>Back testing</string>
2121
</property>
2222
<layout class="QGridLayout" name="gridLayout">
23+
<item row="4" column="0" colspan="2">
24+
<widget class="QComboBox" name="strategyNameCB">
25+
<property name="sizePolicy">
26+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
27+
<horstretch>0</horstretch>
28+
<verstretch>0</verstretch>
29+
</sizepolicy>
30+
</property>
31+
<property name="minimumSize">
32+
<size>
33+
<width>200</width>
34+
<height>0</height>
35+
</size>
36+
</property>
37+
</widget>
38+
</item>
2339
<item row="7" column="0">
2440
<widget class="QScrollArea" name="scrollArea">
2541
<property name="widgetResizable">
@@ -30,8 +46,8 @@
3046
<rect>
3147
<x>0</x>
3248
<y>0</y>
33-
<width>188</width>
34-
<height>219</height>
49+
<width>192</width>
50+
<height>210</height>
3551
</rect>
3652
</property>
3753
<layout class="QVBoxLayout" name="verticalLayout">
@@ -42,6 +58,13 @@
4258
</widget>
4359
</widget>
4460
</item>
61+
<item row="3" column="0">
62+
<widget class="QLabel" name="label_4">
63+
<property name="text">
64+
<string>Strategy</string>
65+
</property>
66+
</widget>
67+
</item>
4568
<item row="5" column="0">
4669
<spacer name="verticalSpacer_2">
4770
<property name="orientation">
@@ -74,31 +97,11 @@
7497
</property>
7598
</spacer>
7699
</item>
77-
<item row="3" column="0">
78-
<widget class="QLabel" name="label_4">
79-
<property name="text">
80-
<string>Strategy</string>
81-
</property>
82-
</widget>
83-
</item>
84-
<item row="4" column="0" colspan="2">
85-
<widget class="QComboBox" name="strategyNameCB">
86-
<property name="sizePolicy">
87-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
88-
<horstretch>0</horstretch>
89-
<verstretch>0</verstretch>
90-
</sizepolicy>
91-
</property>
92-
<property name="minimumSize">
93-
<size>
94-
<width>200</width>
95-
<height>0</height>
96-
</size>
97-
</property>
98-
</widget>
99-
</item>
100100
<item row="9" column="0" colspan="2">
101101
<widget class="QPushButton" name="runBacktestPB">
102+
<property name="enabled">
103+
<bool>true</bool>
104+
</property>
102105
<property name="sizePolicy">
103106
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
104107
<horstretch>0</horstretch>
@@ -124,6 +127,22 @@
124127
</property>
125128
</widget>
126129
</item>
130+
<item row="2" column="0">
131+
<spacer name="verticalSpacer_3">
132+
<property name="orientation">
133+
<enum>Qt::Vertical</enum>
134+
</property>
135+
<property name="sizeType">
136+
<enum>QSizePolicy::Maximum</enum>
137+
</property>
138+
<property name="sizeHint" stdset="0">
139+
<size>
140+
<width>20</width>
141+
<height>20</height>
142+
</size>
143+
</property>
144+
</spacer>
145+
</item>
127146
<item row="0" column="0" colspan="2">
128147
<layout class="QGridLayout" name="gridLayout_3">
129148
<property name="spacing">
@@ -145,21 +164,12 @@
145164
</item>
146165
</layout>
147166
</item>
148-
<item row="2" column="0">
149-
<spacer name="verticalSpacer_3">
150-
<property name="orientation">
151-
<enum>Qt::Vertical</enum>
152-
</property>
153-
<property name="sizeType">
154-
<enum>QSizePolicy::Maximum</enum>
155-
</property>
156-
<property name="sizeHint" stdset="0">
157-
<size>
158-
<width>20</width>
159-
<height>20</height>
160-
</size>
167+
<item row="13" column="0">
168+
<widget class="QLabel" name="runLabel">
169+
<property name="text">
170+
<string/>
161171
</property>
162-
</spacer>
172+
</widget>
163173
</item>
164174
</layout>
165175
</widget>

userInterface.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ def __init__(self,controller):
6969
self.createDocks()
7070
self.createUIs()
7171

72+
# Enable run button
73+
self.strategyTesterUI.runBacktestPB.setEnabled(False)
74+
75+
pass
76+
7277
#########
7378
# Create all main window docks
7479
#########

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