# getting rid of the line that connects each bar on a chart

#### AshtheMan

##### New member
I have some code i found on here and I like the buy and sell signals but it connects each bar with a white line and makes the chart look a little uglier or there just too much going on for me does anyone know how to get rid of the line (code posted below)

declare upper;
input short_average = 5;
input medium_average = 10;
input long_average = 20;
input average_type = {default "SMA", "EMA"};
input showArrows = yes;

def MA1;
def MA2;
def MA3;
switch (average_type) {
case "SMA":
MA1 = Average(close, short_average);
MA2 = Average(close, medium_average);
MA3 = Average(close, long_average);
case "EMA":
MA1 = ExpAverage(close, short_average);
MA2 = ExpAverage(close, medium_average);
MA3 = ExpAverage(close, long_average);
}

# define e-signal and crossover point
def Eup = MA1 > MA2 && MA2 > MA3;
def Edn = MA1 < MA2 && MA2 < MA3;

def CrossUp = close > MA1 && Eup && !Eup[1];
def CrossDn = close < MA1 && Edn && !Edn[1];

# Define up and down signals
def higherHigh = close > Highest(Max(open, close), 3)[1];
def lowerLow = close < Lowest(Min(open, close), 3)[1];
def SignalUp = if (CrossUp && higherHigh)
then 1
else if (CrossUp[1] && higherHigh && !higherHigh[1])
then 1
else if (CrossUp[2] && higherHigh && !higherHigh[1] && !higherHigh[2])
then 1
else Double.NaN;
def SignalDn = if (CrossDn && lowerLow)
then 1
else if (CrossDn[1] && lowerLow && !lowerLow[1])
then 1
else if (CrossDn[2] && lowerLow && !lowerLow[1] && !lowerLow[2])
then 1
else Double.NaN;

# Plot the moving average lines
plot ln1 = MA1;
ln1.SetDefaultColor(CreateColor(145, 210, 144));
ln1.SetLineWeight(2);
plot ln2 = MA2;
ln2.SetDefaultColor(CreateColor(111, 183, 214));
ln2.SetLineWeight(2);
plot ln3 = MA3;
ln3.SetDefaultColor(CreateColor(249, 140, 182));
ln3.SetLineWeight(2);

# Show an arrow
plot ArrowUp = if SignalUp and showArrows then low * 0.997 else Double.NaN;
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowUp.SetLineWeight(4);
ArrowUp.SetDefaultColor(Color.YELLOW);
plot ArrowDn = if SignalDn and showArrows then high * 1.003 else Double.NaN;
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDn.SetLineWeight(4);
ArrowDn.SetDefaultColor(Color.CYAN);

# Add label for Eup or Edn
AddLabel(Eup, "E Up", CreateColor(134, 202, 93));
AddLabel(Edn, "E Dn", CreateColor(232, 148, 157));

# Calculate Meter Values
def sl1 = ma1 > ma1[1];
def sl2 = ma2 > ma2[1];
def sl3 = ma3 > ma3[1];
def p1 = close > ma1;
def p2 = close > ma2;
def p3 = close > ma3;
def u1 = 2 * (close > open);
def u2 = 2 * (close > high[1]);
def d1 = 2 * (close < open);
def d2 = 2 * (close < low[1]);

def UPstr = sl1 + sl2 + sl3 + p1 + p2 + p3 + u1 + u2;
def DNstr = !sl1 + !sl2 + !sl3 + !p1 +!p2 + !p3 + d1 + d2;

AddLabel(Eup or Edn, " ", if Eup and UPstr >= 3 then CreateColor(128, 199, 94) else if Edn and DNstr >= 3 then CreateColor(232, 143, 153) else CreateColor(177,177,166));
AddLabel(Eup or Edn, " ", if Eup and UPstr >= 6 then CreateColor(99, 197, 72) else if Edn and DNstr >= 6 then CreateColor(238, 123, 136) else CreateColor(177,177,166));
AddLabel(Eup or Edn, " ", if Eup and UPstr >= 8 then CreateColor(65, 195, 50) else if Edn and DNstr >= 8 then CreateColor(245, 101, 117) else CreateColor(177,177,166));
AddLabel(Eup or Edn, " ", if Eup and UPstr == 10 then CreateColor(41, 192, 36) else if Edn and DNstr == 10 then CreateColor(249, 81, 101) else CreateColor(177,177,166));

Solution
I have some code i found on here and I like the buy and sell signals but it connects each bar with a white line and makes the chart look a little uglier or there just too much going on for me does anyone know how to get rid of the line (code posted below)

declare upper;
input short_average = 5;
input medium_average = 10;
input long_average = 20;
input average_type = {default "SMA", "EMA"};
input showArrows = yes;

