Chart Label to show Daily P/L Status (%) in real time

N

NJM

New member
I've been trying to script a study that would add a label up in the top left corner of a chart showing this info:
  • % up or down of today's current P/L compared with yesterday's P/L (or p/l as of 11:59p yesterday)
The goal here is to potentially better recognize when daily targets or max losses are hit.

I can get the current value from "GetNetLiq()", but struggling to calculate historic account value data.

Once this is calculated, a simple equation could be done (today's pl / yesterday's pl = value I'm looking for) and then the rest of the customization would be straightforward:
  • color based on how much up or down
  • alert based on how much up or down

Thanks!
NJM
 
L

Len20

Member
On a daily chart you could use GetNetLiq() [1] to get yesterdays value. However, it doesn't seem to allow using a daily aggregation on other timeframes. I thought it wasn't possible, but this great post HERE by RobertPayne shows how to still access yesterday's values. For example, this code should get you started with the values you need, and you can go from there:
Code:
def today = GetDay() == GetLastDay();
def todayNetLiq = GetNetLiq();
def yestNetLiq = if today then yestNetLiq[1] else GetNetLiq();
 
M

machie38

New member
Does anybody know of an indicator that will display the percentage label of loss or win on the stock I purchased while in chart mode for it?
 
Chuck

Chuck

Member
Does anyone have an indicator that shows options profit and loss on the screen. I am buying puts from the active trader dome in TOS. The indicator I have now does not pick up options and the Active Trader does not plot out PL for options. I have to continually switch back and forth to the monitor tab to see PL. I know I can see it other ways but it sure would be nice to have it plotted on the screen.
 
rad14733

rad14733

Well-known member
VIP
Does anyone have an indicator that shows options profit and loss on the screen. I am buying puts from the active trader dome in TOS. The indicator I have now does not pick up options and the Active Trader does not plot out PL for options. I have to continually switch back and forth to the monitor tab to see PL. I know I can see it other ways but it sure would be nice to have it plotted on the screen.
@Chuck Are you aware of the P/L Open column in Active Trader...??? That would be the best way to know where you're at... I have is displaying at the far right all the time, along with other customizations... I also have P/L Open displaying in my Active Positions Watchlist in my left sidebar... 💡
 
Chuck

Chuck

Member
@rad14733,

PL/Open is one of my favorite uses of active trader, but it does not work on options(or so I have been told by TOS Support)......I copy an option from the option chain and paste it into my active trader (separate window on flex grid), when I do this it does not show P/L. I have most of the scripts on this forum(that I can find) that display P/L on the chart. But none of them work so far.

rad, I just want to the a min to thank you for all your assistance. It is very much appreciated.

I forgot about the P/L in the Active Positions Watchlist, I will have to try that.
 
Last edited by a moderator:
Chuck

Chuck

Member
l set up the P/L Open on the left sidebar and it did not show in OnDemand, I will have to test it later, but I would still like to have it on my screen. Scenarioes change as I switch between grids, active trader, chats and my multitude of trading setups. Because of this I like to have everything on my charts/grids... just so I don't mess up and forget something.
 

Similar threads

Top