ichimuko with candles for Amibroker (AFL)
_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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("Correct Ichimoku chart for Amibroker");
P1 = Param("Conversion Period", 9, 2, 200, 1, 0);
C1 = ParamColor("Conversion Color", colorRed);
CL = (HHV(H,P1)+LLV(L,P1))/2;
P2 = Param("Base Period", 26, 2, 200, 1, 0);
C2 = ParamColor("Base Color", colorBlue);
BL = (HHV(H,P2)+LLV(L,P2))/2;
C3 = ParamColor("Leading A Color", colorBrightGreen);
LSA = (CL+BL)/2;
P4 = Param("Leading B Span", 52, 2, 200, 1, 0);
C4 = ParamColor("Leading B Color", colorPink);
LSB = (HHV(H,P4)+LLV(L,P4))/2;
P3 = Param("Leading Span Displacement", 26, 2, 200, 1, 0);
P5 = Param("Lagging Displacement", -26, 2, 200, 1, 0);
C5 = ParamColor("Lagging Color", colorGreen);
Plot(CL,"Tenkan-sen (Conversion Line)", C1, styleLine);
Plot(BL, "Kijun-sen (Base Line)", C2, styleLine);
Plot(LSA, "Senkou Span A (Leading Span A)", C3, styleLine, 0, 0, P3);
Plot(LSB, "Senkou Span B (Leading Span B)", C4, styleLine, 0, 0, P3);
Plot(C, "Chikou Span (Lagging Span)", C5, styleLine, 0, 0, P5);
PlotOHLC (LSA,LSA,LSB,LSB,"Cloud",IIf(LSA>LSB,ColorBlend(C3, colorWhite, 0.6),
ColorBlend(C4,colorWhite, 0.4)),styleCloud, 0, 0, P3);
_SECTION_END();
Plot(C,"", colorWhite,styleCandle);
StartBar=SelectedValue(BarIndex());
FinishBar = EndValue( BarIndex() );
i = startbar;
period = FinishBar - StartBar;
Lo =LLV(L,period);
Hi = HHV(H,period);
Line0 = 0;
Line1 = 0;
Line2 = 0;
Line3 = 0;
Line4= 0;
Line100 = 0;
for( i = startbar; i < finishbar; i++ )
{
if(EndValue(C)<SelectedValue(C))
{
Line0 = EndValue(Lo);
Line100 = EndValue(Hi);
Line1 = Line0 + abs(Line100-Line0)*0.236;
Line2 = Line0 + abs(Line100-Line0)*0.382;
Line3 = Line0 + abs(Line100-Line0)*0.5;
Line4 = Line0 + abs(Line100-Line0)*0.618;
}
else
{
Line100 = EndValue(Lo);
Line0 = EndValue(Hi);
Line1 =Line0 - abs(Line100-Line0)*0.236;
Line2 = Line0 - abs(Line100-Line0)*0.382;
Line3 = Line0 - abs(Line100-Line0)*0.5;
Line4 = Line0 - abs(Line100-Line0)*0.618;
}
}
fib0= LineArray(startbar, Line0, finishbar, Line0, 0, 1);
fib100 = LineArray(startbar, Line100, finishbar, Line100, 0, 1);
n= round((finishbar-startbar)/2);
// middle lines
fib1= LineArray((finishbar-n), Line1, finishbar, Line1, 0, 1);
fib2= LineArray((finishbar-n), Line2, finishbar, Line2, 0, 1);
fib3= LineArray((finishbar-n), Line3, finishbar, Line3, 0, 1);
fib4= LineArray((finishbar-n), Line4, finishbar, Line4, 0, 1);
Plot(fib0,"", colorWhite);
Plot(fib100,"", colorRed);
Plot(fib1,"", colorGrey50);
Plot(fib2,"", colorGrey50);
Plot(fib3,"", colorOrange);
Plot(fib4,"", colorGrey50);
Title = Name() + " - FIB LEVELS ";
Want to know about this ichimuko and this application . . . . .
ReplyDelete