The goal here was to be able to Plot the Index Price Chart in the Pane above or below whatever symbol you are looking at without flicking backwards and forwards with windows.
Note: I have put in Foreign Param at the top of the Pane so you know the other panes above or below will have no reference to this chart.
_SECTION_BEGIN(“Foreign Price Param”);
foreignticker = ParamStr(“Ticker”,”$NDX”);
SetForeign(foreignticker);
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = “Foreign Param-“+foreignticker +StrFormat(” – {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}”,O,H,L,C, SelectedValue(ROC(C,1))));
//Chart Parameters
ChartType = ParamList(“Chart Type”,”OHLC Bar|Candle|Line”,0);//Parameter OHLC Bar, Candle and Line Chart Drop Down Box
SetChartBkColor(ParamColor(“Background Colour”,colorBlack));//Parameter Background colour
//Colours
Upcolour = ParamColor(“Bar/Candle Up Colour”,colorBrightGreen);//Candle up Bright Green
Downcolour = ParamColor(“Bar/Candle Down Colour”,colorRed);// Candle Down Red
Colour1 = IIf(C>Ref(C,-1),upcolour,downcolour);// Colour Green if today close is greater than yesterday close otherwise red
Colour2 = IIf(C>O,upcolour,downcolour);//Colour Green if Close is greater than open otherwise color red
colour3 = ParamColor(“Line Chart Colour”,colorRed);//Line Chart colour red
TextColour = ParamColor(“Text Colour”, colorWhite);
//Paramlist Chart Options Allocation
if(charttype == “OHLC Bar”) Chartoption = styleBar;
if(charttype == “Candle”) Chartoption = styleCandle;
if(charttype == “Line”) Chartoption = styleLine;
//Paramlist Colour Allocation
if(charttype == “OHLC Bar”) colouroption = colour1;
if(charttype == “Candle”) colouroption = colour2;
if(charttype == “Line”) colouroption = colour3;
Plot(Close,”Close”,colouroption,styleNoTitle|ChartOption|ParamStyle(“Chart Style”));//stylenotitle removes “Name” part of the Plot function
GraphXSpace = 10;//Percent blank above and below the Chart
foropen = O;
forclose = C;
forhigh = H;
forlow = L;
RestorePriceArrays();
_SECTION_END();
O = foropen;
C = forclose;
H = forhigh;
L = forlow;