Entry, Target, Profit Loss (PnL) Watchlists, Labels of Owned Equities In ThinkOrSwim

Ditto....is there an answer to this question on how to create custom columns from Portfolio Functions, ie GetNetLiq(). I want to calculate the 'position weight %' of each of my portfolio positions but there is no way to use these functions in Watchlists. Is there another way?
 
Ditto....is there an answer to this question on how to create custom columns from Portfolio Functions, ie GetNetLiq(). I want to calculate the 'position weight %' of each of my portfolio positions but there is no way to use these functions in Watchlists. Is there another way?
I've been digging around everywhere for the same and haven't found it.

Odd that these functions aren't enabled for watchlists. Simple red/green indicators for open positions are something I'm sure many would like to have.
 
I went through all 5 pages of this thread but all of these are for charts and are not for watchlist columns or the positions tab. All I want to do is show profit each position from entry into the trade. I trade mostly options. It would be red for negative, green for positive. It does this on the mobile app. Someone's gotta have this somewhere. I even contacted TD ameritrade and they didn't have it.
Ditto....is there an answer to this question on how to create custom columns from Portfolio Functions, ie GetNetLiq(). I want to calculate the 'position weight %' of each of my portfolio positions but there is no way to use these functions in Watchlists. Is there another way?
I've been digging around everywhere for the same and haven't found it.

Odd that these functions aren't enabled for watchlists. Simple red/green indicators for open positions are something I'm sure many would like to have.
The ToS platform does not make the portfolio functions available for watchlists
 
Last edited:
Average trade price on the chart
would someone please code a script to show the average trade price on the chart as a line? thinkorswim app for iphone and ipad they can show where your position is but on the desktop it doesnt show. sounds very simple but i can't code and have no idea how to make this. thanks!

This tread does not solve the problem and the ask is different.
 
Last edited by a moderator:
Average trade price on the chart
would someone please code a script to show the average trade price on the chart as a line? thinkorswim app for iphone and ipad they can show where your position is but on the desktop it doesnt show. sounds very simple but i can't code and have no idea how to make this. thanks!

This tread does not solve the problem and the ask is different.
What is the definition of Average trade price? There are scripts in this thread for Average Entry Price.
ToS platform has no data field for average sold price.
 
I know how to enter "one triggers sequence" orders. How can I get the value of a purchase made today in order to use it as part of a sell script?

For example, the sell script might be like this (if I can get code for the PurchasePrice)
# intention is to sell for 1% gain
def PurchasePrice = x;
def Sell = if close > 1.01 * PurchasePrice then 1 else 0;
 
The portfolio functions can be found here. They're very limited and basic, and there is already sample code for each posted in the manual.
 
Here's a link to the image of what that code did

Screenshot-2021-01-28-121603.png


I'm looking for something to do this with the "price level"

Screenshot-2021-01-28-121909.png
Add this to the indicator to get the price as a chart bubble.

def avgprice =(if isNaN(TRADEPRICE[-1]) then TRADEPRICE else Double.NaN);
addchartBubble(TRADEPRICE, avgprice,"Avg=$" + GetAveragePrice,color.CYAN);
 
Hi all,

First, thanks to everybody who generously shares their knowledge in this forum! This is an amazing place for traders.

I have a very simple question and I haven't been able to find an answer to it. I'm looking for a Net of Fees P/L badge for actual trades (not strategy) on the current chart. Futures comms fees are quite high on ToS especially for Micros so for small accounts Gross P/L and Net P/L may differ a lot. If it can also give stats on the trades, say winning trades, Net P/L per trade it would be great. If somebody could share any insight, they would be very much welcome!

I can enter the fees per contract manually. I get charged the same amount for every Micro i think. Something along the lines of per instrument NetDayPL=DayPnl - nr_of_trades*fees_per_trade. If there are already thinscripts that do that + other daily trading stats it would be awesome, just surprised I haven't found anything like that.

Thank you,

AB

Hi,

I was wondering if anybody could give at least a pointer at where to look for the number of trades done in a day period in Thinkscript?
P&L Labels For Charts
This script provides the P/L For Accumulated Trades
The Net PnL uses a cost adjusted basis: ProfitLossMode.COST_BASIS

These labels include
  • the total Quantity bought,
  • Average Purchase Price per share and total,
  • the Adjusted Average Sales Price per share and total
  • and the net Gain/Loss
You can edit out the fields that you don't want.
6ewhwpz.png

Ruby:
# Profit & Loss Label (on a cost adjusted basis)
# @merryday 2/2023

input PLMode = ProfitLossMode.COST_BASIS;
def PL = GetOpenPL(profitLossMode = PLMode) ;

def Entry = if GetAveragePrice() != 0 then GetAveragePrice() else Entry[1];
def GainLoss = if PL != 0 then PL else GainLoss[1];
def Qty =  if GetQuantity() != 0 then GetQuantity() else Qty[1];

DefineGlobalColor("Gain",  CreateColor(0, 165, 0)) ;
DefineGlobalColor("Loss",  CreateColor(225, 0, 0)) ;

AddLabel(GainLoss,
"Qty: " + Qty + "  Entry/shr $" + Entry + "   Exit/shr  $" + (Entry+GainLoss)
+ "  | Total Purchase: " +Qty*Entry  + "   Total Sale: " +Qty*(Entry+GainLoss)
+" | P/L: " + AsDollars(GainLoss*Qty),
      if GainLoss > 0 then GlobalColor("Gain") else GlobalColor("Loss"));
 
when I attempt to load the script into a watchlist field.

I went through all 5 pages of this thread but all of these are for charts and are not for watchlist columns or the positions tab. All I want to do is show profit each position from entry into the trade. I trade mostly options. It would be red for negative, green for positive. It does this on the mobile app. Someone's gotta have this somewhere. I even contacted TD ameritrade and they didn't have it.
Ditto, +1, Agree! I have been asking TDA for 2-years about Portfolio Functions on Watchlists. We all have...

Does anyone know if TOS has any intention of ever "fixing" Portfolio Functions on Watchlists, or do we infinitely continue to AddLables() to work-around the platform's limited capabilities. This seems like a simple issue for TOS to address...and there is absolutely-no-question the user community wants it. Asking for a friend. :)

PS Thanks to everyone who contributed to this thread. I have learned a lot from your examples and coming up to speed so that I can contribute as much. Great community.
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
442 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