Stock Profit and Loss Calculation | Gate

06/29/2026 (UTC)
1.408 Baca
3

Stock Profit and Loss & Pricing | Gate

This article explains how the latest price is determined in your Gate Stock account, what position cost represents, and how metrics like position profit and loss and daily profit and loss are calculated.

Two key settings (both found under Settings → Trading Settings):

  • Position Cost Price: Average Cost Price or Diluted Cost Price
  • Latest Price: Intraday Latest Price or Pre-market/Post-market Latest Price

All amounts in this article are denominated in USDT; after switching settings, the page will refresh according to the new criteria, with your account’s real-time numbers as the standard.

1. Core Concepts

Concept Meaning
Latest Price The reference price used to calculate position market value and floating P&L; you can select Intraday Latest Price or Pre-market/Post-market Latest Price in settings (see Section 3)
Position Cost Price The unit cost (USDT/share) for shares you currently hold; you can choose Average Cost Price or Diluted Cost Price in settings (see Section 2)
Position Quantity The number of shares currently held
Position Market Value The total value of current holdings calculated at the latest price
Position Profit and Loss Unrealized P&L for current holdings (portion not yet sold)
Daily Profit and Loss P&L changes generated today for the account or position (includes realized portion from today’s sales + today’s floating P&L for current holdings)
Net Value Stock account position market value + available balance

2. Position Cost: Average Cost vs. Diluted Cost

2.1 Where to Set

Select the calculation method for Position Cost Price under Settings → Trading Settings:

Option Description
Average Cost Price Weighted calculation based only on buy trades; selling does not change the per-share cost of remaining shares
Diluted Cost Price Weighted calculation similar to average cost when buying; after selling, recalculated as "net investment ÷ remaining shares"

After switching, position cost price, position P&L, and daily P&L will be displayed according to the new criteria; numbers may differ significantly under different criteria, so please reconcile using your currently selected method.

2.2 Common Rules

  • Position Cost Price (USDT/share): Used for comparison with latest price to calculate position P&L.
  • Buy and sell prices are based on transaction records; whether fees are included in cost depends on Gate Stock rules and fund flow records (examples below use average price including fees for simplicity).
  • After selling all shares: Cost for the asset is reset to zero; buying again starts a new calculation.

2.3 Average Cost Price

Logic: Only considers how buy trades raise or lower cost; profit or loss from selling is recorded as realized P&L, and does not adjust the per-share cost of remaining stocks.

After buying (merged with existing holdings):

Average Cost Price = (original shares × original average cost + new shares × new buy average price) ÷ (original shares + new shares)

After partial or full sale:

  • The average cost price of remaining shares does not change (still equals the value before selling).
  • Realized P&L (per sale) = (sale average price − average cost price before sale) × number of shares sold

2.4 Diluted Cost Price

Logic: Deduct funds recovered from sales from total investment, then spread the remainder over remaining shares to get the new per-share cost; selling at a profit lowers diluted cost, selling at a loss raises it.

After buying (only holding, not selling; calculation same as average cost):

Diluted Cost Price = (original shares × original diluted cost + new shares × new buy average price) ÷ (original shares + new shares)

After selling (key difference):

Diluted Cost Price = (total position cost before sale − sale proceeds) ÷ remaining shares after sale

Where:

  • Total position cost before sale = diluted cost price before sale × shares before sale
  • Sale proceeds = sale average price × number of shares sold

Realized P&L (per sale, for easy reconciliation):

Realized P&L = (sale average price − diluted cost price before sale) × number of shares sold

After the sale, remaining shares get a new diluted cost price calculated as above; future position P&L compares new cost price to latest price.

2.5 Comparison of Cost Methods

Comparison Average Cost Price Diluted Cost Price
Multiple buys Weighted average of buys Weighted average of buys (same as average cost)
Per-share cost after sale Unchanged Recalculated (adjusted for sale P&L)
Remaining cost after profitable sale Still high (does not include realized dilution) Usually lower
Best for understanding "How many shares do I have left, and what did I pay per share?" "After subtracting proceeds from sales, what is my net investment per share?"

3. Latest Price: Intraday vs. Pre-market/Post-market

3.1 Where to Set

Select how Latest Price is used for P&L calculations under Settings → Trading Settings:

Option Description
Intraday Latest Price Uses only the latest price during regular US stock market hours
Pre-market/Post-market Latest Price Uses latest price from pre-market and post-market sessions when available; falls back to intraday price if no pre/post-market data

The latest price used for P&L, market value, and price change displays matches your selected criteria (keeps consistent with the price list and position page under the same settings).

