{% macro order_tr(order, type='', timestamp='', sim_or_real='Simulated') -%}
    <tr>
        <th scope="row">{{ order.get_id() }}</th>
        <td>{{ order.get_exchange().get_name() }}</td>
        <td>{{ order.get_order_symbol() }}</td>
        <td>{{ type }}</td>
        <td>{{ order.get_origin_price() }}</td>
        <td>{{ order.get_origin_quantity() }}</td>
        <td>{{ sim_or_real }}</td>
        <td>{{ timestamp }}</td>
    </tr>
{%- endmacro %}

{% macro trades_tr(trade, type='', timestamp='', sim_or_real='Simulated') -%}
    <tr>
        <th scope="row">{{ trade.order_id }}</th>
        <td>{{ trade.exchange.get_name() }}</td>
        <td>{{ trade.symbol }}</td>
        <td>{{ type }}</td>
        <td>{{ trade.price }}</td>
        <td>{{ trade.quantity }}</td>
        <td>{{ sim_or_real }}</td>
        <td>{{ timestamp }}</td>
    </tr>
{%- endmacro %}

{% macro logs_tr(log) -%}
    <tr
    {% if "ERROR" in log["Level"] %}
        class="bg-danger"
    {% endif %}
    {% if "WARNING" in log["Level"] %}
        class="bg-warning"
    {% endif %}
    >
        <th scope="row">{{ log["Time"] }}</th>
        <td>{{ log["Level"] }}</td>
        <td>{{ log["Source"] }}</td>
        <td>{{ log["Message"] }}</td>
    </tr>
{%- endmacro %}