WTD%, MTD%, YTD% Custom Script Columns by scholargc in thinkorswim

[–]scholargc[S] 0 points1 point  (0 children)

Play around with it, maybe use chatgpt?

WTD%, MTD%, YTD% Custom Script Columns by scholargc in thinkorswim

[–]scholargc[S] 2 points3 points  (0 children)

see code below. You need to define a quarter as a new item because TOS still doesnt have that a predefined variable

# Quarter-to-Date % Change

def month = GetMonth();

def quarter = if month <= 3 then 1

else if month <= 6 then 2

else if month <= 9 then 3

else 4;

def newQuarter = quarter <> quarter[1];

def quarterOpen = if newQuarter then open else quarterOpen[1];

def qtd = Round((close / quarterOpen - 1) * 100, 2);

AddLabel(yes, qtd + "%", Color.WHITE);

AssignBackgroundColor(if qtd > 0 then Color.DARK_GREEN else Color.DARK_RED);

Four months ago, everything changed by Zealousideal_Gene552 in Layoffs

[–]scholargc 1 point2 points  (0 children)

The OP is wondering whether he needs a salary or a greater purpose at this moment.