_SECTION_BEGIN("_ChartTemplat_GD-B_dark");
//-------------------------------------------------------------------------
//----Anweisungen abhängig vom Charttyp------------------------------------
cs = GetPriceStyle(); // CS == ChartStyle
choose = ParamToggle("Charttypabhängigkeit?", "Yes|No");
if(choose == 0){
if(cs == styleBar){
chartArt = "bar";
}
else if (cs == styleCandle){
chartArt = "candle";
}else{
chartArt = "line";
}
} else {
chartArt = "";
};
//-------------------------------------------------------------------------
//---- ChartFarben --ChartStyle--------------------------------------------
if(!choose )
SetChartBkColor( ParamColor("HintergrundFarbe", ColorRGB( 0, 50, 50 ) ) ); // Hintergrund >> nur wenn ChartTemplet greift
line_color_up = ParamColor("Line_Color_UP", ColorRGB( 46, 139 , 87 ) ); //- UP - DOWN -
line_color_down = ParamColor("Line_Color_DOWN", ColorRGB( 220, 20, 60 ) ); //- UP - DOWN -
bar_color_up = ColorRGB( 44, 138 , 84);
bar_color_down = ColorRGB( 220, 22, 60);
candle_color_up = ColorRGB( 0, 0, 255);
candle_color_down = ColorRGB( 255, 0, 0);
candle_rahmen = ColorRGB( 128, 128 , 128);
spezial_color = ParamColor( "PinBar-Color", ColorRGB( 255, 255 , 0) );
//-------------------------------------------------------------------------
//---- Bedingungen --------------------------------------------------------
// PinBars werden anders coloriert
// Bars/Lines/Candles bei denen open und close dicht beieiander liegen werden anders farbieg dargestellt
// zur Vereinfachung, ist der Abstand Hoch - Tief um Faktor "pinbar_faktor" größer als der Abstand Open-Close, gilt die Bedingung
pinbar_faktor = Param( "Pinbar-Faktor", 5, 1, 10, 0.1);
bedingungOpenNearClose = abs(H-L)/ pinbar_faktor > abs(O-C) ;
bedingungUp = O< C;
style = styleNoTitle | ParamStyle("Style");
if(chartArt == "line"){
Plot( C, "Price", IIf(bedingungOpenNearClose, spezial_color, IIf( bedingungUp, line_color_up, line_color_down) ),style |styleThick | GetPriceStyle()); // |styleThick
}else if (chartArt == "bar"){
Plot( C, "Price", IIf( bedingungOpenNearClose, spezial_color, IIf( bedingungUp, bar_color_up, bar_color_down) ),style | GetPriceStyle());
}else if (chartArt == "candle"){
// bei CandleChart wird hiermit die FüllFarbe definiert
SetBarFillColor( IIf( bedingungUp, candle_color_up, candle_color_down) );
// Color definiert bei CandlChart den Rahmen
Plot( C, "Price", IIf (bedingungOpenNearClose, spezial_color, candle_rahmen ), style | GetPriceStyle());
}else{
// StandartChart
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
}
//-------------------------------------------------------------------------
//---- Indis --------------------------------------------------------------
_SECTION_BEGIN("Keltner Bands");
Periods = 15;
Width = 1.95;
Color = ParamColor( "Keltner", ColorRGB( 65, 65, 65 ) );
Style = styleNoLabel;
CenterLine = MA( C, Periods );
KTop = CenterLine + Width * ATR( Periods );
KBot = CenterLine - Width * ATR( Periods );
Plot( KTop, "", Color, Style);
Plot( KBot, "", Color, Style );
_SECTION_END();
_SECTION_BEGIN("GD_Bänder");
GD1 = 10;
GD2 = 10;
GD3 = 50;
GD4 = 100;
gd_color_1a = ParamColor( "GD1", ColorRGB( 0, 66, 85 ) );
gd_color_1b = ParamColor( "GD2", ColorRGB( 44, 44, 88 ) );
gd_color_2a = ParamColor( "GD3", ColorRGB( 0, 45, 45) );
gd_color_2b = ParamColor( "GD4", ColorRGB( 0, 45, 45) );
// Farbe am Rand des GD-Bandes
Plot( MA( C, GD1 ), "", ColorRGB( 50, 70, 70 ), styleLine|styleNoLabel );
Plot( EMA( C, GD4 ), "", ColorRGB( 0, 70, 70 ), styleLine|styleNoLabel );
Cloud_color_1 = IIf( MA( C, GD1 ) < EMA( C, GD2 ), gd_color_1a, gd_color_1b);
Cloud_color_2 = IIf( EMA( C, GD3 ) > EMA( C, GD4 ), gd_color_2a, gd_color_2b);
PlotOHLC( MA( C, GD1 ), MA( C, GD1 ), EMA( C, GD2 ), EMA( C, GD2 ), "", Cloud_color_1, styleCloud|styleNoLabel, Null, Null, Null, -8);
PlotOHLC( EMA( C, GD3 ), EMA( C, GD3 ),EMA( C, GD4 ), EMA( C, GD4 ), "", Cloud_color_2, styleCloud|styleNoLabel, Null, Null, Null, -9);
_SECTION_END();
//---ChartTypAbhängiges
if(chartArt == "line"){
// wenn LinienChart
_SECTION_BEGIN("High_Low_Line");
HighLine = H;
LowLine = L;
farbe_HL = ColorRGB( 65, 65, 65 );
Plot(HighLine, "", farbe_HL,styleLine|styleDashed|styleNoLabel); // styleStaircase
Plot(LowLine, "", farbe_HL,styleLine|styleDashed|styleNoLabel); // styleLine
_SECTION_END();
}
_SECTION_END();