def MA1;
def MA2;
def MA3;
switch (average_type) {
case "SMA":
MA1 = Average(close, short_average);
MA2 = Average(close, medium_average);
MA3 = Average(close, long_average);
case "EMA":
MA1 = ExpAverage(close, short_average);
MA2 = ExpAverage(close, medium_average);
MA3 = ExpAverage(close, long_average);
}

# define...
I have some code i found on here and I like the buy and sell signals but it connects each bar with a white line and makes the chart look a little uglier or there just too much going on for me does anyone know how to get rid of the line (code posted below)

declare upper;
input short_average = 5;
input medium_average = 10;
input long_average = 20;
input average_type = {default "SMA", "EMA"};
input showArrows = yes;

def MA1;
def MA2;
def MA3;
switch (average_type) {
case "SMA":
MA1 = Average(close, short_average);
MA2 = Average(close, medium_average);
MA3 = Average(close, long_average);
case "EMA":
MA1 = ExpAverage(close, short_average);
MA2 = ExpAverage(close, medium_average);
MA3 = ExpAverage(close, long_average);
}

# define e-signal and crossover point
def Eup = MA1 > MA2 && MA2 > MA3;
def Edn = MA1 < MA2 && MA2 < MA3;

def CrossUp = close > MA1 && Eup && !Eup[1];
def CrossDn = close < MA1 && Edn && !Edn[1];

# Define up and down signals
def higherHigh = close > Highest(Max(open, close), 3)[1];
def lowerLow = close < Lowest(Min(open, close), 3)[1];
def SignalUp = if (CrossUp && higherHigh)
then 1
else if (CrossUp[1] && higherHigh && !higherHigh[1])
then 1
else if (CrossUp[2] && higherHigh && !higherHigh[1] && !higherHigh[2])
then 1
else Double.NaN;
def SignalDn = if (CrossDn && lowerLow)
then 1
else if (CrossDn[1] && lowerLow && !lowerLow[1])
then 1
else if (CrossDn[2] && lowerLow && !lowerLow[1] && !lowerLow[2])
then 1
else Double.NaN;

# Plot the moving average lines
plot ln1 = MA1;
ln1.SetDefaultColor(CreateColor(145, 210, 144));
ln1.SetLineWeight(2);
plot ln2 = MA2;
ln2.SetDefaultColor(CreateColor(111, 183, 214));
ln2.SetLineWeight(2);
plot ln3 = MA3;
ln3.SetDefaultColor(CreateColor(249, 140, 182));
ln3.SetLineWeight(2);

# Show an arrow
plot ArrowUp = if SignalUp and showArrows then low * 0.997 else Double.NaN;
ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowUp.SetLineWeight(4);
ArrowUp.SetDefaultColor(Color.YELLOW);
plot ArrowDn = if SignalDn and showArrows then high * 1.003 else Double.NaN;
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
ArrowDn.SetLineWeight(4);
ArrowDn.SetDefaultColor(Color.CYAN);

# Add label for Eup or Edn
AddLabel(Eup, "E Up", CreateColor(134, 202, 93));
AddLabel(Edn, "E Dn", CreateColor(232, 148, 157));

# Calculate Meter Values
def sl1 = ma1 > ma1[1];
def sl2 = ma2 > ma2[1];
def sl3 = ma3 > ma3[1];
def p1 = close > ma1;
def p2 = close > ma2;
def p3 = close > ma3;
def u1 = 2 * (close > open);
def u2 = 2 * (close > high[1]);
def d1 = 2 * (close < open);
def d2 = 2 * (close < low[1]);

def UPstr = sl1 + sl2 + sl3 + p1 + p2 + p3 + u1 + u2;
def DNstr = !sl1 + !sl2 + !sl3 + !p1 +!p2 + !p3 + d1 + d2;

AddLabel(Eup or Edn, " ", if Eup and UPstr >= 3 then CreateColor(128, 199, 94) else if Edn and DNstr >= 3 then CreateColor(232, 143, 153) else CreateColor(177,177,166));
AddLabel(Eup or Edn, " ", if Eup and UPstr >= 6 then CreateColor(99, 197, 72) else if Edn and DNstr >= 6 then CreateColor(238, 123, 136) else CreateColor(177,177,166));
AddLabel(Eup or Edn, " ", if Eup and UPstr >= 8 then CreateColor(65, 195, 50) else if Edn and DNstr >= 8 then CreateColor(245, 101, 117) else CreateColor(177,177,166));
AddLabel(Eup or Edn, " ", if Eup and UPstr == 10 then CreateColor(41, 192, 36) else if Edn and DNstr == 10 then CreateColor(249, 81, 101) else CreateColor(177,177,166));
I do not have a line like you are getting from loading the above code.

I think you might not have deleted plot data = close; that is part of all new studies when you copied the code into your study.

haha ya you were right i didnt delete that first line thank you!

87k+ Posts
299 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?