3.2 Price Source

  • Price data comes from real-time US stock market trades integrated by the platform.
  • Intraday Latest Price: Latest trade price updated during regular trading hours (or equivalent "latest price" shown by the platform).
  • Pre-market/Post-market Latest Price: If there are price feeds in pre-market/post-market, uses the latest price from those sessions; when the market is closed and there are no extended session quotes, typically uses the most recent intraday or post-market price until the next session refreshes.

3.3 Comparison of Latest Price Methods

Comparison Intraday Latest Price Pre-market/Post-market Latest Price
Intraday session Intraday latest price Intraday latest price
Pre-market / Post-market (if data available) Still uses previous intraday price or stops updating until open Can update with pre-market/post-market price changes
Full market closure Usually uses most recent available price, may not change May use last post-market price if available; otherwise same as left
Impact on P&L Less fluctuation outside trading hours May fluctuate outside intraday due to extended session prices
Trading capability Does not mean you can place orders in pre-market/post-market; Gate Stock only allows new orders in regular intraday

3.4 Relationship to Daily P&L

When Pre-market/Post-market Latest Price is selected, daily P&L and position P&L use the latest price reflecting extended session fluctuations; reference prices like "relative to previous close" are matched to your selected latest price criteria, calculated uniformly by the platform, with the displayed page as the standard.

3.5 Latest Price ≠ Transaction Price

  • Latest price is a reference for market value and floating P&L.
  • Actual buy/sell trades are executed at the platform’s tradable price during intraday, based on order and trade records.
  • During high volatility, the transaction price may differ from the latest price seen before or after placing an order.

4. Calculation Formulas

All formulas below use USDT for prices and amounts; quantities are in shares.

4.1 Position Market Value

Position Market Value = position quantity × latest price

(The account’s total position market value is the sum of each asset’s position market value.)

4.2 Position P&L (Unrealized)

Latest price and position cost price are based on your current settings (see Sections 2 and 3).

Position P&L = (latest price − position cost price) × position quantity

Equivalent form:

Position P&L = position market value − position quantity × position cost price

  • Result > 0: floating profit; < 0: floating loss.
  • Applies only to currently held shares; P&L for sold shares is counted as realized P&L (see example).

4.3 Daily P&L

Daily P&L reflects calendar day (US Eastern Time) P&L changes, composed only of the day’s floating P&L for current holdings, excluding realized portion:

Daily P&L = daily floating P&L for current holdings

Daily floating P&L for current holdings

For shares held at yesterday’s close and not fully sold today:

Floating Part₁ = shares × (latest price − previous closing price)

For shares bought today and still held:

Floating Part₂ = shares × (latest price − average buy price for these shares)

Daily floating P&L for current holdings = Floating Part₁ + Floating Part₂

(If there’s no "held yesterday" or "bought today," the corresponding term is 0.)

4.4 Account Net Value & Daily P&L

Net Value = position market value + available balance

Account Daily P&L (stock account header "Daily P&L"):

Account Daily P&L = current net value − net value at start of day − net funds transferred in today

Where net funds transferred in today = funds transferred into stock account today − funds transferred out today (does not include changes in available balance due to trading; uses platform statistics).

The sum of daily P&L for individual assets may differ slightly from account daily P&L due to exchange rate display, pending funds, fees, corporate actions, etc.—account overview is the standard.

5. Example: Buying and Selling Micron (MU)

Below is a simplified example; not real market data. Assume:

  • Average price includes fees;
  • No MU position at previous close;
  • At the calculation time, latest price = 111.00 USDT/share (regardless of "intraday / pre-market/post-market" selection, only for cost difference demonstration);
  • When either latest price method is selected, position market value and position P&L use the same latest price in formulas.

5.1 Trade Record (Same US Stock Trading Day, Intraday)

Step Action Trade Price (USDT/share) Quantity (shares)
Buy MU 100.00 20
Buy MU 110.00 10
Sell MU 112.00 15

5.2 After Step ①

Item Calculation Result
Position quantity 20 shares
Position cost price 100.00 100.00 USDT/share
Latest price = 105.00 Position P&L = (105 − 100) × 20 +100.00 USDT
Position market value 105 × 20 2,100.00 USDT

5.3 After Step ② (Weighted Buy)

At this point, only buys, no sales; average cost price and diluted cost price are the same:

Cost price = (20 × 100 + 10 × 110) ÷ (20 + 10) = 3,100 ÷ 30 = 103.33 USDT/share

