HomeTrading Widgets › Profit Loss Calculator Widget

Profit Loss Calculator Widget

Lets your readers work out what a trade is actually worth in money, before they place it.

One lineNothing to install
💰
In randOr any account currency
🆓
FreeCommercial use allowed

i In short

Traders think in pips and percentages, and then get their account statement in money. A profit and loss calculator closes that gap. Your reader enters an entry price, an exit price and a position size, and the widget returns the outcome in their account currency, which is the only unit that ever really matters.

The value on an education page is that it makes the relationship between position size and outcome concrete. A twenty pip move sounds trivial until a reader sees it against a one lot position, and a hundred pip target sounds impressive until they see what it produces on a micro lot. Both realisations tend to arrive faster from a calculator than from a paragraph.

The widget handles long and short positions, so a reader can check the downside of a trade as easily as the upside, and it works for any account currency rather than assuming dollars.

Like every widget here it runs in the browser, writes nothing, loads no tracker and needs no sign-up. The appearance is set from the iframe URL so it can match your site without any CSS work on your side.

Try the Profit Loss Calculator Widget

Live previewThis is exactly what your readers will see

Embed code

Copy this into your page

Free for any site, including commercial ones. Keep the small credit line at the bottom of the widget so readers can find the full version. Nothing is stored about the people who use it. See the disclaimer.

How to add it to your site

  1. Copy the code above Use the copy button so nothing is lost to line wrapping. It is a single iframe tag and it does not need anything else.
  2. Open the page you want it on In WordPress add a Custom HTML block, in Wix use the Embed HTML element, in Squarespace use a Code block, and on a hand-built site paste it straight into your HTML.
  3. Paste and publish The widget appears immediately. If you see an empty space instead, your editor has stripped the iframe tag, which the HTML embed guide explains how to work around.
  4. Adjust the look if you want to Add the parameters in the table below to the iframe URL to change the theme, the accent colour or the height. Nothing needs to be configured on our side.

Customisation options

ParameterValuesWhat it does
themeauto, light, darkDefault follows the reader's own system setting, so the widget looks right on a dark site and a light one without you choosing.
accentSix hex digits, e.g. accent=1A56DBRecolours the header bar and the primary button to match your brand.
header1 or 0Set to 0 to hide the title bar when your page already has a heading above the widget.
breakdown1 or 0Set to 0 to hide the calculation breakdown for a more compact block.
corners1 or 0Set to 0 for square corners if your design has no rounding anywhere else.
widthfullRemoves the 520px maximum so the widget stretches to its container.

Parameters are added to the iframe URL as a normal query string, for example /embed/position-size-calculator.html?theme=dark&accent=1A56DB&header=0. The widget builder lets you set all of them visually and hands you the finished code.

What the widget calculates

The widget multiplies the price difference between entry and exit by the position size, applies the direction of the trade, and converts the result into the account currency. It shows the outcome in money and as a percentage of the position value.

Because both a target and a stop can be tested in seconds, it doubles as a way for readers to sanity check a trade's risk-to-reward before committing, which is the habit the risk-reward calculator formalises.

Who this widget suits

Trade idea and analysis posts

Readers can price your scenario against their own account size rather than yours.

Beginner guides

The fastest way to show what a pip is worth is to let someone change the lot size and watch the money move.

Journal and review pages

Useful alongside any article about reviewing closed trades.

Related widgets

The full library of free trading widgets has more than seventy tools, and the widget builder lets you preview and configure any of them before you copy the code.

Frequently asked questions

Does the profit loss calculator widget include trading costs?

It calculates the gross outcome from entry, exit and size. Spread, commission and overnight financing are handled by the trading cost calculator and the spread cost calculator, which are separate widgets so that each tool answers one question clearly.

Does it work for short positions?

Yes. The reader selects the direction and the calculation inverts, so a short that closes below the entry produces a profit. Getting that sign right is a common stumbling block for beginners, which is part of why it is worth showing.

Can readers use it for shares as well as forex?

Yes. The calculation is the same for any instrument where you know the entry, the exit and the size. For JSE shares, remember that securities transfer tax and brokerage apply on top, which this widget does not include.

Is it suitable for a page aimed at complete beginners?

It is one of the better choices for that audience, because the inputs are intuitive and the output is in money. A reader who has never opened a trading platform can still understand entry, exit and size.

Does the widget give trading advice?

No. It is arithmetic on numbers the reader supplies. Nothing it produces is a recommendation, and the widget carries a risk notice making that clear, which matters if you are publishing to a South African audience under FSCA rules on financial advice.

🛡️
Test the numbers on real prices

Try a Free Demo Account

Widgets show the maths. A demo account shows how the same maths behaves against live spreads and real market movement, without risking funds.

Open a free demo account
  • FSCA RegulatedTrade with confidence
  • Practice Risk FreeReal market conditions
  • Beginner FriendlyPerfect for learning

79% of retail CFD accounts lose money. Demo accounts do not guarantee future profits.