Skip to content

Commit 0255fa2

Browse files
committed
New ui for adding data file (for Multi timeframes)
1 parent 8b1fc84 commit 0255fa2

File tree

3 files changed

+154
-90
lines changed

3 files changed

+154
-90
lines changed

finplotWindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ def drawPnL(self, pln_data):
393393

394394
self.axPnL.reset()
395395

396-
fplt.plot(pln_data['time'], pln_data['value'], ax = self.axPnL, legend="value")
397396
fplt.plot(pln_data['time'], pln_data['equity'], ax = self.axPnL, legend="equity")
397+
fplt.plot(pln_data['time'], pln_data['value'], ax = self.axPnL, legend="value")
398398

399399
self.axPnL.ax_widget.show()
400400
self.axPnL.show()

ui/strategyTester.ui

Lines changed: 151 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -20,86 +20,24 @@
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>
39-
<item row="7" column="0">
40-
<widget class="QScrollArea" name="parametersScrollArea">
23+
<item row="2" column="0">
24+
<widget class="QListWidget" name="dataFilesListWidget">
4125
<property name="sizePolicy">
42-
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
26+
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
4327
<horstretch>0</horstretch>
4428
<verstretch>0</verstretch>
4529
</sizepolicy>
4630
</property>
47-
<property name="minimumSize">
48-
<size>
49-
<width>0</width>
50-
<height>50</height>
51-
</size>
52-
</property>
53-
<property name="maximumSize">
54-
<size>
55-
<width>16777215</width>
56-
<height>250</height>
57-
</size>
58-
</property>
59-
<property name="widgetResizable">
60-
<bool>true</bool>
61-
</property>
62-
<widget class="QWidget" name="scrollAreaWidgetContents">
63-
<property name="geometry">
64-
<rect>
65-
<x>0</x>
66-
<y>0</y>
67-
<width>192</width>
68-
<height>69</height>
69-
</rect>
70-
</property>
71-
<layout class="QVBoxLayout" name="verticalLayout">
72-
<item>
73-
<layout class="QFormLayout" name="parametersLayout"/>
74-
</item>
75-
</layout>
76-
</widget>
7731
</widget>
7832
</item>
79-
<item row="3" column="0">
80-
<widget class="QLabel" name="label_4">
33+
<item row="13" column="0">
34+
<widget class="QLabel" name="runLabel">
8135
<property name="text">
82-
<string>Strategy</string>
36+
<string/>
8337
</property>
8438
</widget>
8539
</item>
86-
<item row="5" column="0">
87-
<spacer name="verticalSpacer_2">
88-
<property name="orientation">
89-
<enum>Qt::Vertical</enum>
90-
</property>
91-
<property name="sizeType">
92-
<enum>QSizePolicy::Preferred</enum>
93-
</property>
94-
<property name="sizeHint" stdset="0">
95-
<size>
96-
<width>20</width>
97-
<height>20</height>
98-
</size>
99-
</property>
100-
</spacer>
101-
</item>
102-
<item row="8" column="0">
40+
<item row="4" column="0">
10341
<spacer name="verticalSpacer">
10442
<property name="orientation">
10543
<enum>Qt::Vertical</enum>
@@ -115,43 +53,43 @@
11553
</property>
11654
</spacer>
11755
</item>
118-
<item row="9" column="0" colspan="2">
119-
<widget class="QPushButton" name="runBacktestPB">
120-
<property name="enabled">
121-
<bool>true</bool>
122-
</property>
56+
<item row="6" column="0">
57+
<widget class="QComboBox" name="strategyNameCB">
12358
<property name="sizePolicy">
124-
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
59+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
12560
<horstretch>0</horstretch>
12661
<verstretch>0</verstretch>
12762
</sizepolicy>
12863
</property>
129-
<property name="text">
130-
<string>Run</string>
64+
<property name="minimumSize">
65+
<size>
66+
<width>200</width>
67+
<height>0</height>
68+
</size>
13169
</property>
13270
</widget>
13371
</item>
134-
<item row="6" column="0" colspan="2">
135-
<widget class="QLabel" name="label_3">
72+
<item row="5" column="0">
73+
<widget class="QLabel" name="label_4">
13674
<property name="text">
137-
<string>Parameters</string>
75+
<string>Strategy</string>
13876
</property>
13977
</widget>
14078
</item>
141-
<item row="12" column="0" colspan="2">
79+
<item row="12" column="0">
14280
<widget class="QProgressBar" name="runningStratPB">
14381
<property name="value">
14482
<number>0</number>
14583
</property>
14684
</widget>
14785
</item>
148-
<item row="2" column="0">
149-
<spacer name="verticalSpacer_3">
86+
<item row="7" column="0">
87+
<spacer name="verticalSpacer_2">
15088
<property name="orientation">
15189
<enum>Qt::Vertical</enum>
15290
</property>
15391
<property name="sizeType">
154-
<enum>QSizePolicy::Maximum</enum>
92+
<enum>QSizePolicy::Preferred</enum>
15593
</property>
15694
<property name="sizeHint" stdset="0">
15795
<size>
@@ -161,7 +99,61 @@
16199
</property>
162100
</spacer>
163101
</item>
164-
<item row="0" column="0" colspan="2">
102+
<item row="0" column="0">
103+
<widget class="QLabel" name="label_2">
104+
<property name="text">
105+
<string>Data sources</string>
106+
</property>
107+
</widget>
108+
</item>
109+
<item row="8" column="0">
110+
<widget class="QLabel" name="label_3">
111+
<property name="text">
112+
<string>Parameters</string>
113+
</property>
114+
</widget>
115+
</item>
116+
<item row="10" column="0">
117+
<widget class="QScrollArea" name="parametersScrollArea">
118+
<property name="sizePolicy">
119+
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
120+
<horstretch>0</horstretch>
121+
<verstretch>0</verstretch>
122+
</sizepolicy>
123+
</property>
124+
<property name="minimumSize">
125+
<size>
126+
<width>0</width>
127+
<height>50</height>
128+
</size>
129+
</property>
130+
<property name="maximumSize">
131+
<size>
132+
<width>16777215</width>
133+
<height>250</height>
134+
</size>
135+
</property>
136+
<property name="widgetResizable">
137+
<bool>true</bool>
138+
</property>
139+
<widget class="QWidget" name="scrollAreaWidgetContents">
140+
<property name="geometry">
141+
<rect>
142+
<x>0</x>
143+
<y>0</y>
144+
<width>198</width>
145+
<height>69</height>
146+
</rect>
147+
</property>
148+
<layout class="QVBoxLayout" name="verticalLayout">
149+
<item>
150+
<layout class="QFormLayout" name="parametersLayout"/>
151+
</item>
152+
</layout>
153+
</widget>
154+
</widget>
155+
</item>
156+
<item row="9" column="0">
165157
<layout class="QGridLayout" name="gridLayout_3">
166158
<property name="spacing">
167159
<number>9</number>
@@ -182,13 +174,84 @@
182174
</item>
183175
</layout>
184176
</item>
185-
<item row="13" column="0">
186-
<widget class="QLabel" name="runLabel">
177+
<item row="11" column="0">
178+
<widget class="QPushButton" name="runBacktestPB">
179+
<property name="enabled">
180+
<bool>true</bool>
181+
</property>
182+
<property name="sizePolicy">
183+
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
184+
<horstretch>0</horstretch>
185+
<verstretch>0</verstretch>
186+
</sizepolicy>
187+
</property>
188+
<property name="minimumSize">
189+
<size>
190+
<width>0</width>
191+
<height>50</height>
192+
</size>
193+
</property>
187194
<property name="text">
188-
<string/>
195+
<string>Run</string>
189196
</property>
190197
</widget>
191198
</item>
199+
<item row="1" column="0">
200+
<layout class="QHBoxLayout" name="horizontalLayout">
201+
<item>
202+
<widget class="QPushButton" name="addLocalDataFilePB">
203+
<property name="text">
204+
<string>Add Data</string>
205+
</property>
206+
</widget>
207+
</item>
208+
<item>
209+
<widget class="QPushButton" name="pushButton">
210+
<property name="maximumSize">
211+
<size>
212+
<width>24</width>
213+
<height>16777215</height>
214+
</size>
215+
</property>
216+
<property name="text">
217+
<string>U</string>
218+
</property>
219+
</widget>
220+
</item>
221+
<item>
222+
<widget class="QPushButton" name="pushButton_2">
223+
<property name="sizePolicy">
224+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
225+
<horstretch>0</horstretch>
226+
<verstretch>0</verstretch>
227+
</sizepolicy>
228+
</property>
229+
<property name="maximumSize">
230+
<size>
231+
<width>24</width>
232+
<height>16777215</height>
233+
</size>
234+
</property>
235+
<property name="text">
236+
<string>D</string>
237+
</property>
238+
</widget>
239+
</item>
240+
<item>
241+
<widget class="QPushButton" name="pushButton_3">
242+
<property name="maximumSize">
243+
<size>
244+
<width>24</width>
245+
<height>16777215</height>
246+
</size>
247+
</property>
248+
<property name="text">
249+
<string>X</string>
250+
</property>
251+
</widget>
252+
</item>
253+
</layout>
254+
</item>
192255
</layout>
193256
</widget>
194257
</item>

userInterface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ def createStrategyTesterUI(self):
328328

329329
self.strategyTesterUI.startingCashLE.textChanged.connect( self.controller.cashChanged )
330330

331-
# self.interface.tradesSizeLE.setValue(self.cerebro.broker.cash)
331+
# Add Data
332+
self.strategyTesterUI.addLocalDataFilePB.clicked.connect( self.openDataFile )
332333

333334
pass
334335

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