Macro-Indicator: NYSE New Highs vs Lows
Within Analyze: Economic Data, there are many macro-economic indicators to view. One of them that thinkorswim doesn't have is the net new highs vs net new lows on the NYSE. Pictured here is that indicator on another site, but it would be better to be able to have this in TOS.
Luckily there were already symbols for new NYSE highs and lows: $NYHGH and $NYLOW. However, subtracting 1 from the other gave us a chart very different from the one we are trying to create. Also this is giving us a chart on a scale much too large(-400 currently when the chart above shows a little less than negative 10%.
To solve this, we will be dividing the symbols by 3000(the approximate number of stocks on the NYSE) to make it in the correct scale, and then averaging the result with a 20 period average to smooth the results
Here is what that looks like:
def nyse_New_HL_Dif = (close("$NYHGH")/3000) - (close("$NYLOW")/3000);
plot dif = round(100*average(nyse_New_HL_Dif, 20));
addlabel(1, " " + dif + "%" +
if dif < -12 then " Extreme Fear "
else if dif > -12 and dif < -5 then " Fear "
else if dif > 5 and dif < 12 then " Greed "
else if dif > 12 then " Extreme Greed "
else " Neutral ",
if dif < 5 then color.dark_red else if dif > 5 then color.dark_green else color.gray);
plot zeroline = 0;
zeroline.setdefaultColor(color.gray);
zeroline.setstyle(curve.SHORT_DASH);
declare lower;
Note that the color choices here are what work better on the "Light" color scheme. On dark you would want to use red, green, and light gray.
Now we see the exact same chart from before. Also, the label at the top left will change between Extreme Fear, Fear, Neutral, Greed and Extreme Greed depending on the value of the chart.