How do I accomplish this?
Here is the code in question: (I've also attached the entire indicator in case you need it)
// fill the bands with color and allow for custom opacity level
if (
(Close[0] > UpperBB8[0] && SMA(8)[0] > SMA(20)[0]) ||
(Close[0] > SMA(8)[0] && Rising(SMA(20)))
)
{
DrawRegion("BB8", CurrentBar, 0, UpperBB8, LowerBB8, Color.Empty, longColor, OpacityBB8);
BackColor = Color.PaleTurquoise;
}
else if (
(Close[0] < LowerBB8[0] && SMA(8)[0] < SMA(20)[0]) ||
(Close[0] < SMA(8)[0] && Falling(SMA(20)))
)
{
BackColor = Color.PeachPuff;
DrawRegion("BB8", CurrentBar, 0, UpperBB8, LowerBB8, Color.Empty, shortColor, OpacityBB8);
}
else {
BackColor = Color.Transparent;
DrawRegion("BB8", CurrentBar, 0, UpperBB8, LowerBB8, Color.Empty, Color.Empty, 0);
}
[Note: This is a messy way to paste in the code, but I don't know how to do it in its own window like I see in other posts... How do I do that? ]
Comment