Hi everyone! Need a bit of help with this script
https://usethinkscript.com/threads/finding-the-slope-of-macd-line.5118/#post-52331
I am trying to modify it, if anyone might have some free time.
1. Is there a way for there to be a somewhat "fluid" TimeStamp? What I mean is in this line:
AddChartBubble(secondsFromTime(0001) > 0, sline, if slowlineslope == 1 then "slowline - Slope Up"else "slowline - Slope Down", if Slowlineslope ==1 then Color.Green else Color.red);
a. its this line here, (secondsFromTime(0001) > 0, that I am having trouble with. If possible I would want it to be constant or closest to it. Maybe a 1 minute bar by bar? I hope I am explaining this correctly.
I will place the script in its entirety below here:
declare lower;
input price = close;
input Fastline_price = close;
input FastLine_Average_Type = AverageType.SIMPLE;
input Slowline_price = close;
input Slowline_average_type = AverageType.SIMPLE;
def Fastline = Average(price, 3) - Average(price, 10);
def Slowline = Average(Fastline, 16);
plot Fline = Average(price, 3) - Average(price, 10);
plot Sline = Average(Fastline, 16);
def fastlineSlope = if Fline > Fline[1] then 1 else 0 ;
def SlowlineSlope = if Sline > Sline[1] then 1 else 0 ;
plot UPS = if Sline > Sline[1] then 1 else 0;
plot DownS = if Sline < Sline [1] then 0 else 1;
AddChartBubble(SecondsFromTime(0001) >= 0, Sline, if SlowlineSlope == 1 then "Slowline - Slope UP" else "Slowline - Slope DOWN", if SlowlineSlope == 1 then Color.GREEN else Color.RED);
Thank you for taking a peek!
https://usethinkscript.com/threads/finding-the-slope-of-macd-line.5118/#post-52331
I am trying to modify it, if anyone might have some free time.
1. Is there a way for there to be a somewhat "fluid" TimeStamp? What I mean is in this line:
AddChartBubble(secondsFromTime(0001) > 0, sline, if slowlineslope == 1 then "slowline - Slope Up"else "slowline - Slope Down", if Slowlineslope ==1 then Color.Green else Color.red);
a. its this line here, (secondsFromTime(0001) > 0, that I am having trouble with. If possible I would want it to be constant or closest to it. Maybe a 1 minute bar by bar? I hope I am explaining this correctly.
I will place the script in its entirety below here:
declare lower;
input price = close;
input Fastline_price = close;
input FastLine_Average_Type = AverageType.SIMPLE;
input Slowline_price = close;
input Slowline_average_type = AverageType.SIMPLE;
def Fastline = Average(price, 3) - Average(price, 10);
def Slowline = Average(Fastline, 16);
plot Fline = Average(price, 3) - Average(price, 10);
plot Sline = Average(Fastline, 16);
def fastlineSlope = if Fline > Fline[1] then 1 else 0 ;
def SlowlineSlope = if Sline > Sline[1] then 1 else 0 ;
plot UPS = if Sline > Sline[1] then 1 else 0;
plot DownS = if Sline < Sline [1] then 0 else 1;
AddChartBubble(SecondsFromTime(0001) >= 0, Sline, if SlowlineSlope == 1 then "Slowline - Slope UP" else "Slowline - Slope DOWN", if SlowlineSlope == 1 then Color.GREEN else Color.RED);
Thank you for taking a peek!
Last edited by a moderator: