-
Notifications
You must be signed in to change notification settings - Fork 0
/
Source-Code
436 lines (359 loc) · 38.7 KB
/
Source-Code
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © zeubetella
//@version=5
indicator("Portfolio Tracking Table")
rawNumberforTable1 = 50
var string TableGroup1 = "Table Settings"
string Table1PosInYaxis = input.string("middle", "Tablo Pozisyonu", inline = "11", options = ["top", "middle", "bottom"], group = TableGroup1)
string Table1PosInXaxis = input.string("center", "", inline = "11", options = ["left", "center", "right"], group = TableGroup1)
var table table1 = table.new(Table1PosInYaxis + "_" + Table1PosInXaxis, 50, rawNumberforTable1 + 1, color.new(color.black , 40), color.new(color.white , 0), 1,color.new(color.white , 0), 1)
textstyleFORtable1 = input.string(size.large, "", options=[size.small, size.normal, size.large], group = TableGroup1)
// ╠══════════════════════════════════════════════════════════════════════════╣
group_01 = "First Asset"
group_02 = "Second Asset"
group_03 = "Third Asset"
group_04 = "Fourth Asset"
group_05 = "Fifth Asset"
group_06 = "Sixth Asset"
group_07 = "Seventh Asset"
group_08 = "Eighth Asset"
group_09 = "Ninth Asset"
group_10 = "Tenth Asset"
group_11 = "Eleventh Asset"
group_12 = "Twelfth Asset"
group_13 = "Thirteenth Asset"
group_14 = "Fourteenth Asset"
group_15 = "Fifteenth Asset"
// ╠══════════════════════════════════════════════════════════════════════════╣
symbol01 = input.symbol(title="Asset Name", defval="BIST:KCHOL", group=group_01, display = display.none)
symbol02 = input.symbol(title="Asset Name", defval="BIST:TUPRS", group=group_02, display = display.none)
symbol03 = input.symbol(title="Asset Name", defval="BIST:ALARK", group=group_03, display = display.none)
symbol04 = input.symbol(title="Asset Name", defval="BIST:GARAN", group=group_04, display = display.none)
symbol05 = input.symbol(title="Asset Name", defval="BIST:TURSG", group=group_05, display = display.none)
symbol06 = input.symbol(title="Asset Name", defval="BIST:FROTO", group=group_06, display = display.none)
symbol07 = input.symbol(title="Asset Name", defval="BIST:DOAS", group=group_07, display = display.none)
symbol08 = input.symbol(title="Asset Name", defval="BIST:DESA", group=group_08, display = display.none)
symbol09 = input.symbol(title="Asset Name", defval="BIST:VESBE", group=group_09, display = display.none)
symbol10 = input.symbol(title="Asset Name", defval="BIST:TOASO", group=group_10, display = display.none)
symbol11 = input.symbol(title="Asset Name", defval="BIST:THYAO", group=group_11, display = display.none)
symbol12 = input.symbol(title="Asset Name", defval="BIST:SISE", group=group_12, display = display.none)
symbol13 = input.symbol(title="Asset Name", defval="BIST:ENJSA", group=group_13, display = display.none)
symbol14 = input.symbol(title="Asset Name", defval="BIST:TMSN", group=group_14, display = display.none)
symbol15 = input.symbol(title="Asset Name", defval="BIST:TTRAK", group=group_15, display = display.none)
// ╠══════════════════════════════════════════════════════════════════════════╣
table.cell(table1, 0, 0, "Asset Information", text_halign = text.align_center, text_size= textstyleFORtable1 , text_color=color.white)
table.cell(table1, 1, 0, "" , text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
table.merge_cells(table_id = table1, start_column = 0, start_row = 0, end_column = 1, end_row = 0)
table.cell(table1, 2, 0, "Buy Values", text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 0, "")
table.cell(table1, 4, 0, "")
table.merge_cells(table_id = table1, start_column = 2, start_row = 0, end_column = 4, end_row = 0)
table.cell(table1, 5, 0, "Curent Values", text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 0, "")
table.merge_cells(table_id = table1, start_column = 5, start_row = 0, end_column = 6, end_row = 0)
table.cell(table1, 7, 0, "Profit", text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
table.cell(table1, 8, 0, "")
table.merge_cells(table_id = table1, start_column = 7, start_row = 0, end_column = 8, end_row = 0)
// ╠══════════════════════════════════════════════════════════════════════════╣
table.cell(table1, 0, 1, "Number" , text_halign = text.align_center, text_size= textstyleFORtable1 , text_color=color.white)
table.cell(table1, 1, 1, "Symbol" , text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 1, "Asset QTY" , text_halign = text.align_center, text_size= textstyleFORtable1 , text_color=color.white)
table.cell(table1, 3, 1, "Purchase Price" , text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 1, "Total Cost" , text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 1, "-- Price --" , text_halign = text.align_center, text_size= textstyleFORtable1 , text_color=color.white)
table.cell(table1, 6, 1, "--- Current Value ---" , text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 1, "---- Nominal ----" , text_halign = text.align_center, text_size= textstyleFORtable1 , text_color=color.white)
table.cell(table1, 8, 1, "---- Percent ----" , text_halign = text.align_center, text_size= textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ S Y M B O L S ═══════════════════════════════════════╣
table.cell(table1, 0, 2, "01", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 2, symbol01, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 3, "02", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 3, symbol02, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 4, "03", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 4, symbol03, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 5, "04", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 5, symbol04, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 6, "05", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 6, symbol05, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 7, "06", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 7, symbol06, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 8, "07", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 8, symbol07, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 9, "08", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 9, symbol08, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 10, "09", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 10, symbol09, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 11, "10", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 11, symbol10, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 12, "11", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 12, symbol11, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 13, "12", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 13, symbol12, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 14, "13", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 14, symbol13, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 15, "14", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 15, symbol14, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 0, 16, "15", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 16, symbol15, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ S Y M B O L S ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ N U M B E R O F S H A R E S ═══════════════════════════════════════╣
lot_say_01 = input(0, "QTY", group=group_01)
lot_say_02 = input(0, "QTY", group=group_02)
lot_say_03 = input(0, "QTY", group=group_03)
lot_say_04 = input(0, "QTY", group=group_04)
lot_say_05 = input(0, "QTY", group=group_05)
lot_say_06 = input(0, "QTY", group=group_06)
lot_say_07 = input(0, "QTY", group=group_07)
lot_say_08 = input(0, "QTY", group=group_08)
lot_say_09 = input(0, "QTY", group=group_09)
lot_say_10 = input(0, "QTY", group=group_10)
lot_say_11 = input(0, "QTY", group=group_11)
lot_say_12 = input(0, "QTY", group=group_12)
lot_say_13 = input(0, "QTY", group=group_13)
lot_say_14 = input(0, "QTY", group=group_14)
lot_say_15 = input(0, "QTY", group=group_15)
table.cell(table1, 2, 2, str.tostring(lot_say_01), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 3, str.tostring(lot_say_02), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 4, str.tostring(lot_say_03), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 5, str.tostring(lot_say_04), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 6, str.tostring(lot_say_05), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 7, str.tostring(lot_say_06), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 8, str.tostring(lot_say_07), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 9, str.tostring(lot_say_08), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 10, str.tostring(lot_say_09), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 11, str.tostring(lot_say_10), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 12, str.tostring(lot_say_11), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 13, str.tostring(lot_say_12), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 14, str.tostring(lot_say_13), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 15, str.tostring(lot_say_14), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 16, str.tostring(lot_say_15), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ N U M B E R O F S H A R E S ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ C O S T S ═══════════════════════════════════════╣
cost_01 = input.float(0, "Owning Cost", group=group_01)
cost_02 = input.float(0, "Owning Cost", group=group_02)
cost_03 = input.float(0, "Owning Cost", group=group_03)
cost_04 = input.float(0, "Owning Cost", group=group_04)
cost_05 = input.float(0, "Owning Cost", group=group_05)
cost_06 = input.float(0, "Owning Cost", group=group_06)
cost_07 = input.float(0, "Owning Cost", group=group_07)
cost_08 = input.float(0, "Owning Cost", group=group_08)
cost_09 = input.float(0, "Owning Cost", group=group_09)
cost_10 = input.float(0, "Owning Cost", group=group_10)
cost_11 = input.float(0, "Owning Cost", group=group_11)
cost_12 = input.float(0, "Owning Cost", group=group_12)
cost_13 = input.float(0, "Owning Cost", group=group_13)
cost_14 = input.float(0, "Owning Cost", group=group_14)
cost_15 = input.float(0, "Owning Cost", group=group_15)
table.cell(table1, 3, 2, str.tostring(cost_01), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 3, str.tostring(cost_02), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 4, str.tostring(cost_03), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 5, str.tostring(cost_04), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 6, str.tostring(cost_05), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 7, str.tostring(cost_06), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 8, str.tostring(cost_07), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 9, str.tostring(cost_08), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 10, str.tostring(cost_09), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 11, str.tostring(cost_10), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 12, str.tostring(cost_11), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 13, str.tostring(cost_12), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 14, str.tostring(cost_13), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 15, str.tostring(cost_14), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 16, str.tostring(cost_15), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ C O S T S ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ T O T A L C O S T S ═══════════════════════════════════════╣
total_cost_01 = lot_say_01 * cost_01
total_cost_02 = lot_say_02 * cost_02
total_cost_03 = lot_say_03 * cost_03
total_cost_04 = lot_say_04 * cost_04
total_cost_05 = lot_say_05 * cost_05
total_cost_06 = lot_say_06 * cost_06
total_cost_07 = lot_say_07 * cost_07
total_cost_08 = lot_say_08 * cost_08
total_cost_09 = lot_say_09 * cost_09
total_cost_10 = lot_say_10 * cost_10
total_cost_11 = lot_say_11 * cost_11
total_cost_12 = lot_say_12 * cost_12
total_cost_13 = lot_say_13 * cost_13
total_cost_14 = lot_say_14 * cost_14
total_cost_15 = lot_say_15 * cost_15
table.cell(table1, 4, 2, str.tostring(total_cost_01), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 3, str.tostring(total_cost_02), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 4, str.tostring(total_cost_03), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 5, str.tostring(total_cost_04), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 6, str.tostring(total_cost_05), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 7, str.tostring(total_cost_06), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 8, str.tostring(total_cost_07), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 9, str.tostring(total_cost_08), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 10, str.tostring(total_cost_09), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 11, str.tostring(total_cost_10), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 12, str.tostring(total_cost_11), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 13, str.tostring(total_cost_12), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 14, str.tostring(total_cost_13), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 15, str.tostring(total_cost_14), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 4, 16, str.tostring(total_cost_15), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ T O T A L C O S T S ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ C U R R E N T P R I C E ═══════════════════════════════════════╣
current_price_01 = math.round(request.security(symbol01, "1D", close), 2)
current_price_02 = math.round(request.security(symbol02, "1D", close), 2)
current_price_03 = math.round(request.security(symbol03, "1D", close), 2)
current_price_04 = math.round(request.security(symbol04, "1D", close), 2)
current_price_05 = math.round(request.security(symbol05, "1D", close), 2)
current_price_06 = math.round(request.security(symbol06, "1D", close), 2)
current_price_07 = math.round(request.security(symbol07, "1D", close), 2)
current_price_08 = math.round(request.security(symbol08, "1D", close), 2)
current_price_09 = math.round(request.security(symbol09, "1D", close), 2)
current_price_10 = math.round(request.security(symbol10, "1D", close), 2)
current_price_11 = math.round(request.security(symbol11, "1D", close), 2)
current_price_12 = math.round(request.security(symbol12, "1D", close), 2)
current_price_13 = math.round(request.security(symbol13, "1D", close), 2)
current_price_14 = math.round(request.security(symbol14, "1D", close), 2)
current_price_15 = math.round(request.security(symbol15, "1D", close), 2)
if barstate.isconfirmed
table.cell(table1, 5, 2, str.tostring(current_price_01), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 3, str.tostring(current_price_02), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 4, str.tostring(current_price_03), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 5, str.tostring(current_price_04), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 6, str.tostring(current_price_05), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 7, str.tostring(current_price_06), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 8, str.tostring(current_price_07), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 9, str.tostring(current_price_08), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 10, str.tostring(current_price_09), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 11, str.tostring(current_price_10), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 12, str.tostring(current_price_11), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 13, str.tostring(current_price_12), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 14, str.tostring(current_price_13), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 15, str.tostring(current_price_14), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 5, 16, str.tostring(current_price_15), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ C U R R E N T P R I C E ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ M A R K E T V A L U E ═══════════════════════════════════════╣
piy_dgr_01 = lot_say_01 * current_price_01
piy_dgr_02 = lot_say_02 * current_price_02
piy_dgr_03 = lot_say_03 * current_price_03
piy_dgr_04 = lot_say_04 * current_price_04
piy_dgr_05 = lot_say_05 * current_price_05
piy_dgr_06 = lot_say_06 * current_price_06
piy_dgr_07 = lot_say_07 * current_price_07
piy_dgr_08 = lot_say_08 * current_price_08
piy_dgr_09 = lot_say_09 * current_price_09
piy_dgr_10 = lot_say_10 * current_price_10
piy_dgr_11 = lot_say_11 * current_price_11
piy_dgr_12 = lot_say_12 * current_price_12
piy_dgr_13 = lot_say_13 * current_price_13
piy_dgr_14 = lot_say_14 * current_price_14
piy_dgr_15 = lot_say_15 * current_price_15
table.cell(table1, 6, 2, str.tostring(piy_dgr_01), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 3, str.tostring(piy_dgr_02), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 4, str.tostring(piy_dgr_03), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 5, str.tostring(piy_dgr_04), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 6, str.tostring(piy_dgr_05), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 7, str.tostring(piy_dgr_06), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 8, str.tostring(piy_dgr_07), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 9, str.tostring(piy_dgr_08), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 10, str.tostring(piy_dgr_09), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 11, str.tostring(piy_dgr_10), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 12, str.tostring(piy_dgr_11), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 13, str.tostring(piy_dgr_12), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 14, str.tostring(piy_dgr_13), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 15, str.tostring(piy_dgr_14), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 6, 16, str.tostring(piy_dgr_15), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ M A R K E T V A L U E ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ P R O F I T - N O M I N A L ═══════════════════════════════════════╣
nominal_profit_asset_01 = piy_dgr_01 - total_cost_01
nominal_profit_asset_02 = piy_dgr_02 - total_cost_02
nominal_profit_asset_03 = piy_dgr_03 - total_cost_03
nominal_profit_asset_04 = piy_dgr_04 - total_cost_04
nominal_profit_asset_05 = piy_dgr_05 - total_cost_05
nominal_profit_asset_06 = piy_dgr_06 - total_cost_06
nominal_profit_asset_07 = piy_dgr_07 - total_cost_07
nominal_profit_asset_08 = piy_dgr_08 - total_cost_08
nominal_profit_asset_09 = piy_dgr_09 - total_cost_09
nominal_profit_asset_10 = piy_dgr_10 - total_cost_10
nominal_profit_asset_11 = piy_dgr_11 - total_cost_11
nominal_profit_asset_12 = piy_dgr_12 - total_cost_12
nominal_profit_asset_13 = piy_dgr_13 - total_cost_13
nominal_profit_asset_14 = piy_dgr_14 - total_cost_14
nominal_profit_asset_15 = piy_dgr_15 - total_cost_15
table.cell(table1, 7, 2, str.tostring(nominal_profit_asset_01), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 3, str.tostring(nominal_profit_asset_02), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 4, str.tostring(nominal_profit_asset_03), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 5, str.tostring(nominal_profit_asset_04), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 6, str.tostring(nominal_profit_asset_05), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 7, str.tostring(nominal_profit_asset_06), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 8, str.tostring(nominal_profit_asset_07), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 9, str.tostring(nominal_profit_asset_08), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 10, str.tostring(nominal_profit_asset_09), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 11, str.tostring(nominal_profit_asset_10), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 12, str.tostring(nominal_profit_asset_11), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 13, str.tostring(nominal_profit_asset_12), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 14, str.tostring(nominal_profit_asset_13), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 15, str.tostring(nominal_profit_asset_14), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 7, 16, str.tostring(nominal_profit_asset_15), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ P R O F I T - N O M I N A L ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ P R O F I T - P E R C E N T ═══════════════════════════════════════╣
percent_profit_asset_01 = ((piy_dgr_01 - total_cost_01) / total_cost_01) * 100
percent_profit_asset_02 = ((piy_dgr_02 - total_cost_02) / total_cost_02) * 100
percent_profit_asset_03 = ((piy_dgr_03 - total_cost_03) / total_cost_03) * 100
percent_profit_asset_04 = ((piy_dgr_04 - total_cost_04) / total_cost_04) * 100
percent_profit_asset_05 = ((piy_dgr_05 - total_cost_05) / total_cost_05) * 100
percent_profit_asset_06 = ((piy_dgr_06 - total_cost_06) / total_cost_06) * 100
percent_profit_asset_07 = ((piy_dgr_07 - total_cost_07) / total_cost_07) * 100
percent_profit_asset_08 = ((piy_dgr_08 - total_cost_08) / total_cost_08) * 100
percent_profit_asset_09 = ((piy_dgr_09 - total_cost_09) / total_cost_09) * 100
percent_profit_asset_10 = ((piy_dgr_10 - total_cost_10) / total_cost_10) * 100
percent_profit_asset_11 = ((piy_dgr_11 - total_cost_11) / total_cost_11) * 100
percent_profit_asset_12 = ((piy_dgr_12 - total_cost_12) / total_cost_12) * 100
percent_profit_asset_13 = ((piy_dgr_13 - total_cost_13) / total_cost_13) * 100
percent_profit_asset_14 = ((piy_dgr_14 - total_cost_14) / total_cost_14) * 100
percent_profit_asset_15 = ((piy_dgr_15 - total_cost_15) / total_cost_15) * 100
f_renk(x) =>
r =
-50 >= x and x > -100 ? color.rgb(255,0,0) :
-25 >= x and x > -50 ? color.rgb(204, 0, 0) :
-10 >= x and x > -25 ? color.rgb(224, 102, 102) :
0 > x and x > -10 ? color.rgb(234, 153, 153) :
0 < x and x < 10 ? color.rgb(150, 172, 142) :
10 <= x and x < 25 ? color.rgb(153, 216, 126) :
25 <= x and x < 50 ? color.rgb(147, 196, 125) :
50 <= x and x < 100 ? color.rgb(106, 168, 79) :
100 <= x ? color.rgb(0, 255, 0) :
color(na)
//
table.cell(table1, 8, 2, (na(percent_profit_asset_01) ? "" : str.tostring(math.round(percent_profit_asset_01, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_01), text_color=color.white)
table.cell(table1, 8, 3, (na(percent_profit_asset_02) ? "" : str.tostring(math.round(percent_profit_asset_02, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_02), text_color=color.white)
table.cell(table1, 8, 4, (na(percent_profit_asset_03) ? "" : str.tostring(math.round(percent_profit_asset_03, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_03), text_color=color.white)
table.cell(table1, 8, 5, (na(percent_profit_asset_04) ? "" : str.tostring(math.round(percent_profit_asset_04, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_04), text_color=color.white)
table.cell(table1, 8, 6, (na(percent_profit_asset_05) ? "" : str.tostring(math.round(percent_profit_asset_05, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_05), text_color=color.white)
table.cell(table1, 8, 7, (na(percent_profit_asset_06) ? "" : str.tostring(math.round(percent_profit_asset_06, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_06), text_color=color.white)
table.cell(table1, 8, 8, (na(percent_profit_asset_07) ? "" : str.tostring(math.round(percent_profit_asset_07, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_07), text_color=color.white)
table.cell(table1, 8, 9, (na(percent_profit_asset_08) ? "" : str.tostring(math.round(percent_profit_asset_08, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_08), text_color=color.white)
table.cell(table1, 8, 10, (na(percent_profit_asset_09) ? "" : str.tostring(math.round(percent_profit_asset_09, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_09), text_color=color.white)
table.cell(table1, 8, 11, (na(percent_profit_asset_10) ? "" : str.tostring(math.round(percent_profit_asset_10, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_10), text_color=color.white)
table.cell(table1, 8, 12, (na(percent_profit_asset_11) ? "" : str.tostring(math.round(percent_profit_asset_11, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_11), text_color=color.white)
table.cell(table1, 8, 13, (na(percent_profit_asset_12) ? "" : str.tostring(math.round(percent_profit_asset_12, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_12), text_color=color.white)
table.cell(table1, 8, 14, (na(percent_profit_asset_13) ? "" : str.tostring(math.round(percent_profit_asset_13, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_13), text_color=color.white)
table.cell(table1, 8, 15, (na(percent_profit_asset_14) ? "" : str.tostring(math.round(percent_profit_asset_14, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_14), text_color=color.white)
table.cell(table1, 8, 16, (na(percent_profit_asset_15) ? "" : str.tostring(math.round(percent_profit_asset_15, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_15), text_color=color.white)
// ╠═══════════════════════════════════ P R O F I T - P E R C E N T ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ T O T A L S I D E ═══════════════════════════════════════╣
table.cell(table1, 0, 17, "T O T A L", text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 1, 17, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 2, 17, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.cell(table1, 3, 17, text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
table.merge_cells(table1, 0, 17, 3, 17)
total_cost_all_asset = total_cost_01 + total_cost_02 + total_cost_03 + total_cost_04 +
total_cost_05 + total_cost_06 + total_cost_07 + total_cost_08 + total_cost_09 +
total_cost_10 + total_cost_11 + total_cost_12 + total_cost_13 + total_cost_14 +
total_cost_15
table.cell(table1, 4, 17, str.tostring(total_cost_all_asset), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
piy_dgr_all_asset= piy_dgr_01 + piy_dgr_02 + piy_dgr_03 + piy_dgr_04 +
piy_dgr_05 + piy_dgr_06 + piy_dgr_07 + piy_dgr_08 + piy_dgr_09 +
piy_dgr_10 + piy_dgr_11 + piy_dgr_12 + piy_dgr_13 + piy_dgr_14 +
piy_dgr_15
table.cell(table1, 6, 17, str.tostring(piy_dgr_all_asset), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
// ╠═══════════════════════════════════ T O T A L S I D E ═══════════════════════════════════════╣
// ╠═══════════════════════════════════ P R O F I T ═══════════════════════════════════════╣
nominal_profit_asset_all = piy_dgr_all_asset - total_cost_all_asset
table.cell(table1, 7, 17, str.tostring(piy_dgr_all_asset), text_halign=text.align_center, text_size=textstyleFORtable1, text_color=color.white)
percent_profit_asset_all = ((piy_dgr_all_asset - total_cost_all_asset) / total_cost_all_asset) * 100
table.cell(table1, 8, 17, (na(percent_profit_asset_all) ? "" : str.tostring(math.round(percent_profit_asset_15, 2)) + "%"), text_halign=text.align_center, text_size=textstyleFORtable1, bgcolor=f_renk(percent_profit_asset_all), text_color=color.white)
// ╠═══════════════════════════════════ P R O F I T ═══════════════════════════════════════╣