# Plpc in postion

**URL:** <https://forum.alpaca.markets/t/plpc-in-postion/2491>\
**Category:** Getting Started with Alpaca\
**Created:** [August 31, 2020, 11:09pm UTC](https://forum.alpaca.markets/t/plpc-in-postion/2491 "2020-08-31T23:09:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tvdevelop1](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tvdevelop1](https://forum.alpaca.markets/u/tvdevelop1)\
**Post date:** [August 31, 2020, 11:09pm UTC](https://forum.alpaca.markets/t/plpc-in-postion/2491/1 "2020-08-31T23:09:06Z")

</div>

I just realised that the portfolio position plpc : profit loss percent does not actually reflect percent. Its off by two decimal points, see example below. Is this right?

Position({ ‘asset\_class’: ‘us\_equity’,  
‘asset\_id’: ‘f9d55f85-5125-43a6-8cb6-7c8b3c49bbc4’,  
‘avg\_entry\_price’: ‘86.2133333333333333’,  
‘change\_today’: ‘-0.0229261269243549’,  
‘cost\_basis’: ‘1034.56’,  
‘current\_price’: ‘88.22’,  
‘exchange’: ‘NYSE’,  
‘lastday\_price’: ‘90.29’,  
‘market\_value’: ‘1058.64’,  
‘qty’: ‘12’,  
‘side’: ‘long’,  
‘symbol’: ‘XPO’,  
‘unrealized\_intraday\_pl’: ‘-24.84’,  
‘unrealized\_intraday\_plpc’: ‘-0.0229261269243549’,  
‘unrealized\_pl’: ‘24.08’,  
‘unrealized\_plpc’: ‘0.0232755954222085’}

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [August 31, 2020, 11:13pm UTC](https://forum.alpaca.markets/t/plpc-in-postion/2491/2 "2020-08-31T23:13:39Z")

</div>

i feel your pain i was just dealing with something like that…

keep your eye on what you code and look at the docs

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [August 31, 2020, 11:27pm UTC](https://forum.alpaca.markets/t/plpc-in-postion/2491/3 "2020-08-31T23:27:33Z")

</div>

you know what also hit me about it, in emulation i was accounting for the data correctly but in paper it was still using a cash value…

---

<div class="post-metadata">

**Author:** ![tvdevelop1](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tvdevelop1](https://forum.alpaca.markets/u/tvdevelop1)\
**Post date:** [August 31, 2020, 11:42pm UTC](https://forum.alpaca.markets/t/plpc-in-postion/2491/4 "2020-08-31T23:42:18Z")

</div>

Well I hope this is fixed, may be it does not represent what I thought it did. I went by the following formula,  
int(qty)/abs(int(qty))\*(float(market\_value)/float(cost\_basis)-1)\*100.  
The fist part is just to change the sign for a short position.
