I wonder if there is a way to add volume of SPY to the lower panel of SPX chart. The following study works if the main chart is a stock or etf such as AAPL or QQQ. However, it doesn't work if the main chart is SPX -- I guess it's because SPX doesn't have volume data and therefore the lower volume panel is by default missing? Any idea of how to make it work on the SPX chart? Much appreciated!
input ticker="SPY";
declare lower;
plot data = volume(ticker);
data.setPaintingStrategy(PaintingStrategy.Histogram);
data.SetDefaultColor(Color.Dark_Green);
data.SetLineWeight(5);