Tuesday, 22 October 2019

STANDARD PRICE CHART for Amibroker (AFL)


STANDARD PRICE CHART 



_SECTION_BEGIN("CandleStick");
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 ) ) ));

UpClose = Close - Ref(Close,-1);
Color = IIf(UpClose > 0, colorGreen, colorRed);
PlotOHLC(Open,High,Low,Close,"", Color, styleCandle);
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

_SECTION_END();


_SECTION_END();

_SECTION_BEGIN("BackgroundColor");
SetChartBkGradientFill(      ParamColor("Backgroud Top Color",
       colorBlack),ParamColor("Background Bottom Color",      colorBlack));
_SECTION_END();
Line1 = EndValue(Close); 




Color = colorYellow;
//Plot(Line,"",Color, styleDashed); 
Plot(Line1,"",Color, styleDashed); 


GraphXSpace=Param("GraphXSpace",10,0,100,1);
    dec = (Param("Decimals",2,0,7,1)/10)+1;
Title = EncodeColor(55)+  Title = Name() + "     " + EncodeColor(32) + Date() +
"      " + EncodeColor(5) + "{{INTERVAL}}  " +
    EncodeColor(55)+ "     Open = "+ EncodeColor(52)+ WriteVal(O,dec) +
    EncodeColor(55)+ "     High = "+ EncodeColor(5) + WriteVal(H,dec) +
    EncodeColor(55)+ "      Low = "+ EncodeColor(32)+ WriteVal(L,dec) +
    EncodeColor(55)+ "    Close = "+ EncodeColor(7)+ WriteVal(C,dec)+
    EncodeColor(55)+ "    Volume = "+ EncodeColor(11)+ WriteVal(V,1);

_SECTION_END();

_SECTION_BEGIN("MA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorWhite ), ParamStyle("Style",styleDashed) );
_SECTION_END();

No comments:

Post a Comment

Thanks