You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.5 KiB
43 lines
1.5 KiB
{% extends "dashboard/base.html" %} |
|
{% load bootstrap3 %} |
|
{% load mathfilters %} |
|
|
|
{% block content %} |
|
<div class="panel panel-default panel-collapse collapse" id="new_trade_form"> |
|
<div class="panel-body col-xs-4"> |
|
<form action="{% url 'add_trade' %}" method="POST"> |
|
{% csrf_token %} |
|
{% bootstrap_form new_trade_form %} |
|
{% bootstrap_button button_type='submit' content='Submit' %} |
|
</form> |
|
</div> |
|
</div> |
|
<table class="table table-condensed"> |
|
<tr> |
|
<td>Time</td> |
|
<td>Account</td> |
|
<td>Security</td> |
|
<td>Operation</td> |
|
<td>Price</td> |
|
<td>Quantity</td> |
|
<td>Volume</td> |
|
<td>Strategy ID</td> |
|
<td>Signal ID</td> |
|
<td> <a href="#new_trade_form" role="button" data-toggle="collapse">New trade...</a> </td> |
|
</tr> |
|
{% for trade in trades %} |
|
<tr> |
|
<td>{{ trade.timestamp }}</td> |
|
<td>{{ trade.account }}</td> |
|
<td>{{ trade.security }}</td> |
|
<td>{% if trade.quantity > 0 %} Buy {% else %} Sell {% endif %}</td> |
|
<td>{{ trade.price }}</td> |
|
<td>{{ trade.quantity|abs }}</td> |
|
<td>{{ trade.volume|stringformat:".3f"}} {{ trade.volumeCurrency }}</td> |
|
<td>{{ trade.strategyId }}</td> |
|
<td>{{ trade.signalId }}</td> |
|
<td><button type="button" class="btn btn-danger" onclick="if(window.confirm('Confirm deletion')) { document.location.href = '{% url 'delete_trade' trade_id=trade.pk %}'}; return false;">Delete</button></td> |
|
</tr> |
|
{% endfor %} |
|
</table> |
|
{% endblock %}
|
|
|