Show Position Value at Bid Price in Portfolio

orionanomaly

New member
Hi all! First week using TOS and trying to get the Position Statement (Monitor Tab) to show my position's value at the BID PRICE (e.g. if I liquidated all securities at the bid price/market price what is the float value NOW?).

I easily added the Bid and Bid X columns to the position sheet, but by default only the MARK price is shown (which is esp. useless with illiquid options as it often doesn't even approximate the bid price). But ok I have the BID PRICE displayed AND the TRADE PRICE (ie cost) so in theory I can just difference them in my head... BUT why can't I get a column that literally just subtracts these 2 numbers??

*I tried writing a function but 'bid' keeps coming up as an error (I've seen scripts which are just 'bid-ask' written and they work, so no idea what I'm doing wrong there. I also know there are portfolio-specific functions, and I believe I read that 'BID' won't work with them. But all I want is a simple subtraction of two values ALREADY in the portfolio window so I'm thinking it must be possible?!

***I also know I'm not insane because Schwab's trading platform explicitly has a setting where you can force everything to display valued at the BID price, so clearly some people find this useful.

ANY help would be awesome, first time poster.
Thanks

***I saw someone create a new column this easily in their options trade window (could this work for the portfolio window? I haven't even been able to get this simple subtraction to work...
 
Last edited:
*I tried writing a function but 'bid' keeps coming up as an error (I've seen scripts which are just 'bid-ask' written and they work, so no idea what I'm doing wrong there. I also know there are portfolio-specific functions, and I believe I read that 'BID' won't work with them. But all I want is a simple subtraction of two values ALREADY in the portfolio window so I'm thinking it must be possible?!

I haven't written anything for the monitor tab before but this may get you the price you want. It works in charts.

Ruby:
def bid = close(priceType = PriceType.BID);
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thank you for your response! So firstly, it seems I've discovered that custom columns cannot be added to the monitor panel, so that probably will not work. I'm very surprised TOS doesn't have this option or at least a manual way to input it since Schwab allows you to display prices as the bid price.

*I'm not sure that's what I would need - I'm looking to do: Gain/Loss=Trade Price - Bid, but it looks like no columns can be added to the panel even if I could get it to work :(

If I misunderstood though I'd love someone to correct me.
 
You can add custom columns on the Monitor -> Activity and Positions tab in the Position Statement section by clicking the gear icon that appears above the column headers on the right. For some reason they made that UI slightly different than, for instance, on the Monitor -> Account Statement tab where the gear icon is in line with the column headers and matches the UI design in other areas of TOS.

However, it appears portfolio functions can't be used in watchlists so getting the prices to do your calculation doesn't seem possible in a watchlist column.

If the portfolio functions were enabled the code would be as simple as:

Ruby:
def bid = close(priceType = PriceType.BID);
def cost = GetAveragePrice();
plot PLBid = (bid - cost);

This code works correctly in a chart. For instance, if displayed as a label instead of a plot. I'm not sure why portfolio functions aren't available in watchlist columns.

Don't let the close function fool you there. While the current period hasn't yet closed, for instance the current 1 hour period with extended hours enabled, close is the constantly updating price up to that moment and in the code above we told it we want the bid price.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
511 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top