{% extends 'layouts/base.html' %} {% block content %}

Profit / Loss Calculator

{% if session.user.role == 'super_admin' %} Manage Scrips {% endif %}
{% for i in range(rows) %} {% endfor %}
ScripPositionBuy PriceSell PriceQuantity (lots)
Clear

Profit = (sell − buy) × quantity × scrip point value. Short positions invert the difference.

{% if results %}

Result

{% for r in results %} {% endfor %}
ScripPositionBuySellQtyPointsPoint ValueProfit / Loss
{{ r.scrip }} {{ 'Short' if r.side == 'sell' else 'Long' }} {{ r.buy }} {{ r.sell }} {{ r.quantity }} {{ '%.2f'|format(r.points) }} {{ r.point_value }} ₹{{ '%.2f'|format(r.profit) }}
Net ₹{{ '%.2f'|format(net_total) }}
{% endif %} {% endblock %}