Some help with some chart label scripts..novice here

eugchen

Member
sorry, first post, and novice here. someone generously helped me with these scripts, but looking to modify them a bit....

1. First script shows your Position Net liq on the TOS chart. heres the code. the problem is, it doesnt put a comma in the right spot. for instance if the net liq is 10,000, the script lists it as 10000. anyway to get the comma in there?

def qty = GetQuantity();
def net_liq = qty * close;
AddLabel(yes, "Net Liq Position:$" + AsText(value = net_liq), color = Color.Blue);

2. Second Script--i have this script that works well for showing the P/L OPEN on the stock showing on the chart....anyway to get a similar one showing P/L day? P/L only for today?

def openCost = GetQuantity() * GetAveragePrice();

AddLabel(visible = yes, text = "P/L Open: " + AsPercent(Round(GetOpenPL(), numberOfDigits = 3) / openCost), color = if GetOpenPL() > 0 then color.Green else color.Red);


thanks for helping!
 

Similar threads

Top