-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathbacktest_table.html.twig
79 lines (69 loc) · 3.46 KB
/
backtest_table.html.twig
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
<table class="table table-bordered table-sm table-hover backtest-table">
<thead>
<tr>
<th scope="col">Time</th>
<th scope="col">Price</th>
<th scope="col">Profit</th>
<th scope="col" class="col-rotate text-xs text-center"><span>Signal</span></th>
{% for key, fields in extra_fields %}
<th scope="col" class="col-rotate text-muted text-xs text-center"><span>{{ fields.label|default(key) }}</span></th>
{% endfor %}
<th scope="col" class="col-rotate d text-xs"><span><a href="#" class="button-debug-toggle-all">Debug</a></span></th>
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
<td class="no-wrap">{{ row.time|date('y-m-d H:i:s') }}</td>
<td class="no-wrap">{{ row.price|default }}</td>
<td class="no-wrap">
{% if row.profit is defined %}
<span class="{{ row.profit > 0 ? 'text-success' : 'text-danger' }} {{ row.result._signal|default == 'close' ? ' font-weight-bold' : '' }}">{{ row.profit|round(2) }} %</span>
{% endif %}
{% if row.lastPriceClosed is defined %}
<span style="opacity: 0.4;" class="{{ row.lastPriceClosed > 0 ? 'text-success' : 'text-danger' }}">{{ row.lastPriceClosed|round(2) }} %</span>
{% endif %}
</td>
<td>
{% if row.result is defined %}
{% if row.result._signal == 'long' %}
<i class="fas fa-chevron-circle-up text-success"></i>
{% elseif row.result._signal == 'short' %}
<i class="fas fa-chevron-circle-down text-danger"></i>
{% elseif row.result._signal == 'close' %}
<i class="fa fa-times"></i>
{% endif %}
{% endif %}
</td>
{% for column in row.columns|default([]) %}
{% if column.type == 'cross' or column.type == 'histogram' %}
{% set color = '' %}
{% if column.state == 'over' %}
{% set color = 'text-success' %}
{% elseif column.state == 'below' %}
{% set color = 'text-danger' %}
{% endif %}
<td class="{{ color|default }}">{{ column.value }}</td>
{% elseif column.type == 'oscillator' %}
{% set color = '' %}
{% if column.state == 'over' %}
{% set color = 'text-danger' %}
{% elseif column.state == 'below' %}
{% set color = 'text-success' %}
{% endif %}
<td class="{{ color|default }}">{{ column.value }}</td>
{% elseif column.type == 'icon' %}
<td class="text-{{ column.value }}">{% if column.value is defined %}<i class="fas fa-circle"></i>{% endif %}</td>
{% else %}
<td>{{ column.value }}</td>
{% endif %}
{% endfor %}
<td style="word-break: break-all;">
<span class="debug-toggle hide">
<a href="#" class="button-debug-toggle"><i class="fa fa-eye"></i></a><span class="debug-text text-muted">{{ row|json_encode }}</span>
</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>