-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathog (1).kv
252 lines (205 loc) · 6.95 KB
/
og (1).kv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
WindowManager:
LoginPage:
MainWindow:
id: main_w
SecondWindow:
<LoginPage>
name: 'login'
Widget:
canvas:
Rectangle:
source: '1.jpg'
pos: self.pos
size: self.size
Label:
center_x: (root.width/2)
top: (root.top/2) + 230
text: "LOGIN"
color: [1,1,1,0.8]
font_size: 37
TextInput:
id : login_id
multiline : False
center_x: (root.width/2)
top: (root.top/2)+ 100
size_hint: None,None
hint_text: "username"
foreground_color : [1,1,1,1]
background_color: [0.0,0.0,0.0,0.4]
size: 250, 35
max_lines: 1
valign: 'middle'
halign: 'center'
font_size: 15
multiline: False
TextInput :
id : pass_id
multiline : False
center_x: (root.width/2)
top: (root.top/2) + 50
foreground_color : [1,1,1,1]
size_hint: None, None
hint_text: "password"
background_color: [0.0,0.0,0.0,0.4]
size: 250, 35
max_lines: 1
valign: 'middle'
halign: 'center'
font_size: 15
multiline: False
password: True
Button:
text : "Submit"
size: 90,35
center_x: (root.width/2)
top: (root.top/2)
font_size: 18
background_color: (1,1,1,0.1)
on_press:
root.verify_credentials()
login_id.text = ""
pass_id.text = ""
<MainWindow>
press_read : 'press_read'
name : 'main'
Widget:
canvas:
Rectangle:
source: '1.jpg'
pos: self.pos
size: self.size
Label:
center_x: (root.width/2)
top: (root.top/2) + 250
text: "INTRADAY"
color: [1,1,1,0.8]
font_size: 37
TextInput:
id : balance_user
multiline : False
center_x: (root.width/2)
top: (root.top/2)+ 150
foreground_color : [1,1,1,1]
size_hint: None,None
hint_text: "Enter Balance"
background_color: [0.0,0.0,0.0,0.4]
size: 250, 35
max_lines: 1
valign: 'middle'
halign: 'center'
font_size: 15
multiline: False
TextInput:
id : high_id
multiline : False
center_x: (root.width/2)
top: (root.top/2)+ 100
size_hint: None,None
foreground_color : [1,1,1,1]
hint_text: "Enter High"
background_color: [0.0,0.0,0.0,0.4]
size: 250, 35
max_lines: 1
valign: 'middle'
halign: 'center'
font_size: 15
multiline: False
TextInput :
id : low_id
multiline : False
center_x: (root.width/2)
top: (root.top/2) + 50
size_hint: None, None
hint_text: "Enter Low"
foreground_color : [1,1,1,1]
background_color: [0.0,0.0,0.0,0.4]
size: 250, 35
max_lines: 1
valign: 'middle'
halign: 'center'
font_size: 15
multiline: False
TextInput :
id : script_id
multiline : False
center_x: (root.width/2)
top: (root.top/2) + 0
size_hint: None, None
hint_text: "Enter Script Ticker"
background_color: [0.0,0.0,0.0,0.4]
size: 250, 35
foreground_color : [1,1,1,1]
max_lines: 1
valign: 'middle'
halign: 'center'
font_size: 15
multiline: False
Button:
size: 90,35
center_x: (root.width/2)
top: (root.top/2) - 50
font_size: 18
background_color: (1,1,1,0.1)
text : "Submit"
on_press :
balance = float(balance_user.text)
high = float(high_id.text)
script = str(script_id.text)
buy_price = float(high + 0.05)
low = float(low_id.text)
sell_price = float(low - 0.05)
low_s = str(int(low))
target = balance * 0.05
if len(low_s) == 2 : target_points = '0.' + low_s[0]
elif len(low_s) == 3: target_points = low_s[0]
elif len(low_s) == 4: target_points = low_s[0] + '0'
elif len(low_s) == 5: target_points = low_s[0] + low_s[1] + '0'
quantity = int(target / float(target_points))
root.manager.get_screen('result').final_label.text ='\nQuantity : ' + str(quantity) + '\nBuy Trigger : ' + str(high) + '\nBuy Price : ' + str(buy_price) + '\nSell Trigger : ' + str(low) + '\nSell Price : ' + str(sell_price)
app.root.transition.direction = "left"
app.root.current = "result"
Button :
size: 90,35
center_x: (root.width/2)
top: (root.top/2) - 100
font_size: 18
background_color: (1,1,1,0.1)
text : "Back"
on_press :
app.root.transition.direction = "right"
app.root.current = "login"
<SecondWindow>:
name : "result"
final_label : final_label
Widget:
canvas:
Rectangle:
source: '1.jpg'
pos: self.pos
size: self.size
Label:
id : final_label
center_x: (root.width/2)
top: (root.top/2) + 200
text: "INTRADAY RESULTS"
color: [1,1,1,0.8]
font_size: 25
Button :
size: 90,35
center_x: (root.width/2)
top: (root.top/2)
font_size: 18
background_color: (1,1,1,0.1)
text : "Notify my order"
on_press :
root.run()
Button :
size: 90,35
center_x: (root.width/2)
top: (root.top/2) - 50
font_size: 18
background_color: (1,1,1,0.1)
text : "Back"
on_press :
app.root.current = "main"
app.root.transition.direction = "right"