Four Charts in One Pane

#1
Kindly required

Help for inserting four charts in one pane


************************** Charts with four charts *********

// GFX Drawing Example

function GetMonth( MonthNumber )
{
switch (MonthNumber) {
case 2 :
result = "Feb";
break ;
case 3 :
result = "Mar";
break ;
case 4 :
result = "Apr";
break ;
case 5 :
result = "May";
break ;
case 6 :
result = "Jun";
break ;
case 7 :
result = "Jul";
break ;
case 8 :
result = "Aug";
break ;
case 9 :
result = "Sep";
break ;
case 10 :
result = "Oct";
break ;
case 11 :
result = "Nov";
break ;
case 12 :
result = "Dec";
break ;
}

return result;
}



GfxSetOverlayMode( 2 );

String = "" ;
for ( x = 0 ; x < 200 ; x++ )
{
WList = CategoryGetName( categoryWatchlist, x );
if (WList != "" )
{
String = String + WList +"," ;
}
}
WatchList = ParamList ( "Watch List", String );
for ( x = 0 ; x < 200 ; x++ )
{
sym = StrExtract ( String, x );
if (sym == WatchList)
{
listNum = x ;
}
}

Page = Param ( "Page #", 0 , 0 , 12 , 1 );
ChartsWiNum = Param ( "# Charts Wide", 2 , 1 , 4 , 1 );
ChartsHiNum = Param ( "# Charts High", 2 , 1 , 4 , 1 );
Bars =Param ( "Number Of Bars", 195 , 50 , 250 , 1 ) ;
ChartMargin = 5 ;
DateMargin = 5 ;
DataMargin = 20 ;
NumCharts = ChartsWiNum * ChartsHiNum ;
ScreenHeight = Status ( "pxheight" ) ;
SceernWidth = Status ( "pxwidth" ) ;
ChartHeight = ScreenHeight / ChartsHiNum -1 ;
Width = SceernWidth / ChartsWiNum - 1 ;
BarChartHeight= (0.75 ) * ChartHeight - DataMargin;
VolChartHeight = ChartHeight - BarChartHeight - DataMargin*1 ;
NumberPriceLevels = BarChartHeight / 50 ;
BarChartWidth= Width - 45 ;
BarWidth = (BarChartWidth - ChartMargin * 5 ) / Bars ;
LastBar = BarCount ;
FirstBar = LastBar - Bars;
_N (list = CategoryGetSymbols( categoryWatchlist, listnum ));
printf ( "Watch List Name\n");
WL = CategoryGetName( categoryWatchlist, listnum );
SymbolNum = Page * NumCharts;

for ( x = 0 ; x < ChartsHiNum ; x++ )
{
for ( i = 0 ; i < ChartsWiNum ; i++ )
{
notDone = True;
sym = StrExtract ( list, SymbolNum );
if (sym != "" )
{
x1 = Width * i + 2 ;
y1 = ChartHeight * x + 10 ;
x2 = Width * (i + 1 );
y2 = ChartHeight * (x + 1 )-DateMargin;
GfxSelectPen ( colorBlack );
GfxRectangle ( x1, y1, x2, y2 );
SymbolNum++;

SetForeign (sym);



}
RestorePriceArrays ();
}
}


*************** chart to be inserted ******************


a=20;
_SECTION_BEGIN("Modified DIS");
GraphXSpace=5;
p=20;
Om=DEMA(O,p);
hm=DEMA(H,p);
lm=DEMA(L,p);
Cm=DEMA(C,p);
HACLOSE=(Om+Hm+Lm+Cm)/4;
HaOpen = AMA( Ref( HaClose, -1), 1);
HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
HaLow = Min( Lm, Min( HaClose, HaOpen ) );

slope = Param("slope",2,2,100,1);
Color20= IIf(LinRegSlope(MA(HaClose,a),slope)<0,colorRed,colorGreen);

Plot(MA(HaClose,a),"", color20,styleThick);

Color=IIf(Haclose>MA(HaClose,a),colorGreen, colorRed);
PlotOHLC( HaOpen, HaOpen, HaClose, HaClose, "" + Name(), Color, styleCandle);



Buy=Color==colorGreen;
Sell=Color==colorRed;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

PlotShapes(IIf(Buy , shapeSmallUpTriangle, shapeNone),colorWhite);
PlotShapes(IIf(Sell, shapeSmallDownTriangle, shapeNone),colorYellow);
Cover=Buy;
Short=Sell;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
 

Similar threads