Item Calculation Result
Position quantity 30 shares
Latest price = 108.00 Position P&L = (108 − 103.33) × 30 +140.00 USDT (approx.)
Position market value 108 × 30 3,240.00 USDT

5.4 After Step ③ (Sell 15 Shares, 15 Remaining)

Before selling: 30 shares, cost price is 103.33; sale proceeds = 112.00 × 15 = 1,680.00 USDT.

A. If "Average Cost Price" is selected

Item Calculation Result
Cost price for remaining 15 shares After sale unchanged 103.33 USDT/share
Realized P&L for this sale (112.00 − 103.33) × 15 +130.05 USDT
Position P&L at latest price = 111.00 (111.00 − 103.33) × 15 +115.05 USDT
Daily P&L (MU, no previous position) 130.05 + 115.05 +245.10 USDT

B. If "Diluted Cost Price" is selected

Item Calculation Result
Total position cost before sale 103.33 × 30 3,100.00 USDT
New diluted cost price (3,100.00 − 1,680.00) ÷ 15 94.67 USDT/share
Realized P&L for this sale (112.00 − 103.33) × 15 +130.05 USDT (same as A)
Position P&L at latest price = 111.00 (111.00 − 94.67) × 15 +245.00 USDT
Daily P&L (MU, no previous position) 130.05 + 245.00 +375.05 USDT

With the same latest price of 111 and the same sale, Diluted Cost Price results in a higher position P&L for remaining holdings, because profits have been diluted into the cost. The total P&L (realized + unrealized) should be consistent in a complete cycle under both methods, but individual numbers differ—do not compare across methods.

5.5 Latest Price Method Example (Concept)

Assume after Step ③, 15 shares remain, average cost price 103.33, diluted cost price 94.67:

Latest Price Setting Sample Quote at That Time Position P&L (using average cost)
Intraday Latest Price Intraday latest price 111.00 (111.00 − 103.33) × 15 = +115.05
Pre-market/Post-market Latest Price Post-market latest price 112.50 (data source has post-market) (112.50 − 103.33) × 15 = +137.55

You cannot place new orders after market close, but if Pre-market/Post-market Latest Price is selected, position P&L will update with post-market prices; if Intraday Latest Price is selected, calculation stays at 111.00 until the next intraday session.

5.6 Summary Table

Metric Average Cost Price Diluted Cost Price
Per-share cost after Step ③ 103.33 (unchanged) 94.67 (recalculated)
Position P&L after Step ③ @111 +115.05 +245.00
Realized P&L for this sale @112 +130.05 +130.05

If MU was held at yesterday’s close, today’s floating P&L would also include yesterday’s shares × (latest price − previous close); both previous close and latest price are matched to your selected criteria, with the page display as the standard.


6. Other Factors Affecting P&L Display

  • Corporate actions (cash dividends, stock splits, reverse splits, etc.): Account and fund flows will adjust holdings or funds per platform rules; P&L is based on processed holdings and cost.
  • Order modifications, partial fills: Cost price and quantity are based on final trade records.
  • Display units: Switching exchange rate/valuation display only affects presentation, not actual trades or fund flows.
  • Inconsistency with external apps: Usually due to differences in average/diluted cost, intraday/pre-market/post-market latest price, whether fees are included, etc.

7. Where to View

  • Stock homepage / asset section: Net value, position market value, position P&L, daily P&L
  • Positions: Per-asset position quantity, cost price (shows average or diluted per settings), P&L
  • Settings → Trading Settings: Switch position cost price and latest price criteria
  • Trade Records → Order History / Fund Flow: Trade price, fees, dividends, etc.

If you have questions about a specific trade or fee, please verify using trade records and fund flow.

Disclaimer

The content provided herein is for reference and educational purposes only and does not constitute any financial, investment, trading, or legal advice, nor does it constitute an offer or solicitation to buy or sell any digital assets. Gate makes no express or implied representations or warranties regarding the accuracy, completeness, or timeliness of the information contained herein. Product features, interfaces, rules, and fee structures may be updated or adjusted at any time. Please refer to the latest announcements and the actual information displayed on the Gate platform for the most accurate details.
Digital asset investments involve significant risk, and prices may fluctuate substantially. You may lose the entire amount of your investment. Please make decisions cautiously based on your own financial situation and risk tolerance after fully understanding the associated risks. If necessary, you are advised to consult an independent professional financial or legal advisor.
For more information about potential risks, please refer to Gate's Risk Disclosure and User Agreement.

Artikel Terkait

Daftar sekarang untuk mendapatkan kesempatan memenangkan hingga $10,000!
signup-tips