tamamen ind bağlı
mesela örnek olarak inceleyiniz buy ve sell satırlarına dikkat
_SECTION_BEGIN("AuthorName");
k = (GetPerformanceCounter()/100)%100;
printf("GetPerformance Counter %g",k);
GfxSelectFont("arial",13,800);
GfxSetBkMode(1);
GfxSetTextColor(colorRed);
GfxTextOut("¿",-10+k,20);
RequestTimedRefresh(10);
_SECTION_END();
_SECTION_BEGIN("BACK COLR");
GfxSetOverlayMode(1);
GfxSetOverlayMode(1);
GfxSelectFont("Tahoma", Status("pxheight")/20 ); /* Up down name*/
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ParamColor("Text Color", ColorHSB( 42, 42, 42 ) ));
GfxSetBkMode(0); // transparent
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/7);
GfxSelectFont("Tahoma", Status("pxheight")/30 );
GfxTextOut( IndustryID(1), Status("pxwidth")/2, Status("pxheight")/5 ); /* Up Down Sector*/
GfxSelectFont("Tahoma", Status("pxheight")/40 );
GfxSelectFont("Tahoma", Status("pxheight")/20 );
_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();
_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods1 = Param("Periods1", 60, 2, 500, 1, 10 );
Periods2 = Param("Periods2", 360, 2, 500, 1, 10 );
Periods3 = Param("Periods3", 180, 2, 500, 1, 10 );
Periods4 = Param("Periods4", 270, 2, 500, 1, 10 );
Periods5 = Param("Periods5", 90, 2, 500, 1, 10 );
Plot( EMA( P, Periods1 ), StrFormat(_SECTION_NAME()+"(%g)", Periods1), ParamColor( "Color1", color**ua ), ParamStyle("Style") );
Plot( EMA( P, Periods2 ), StrFormat(_SECTION_NAME()+"(%g)", Periods2), ParamColor( "Color2", colorDarkBlue ), ParamStyle("Style") );
Plot( EMA( P, Periods3 ), StrFormat(_SECTION_NAME()+"(%g)", Periods3), ParamColor( "Color3", colorGreen ), ParamStyle("Style") );
Plot( EMA( P, Periods4 ), StrFormat(_SECTION_NAME()+"(%g)", Periods4), ParamColor( "Color4", colorPink ), ParamStyle("Style") );
Plot( EMA( P, Periods5 ), StrFormat(_SECTION_NAME()+"(%g)", Periods5), ParamColor( "Color5", colorYellow ), ParamStyle("Style") );
Buy = Cross( EMA( P, Periods4 ), EMA( P, Periods2 ) );
Sell = Cross(EMA( P,Periods2 ), EMA( P, Periods1 ) );
izleme= Cross(EMA( P,Periods1 ), EMA( P, Periods2 ) );
PlotShapes(IIf(Buy==1, shapeHollowUpArrow , shapeNone), colorGreen, 0,Low, Offset=-30);
PlotShapes(IIf(Sell==1, shapeHollowDownArrow, shapeNone), colorRed, 0,High, Offset=-30);
PlotShapes(IIf(izleme==1, shapeHollowUpArrow, shapeNone), colorBlue, 0,Low, Offset=-30);
COLOR=IIf(Buy,colorLime,IIf(Sell,colorRed,colorWhi te));
Plot(C,"",COLOR,styleCandle|styleThick);
PlotShapes( IIf( Buy, shapeUpTriangle, shapeNone ), colorGreen, layer = 0,yposition = L, offset = 70);
PlotShapes( IIf( Sell, shapeDownTriangle, shapeNone ), colorRed, layer = 0, yposition =H, offset = 70);
PlotShapes( IIf( izleme, shapeUpTriangle, shapeNone ), colorYellow, layer = 0, yposition =H, offset = 80);
PlotOHLC( Null,EMA( P, Periods4 ),EMA( P, Periods2 ),Null, "", IIf(EMA( P, Periods4 )>EMA( P, Periods2 ) ,colorGreen,colorWhite), styleCloud);
PlotOHLC( Null,EMA( P, Periods2 ),EMA( P, Periods1 ),Null, "", IIf(EMA( P, Periods2 )<EMA( P, Periods1 ) ,colorBlue,colorRed), styleCloud);
Color = IIf( EMA(p,periods1) > EMA(p,periods2) , colorLime, IIf( EMA(p,periods2) > EMA(p,periods1), colorRed, colorGrey40 ));
Plot( 2, "", Color, styleArea | styleOwnScale | styleNoLabel, -0.1, 30 );
_SECTION_END();
// Mehedi Arafat
//Candles or bars colored by trend
//identifying trends with EMA and MACD
Period = Optimize("Period", 17, 2, 200, 1);
EMACALC = EMA(C, Period);
cond1 = Close > EMACALC AND MACD() > Signal();
cond2 = Close > EMACALC AND MACD() < Signal() OR Close < EMACALC AND MACD() > Signal();
cond3 = Close < EMACALC AND MACD() < Signal();
_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 ) ) ));
SetBarFillColor(IIf(Cond1,ParamColor("Candle UP Color", colorGreen),IIf(Cond3,ParamColor("Candle Down Color", colorRed),colorYellow)));
Plot(C,"\nPrice",IIf(cond1,ParamColor("Wick UP Color", colorDarkGreen),IIf(cond3,ParamColor("Wick Down Color", colorDarkRed),colorYellow)),64,0,0,0,0);
//Plot( C, "Close", ParamColor("Color", colorgreen ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
//============== TITLE ==============
_SECTION_BEGIN("Title");
Title = EncodeColor(colorGold)+ "GRAFICO BASICO" + EncodeColor(colorRose)+" (" + Name() + ") " + EncodeColor(colorGold)+ Interval(2) +
" " + Date() +" " +" • Open "+WriteVal(O,1.20)+" • "+"High "+WriteVal(H,1.20)+" • "+"Low "+WriteVal(L,1.20)+" • "+
"Close "+WriteVal(C,1.20)+" • Variação R$ = " +WriteVal(C-Ref(C,-1),1.20,0)+" • Variação % = " +WriteVal((C-Ref(C,-1))*100/Ref(C,-1),1.2)+ "% • Volume = "+ WriteVal(V,1.0);
upbar = COND1;
downbar = COND3;
/* Colourized price bars drawn here */
Graph0 = Close;
Graph0Style = 64;//number 64 = candlestick or 128 = bar;
barcolor = IIf( downbar, 4, IIf( upbar, 5, 42 ) );//number 4 = red, number 5 = green and number 42 = yellow;
Graph0BarColor = ValueWhen( barcolor != 0, barcolor );
_SECTION_END();
Plot(EMACALC, "EMACALC", colorWhite, styleLine,0,0,0,0,2);