JohnnyMustard
New member
Hello, I've written the basics of a % Change for the 'FAANG' stocks, plotted on the left axis. The code is included.
On the right axis, I plot /ES and trade that. The market opens (for me) at 630am PST.
I'm having 2 problems.
1) The % Change doesn't begin each session at 0%. Shouldn't it? How can I get it to start at 0% each session?
2) There are unexplained gaps in my indicator, oddly enough usually around 10am PST each day.
In the pic you can see the 10am break for everyday this week.

It's driving me nuts, lol. Any help is greatly appreciated.
input AnchorDate = 20230523;
input AnchorTime = 0631;
input F = "Meta";
input A = "Amzn";
input A2 = "Aapl";
input N = "Nflx";
input G = "Goog";
def PostAnchorDate = if GetYYYYMMDD() >= AnchorDate then 1 else 0;
def PostAnchorTime = if SecondsFromTime(AnchorTime) >= 0 then 1 else 0;
def Fin = if PostAnchorDate and PostAnchorTime then (hl2(F) + hl2(A) + hl2(A2) + hl2(N) + hl2(G)) else 0;
plot FinPctChg = ((Fin - Fin[631]) / Fin[631]) * 100;
plot Zero = 0;
On the right axis, I plot /ES and trade that. The market opens (for me) at 630am PST.
I'm having 2 problems.
1) The % Change doesn't begin each session at 0%. Shouldn't it? How can I get it to start at 0% each session?
2) There are unexplained gaps in my indicator, oddly enough usually around 10am PST each day.
In the pic you can see the 10am break for everyday this week.

It's driving me nuts, lol. Any help is greatly appreciated.
input AnchorDate = 20230523;
input AnchorTime = 0631;
input F = "Meta";
input A = "Amzn";
input A2 = "Aapl";
input N = "Nflx";
input G = "Goog";
def PostAnchorDate = if GetYYYYMMDD() >= AnchorDate then 1 else 0;
def PostAnchorTime = if SecondsFromTime(AnchorTime) >= 0 then 1 else 0;
def Fin = if PostAnchorDate and PostAnchorTime then (hl2(F) + hl2(A) + hl2(A2) + hl2(N) + hl2(G)) else 0;
plot FinPctChg = ((Fin - Fin[631]) / Fin[631]) * 100;
plot Zero = 0;