The resource loading... loading...

How partial equity impacts the average price of holdings

Author: Inventors quantify - small dreams, Created: 2017-01-09 17:23:50, Updated:

How partial equity impacts the average price of holdings


Recently, when writing a strategy, I discovered a problem that I hadn't noticed before, which is that after opening a position, partial breakeven, then replenishment, affects the holding price. Since holding price is relatively important for calculating holding profit and loss, holding price is also calculated based on this data if the calculation is wrong.

  • In stock:

    Why is the average price of the stock rising after selling half?

    Quality answers from the web

    Holding price = (outflows - cash inflows) ÷ remaining shares If the selling price is lower than the original holding price, or the purchase price is higher than the original holding price, the holding price will rise. If the sale price is higher than the original holding price, or the purchase price is lower than the original holding price, the holding price will decrease.

    • For example: Purchase at market price 10, share at 1000, transaction fee at 50, cash out at 10050, holding at 10.05 If the sale price is 8, the sale price is 500, the transaction fee is 25, and the cash flow is 3975. Average price of holdings = ((10050-3975) ÷ ((1000-500) = 12.15. If the market price at the time of sale is 12, the sale price is 500, the transaction fee is 25, and the cash flow is 5975. Average holding price = ((10050-5975) ÷ ((1000-500) = 8.15. Average holding price decreased If you buy again at the market price of 8, buy 500 shares, process fee 25, cash out 4025 and then buy the stock at the market price of 8 shares, process fee 25, cash out 4025 and then buy the stock at the market price of 500 shares. Average holding price = ((10050+4025) ÷ ((1000+500) = 9.38. Average holding price decreased If you buy it again at the market price of 12, buy the share at 500, the processing fee at 25, and the money flows to 6025, then you can buy it again at the market price of 12, buy the share at 500, the processing fee at 25, and the cash flows at 6025. Average holding price = ((10050+6025) ÷ ((1000+500) = 10.72. Average holding price increased

    • Understanding: Simply put, if a part of the equity is liquid (unit price), then the remaining equity holdings are pulled down. If a part of the equity is at a loss (unit price), then the remaining equity holdings are raised.

    • Calculation formula:

      持仓均价 =(资金累计流出 - 资金累计流入) ÷ 剩余股份

      Simply put: how much money is shared divided by the number of remaining shares = holding price.

      In other words, according to the current price of this equity, all the shares sold, including the previous partial equity, the opening gains and losses, should be without loss and loss.

  • This algorithm may not normally be needed in a strategy, as the holding price at this time is the holding price without overall loss. If we only focus on partial breakeven, how should we calculate the gain or loss on the remaining holdings?

    One algorithm is that the placement does not do any processing, either completely or partially. It only records how much is left of the item. If the placement is added after partial, it is calculated as follows:

    (开仓时的均价 * 上次部分平仓后标的剩余量 + 本次加仓的均价 * 本次加仓的标的量)/ (当前持有标的物总量) = 剩余持仓均价

    This way we can put aside the gains of the previous partial equilibrium and look at the gains of the current holdings.


More

Not unusualDreams are good.

Inventors quantify - small dreams