Hey all,
I'm trying to design an indicator to plot a line for the previous day closing price and the line to display the different color lines depending on the market conditions. I am interested in using this to play Red to Green or Green to Red trades. I searched and didn't find anything so I gave it a try and see if I could come up with something myself. Here's the code that I have so far:
input Close_Color = {default single};
plot Data = close;
plot priceLine = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then close else Double.NaN);
def RedDay = Data < priceLine;
def GreenDay = Data > priceLine;
plot DailyClose = close(period = ”DAY”)[1];
DailyClose.SetDefaultColor(Color.BLACK);
DailyClose.DefineColor("Above Close", Color.DARK_GREEN);
DailyClose.DefineColor("Below Close", Color.DARK_RED);
DailyClose.HideBubble();
DailyClose.HideTitle();
DailyClose.AssignValueColor(if Close_Color == Color_Color.fluid and RedDay then DailyClose.Color("Above Close")
else if Close_Color == Color_Color.fluid and GreenDay then DailyClose.Color("Below Close")
else Color.BLACK);
However, I keep getting and error message ("NO such constant: Color_color.fluid at 19.52). I tried a different iterations of this code and it displayed the previous day close but the colors were off. Any help would be great and much appreciate.
I'm trying to design an indicator to plot a line for the previous day closing price and the line to display the different color lines depending on the market conditions. I am interested in using this to play Red to Green or Green to Red trades. I searched and didn't find anything so I gave it a try and see if I could come up with something myself. Here's the code that I have so far:
input Close_Color = {default single};
plot Data = close;
plot priceLine = HighestAll(if IsNaN(close[-1]) and !IsNaN(close) then close else Double.NaN);
def RedDay = Data < priceLine;
def GreenDay = Data > priceLine;
plot DailyClose = close(period = ”DAY”)[1];
DailyClose.SetDefaultColor(Color.BLACK);
DailyClose.DefineColor("Above Close", Color.DARK_GREEN);
DailyClose.DefineColor("Below Close", Color.DARK_RED);
DailyClose.HideBubble();
DailyClose.HideTitle();
DailyClose.AssignValueColor(if Close_Color == Color_Color.fluid and RedDay then DailyClose.Color("Above Close")
else if Close_Color == Color_Color.fluid and GreenDay then DailyClose.Color("Below Close")
else Color.BLACK);
However, I keep getting and error message ("NO such constant: Color_color.fluid at 19.52). I tried a different iterations of this code and it displayed the previous day close but the colors were off. Any help would be great and much appreciate.