Two Plot Histogram

I am trying to script a histogram that has one plot on the top and a different plot on the bottom. The script is displaying as valid in the Scrip Manager but is not displaying on the chart correctly. The first script displays completely incorrect while the second script is better but still incorrect. I’m trying to display pos/neg bars on the top and pos/neg bars on the bottom.

Thanks,

Tim

Jaw = MA(BARS=13, STYLE=Smoothed, CALC=Close)[8]; 
Teeth = MA(BARS=8, STYLE=Smoothed, CALC=Close)[5];
Lips = MA(BARS=5, STYLE=Smoothed, CALC=Close)[3];
Top Histo = (Jaw-Teeth);
Bottom Histo =ABS(Teeth-Lips);
DIFFPCT(Top Histo,Bottom Histo)


Jaw = MA(BARS=13, STYLE=Smoothed, CALC=Close)[8]; 
Teeth = MA(BARS=8, STYLE=Smoothed, CALC=Close)[5];
Lips = MA(BARS=5, STYLE=Smoothed, CALC=Close)[3];
Plot2 = (Jaw-Teeth);
Plot1 =ABS(Teeth-Lips);

Plot1.Plotstyle = Histogram;
Plot1.HistColScheme = Positive/Negative;
Plot2.Plotstyle = Histogram;
Plot2.HistColScheme = Positive/Negative;

Hi Tim,

The DIFFPCT is giving odd values because the current TopHist value is negative, whereas BottomHist is using positive numbers only with the ABS() function. Make them both consistent and the values should make more sense.

With two histogram outputs they will overwrite each other, so it’s probably best to use two separate Show Views.

Thanks.