Main Chart
The Main Chart AFL in Amibroker serves as the primary charting tool, offering a comprehensive view of market data. Leveraging amibroker data feed functionalities enables traders to analyze price movements, trends, and patterns in real-time. This AFL provides a foundational framework for traders to conduct technical analysis and make trading decisions based on accurate and up-to-date market data.
/ //AFL made by karthikmarar. @ www.tatechnics.in _SECTION_BEGIN("MAMA"); SetBarsRequired( 1000, 1000 ); SetChartOptions(0,chartShowArrows|chartShowDates); prc = ( High + Low ) / 2; fastlimit = 0.5; slowlimit = 0.05; pi=4*atan(1); RTD=180/pi; DTR=pi/180; Cyclepart=Param("Alpha",0.5,0.1,1,0.1); Smooth[0] = Period = Detrender[0] = I1[0] = Q1[0] = 0; phase[0]=deltaphase[0]=MAMA[0]=FAMA[0]=0; for ( i = 6; i < BarCount; i++ ) { Smooth[i] = ( 4 * prc[i] + 3 * prc[i-1] + 2 * prc[i-2] + prc[i-3] ) / 10; AmpCorr[i] = 0.075 * Period[i-1] + 0.54; Detrender[i] = ( 0.0962 * Smooth[i] + 0.5769 * Smooth[i-2] - 0.5769 * Smooth[i-4] - 0.0962 * Smooth[i-6] ) * AmpCorr[i]; Q1[i] = ( 0.0962 * Detrender[i] + 0.5769 * Detrender[i-2] - 0.5769 * Detrender[i-4] - 0.0962 * Detrender[i-6] ) * AmpCorr[i]; I1[i] = Detrender[i-3]; if (I1[i] != 0) phase[i] = DTR*360/atan(q1[i]/I1[i]); deltaphase[i]=phase[i-1]-phase[i]; if (deltaphase[i] <1) deltaphase[i]=1; alpha[i]=fastlimit[i]/deltaphase[i]; if (alpha[i] < slowlimit[i]) alpha[i]=slowlimit[i]; MAMA[i]=alpha[i] * prc [i] +(1-alpha[i])*MAMA[i-1]; FAMA[i]=Cyclepart*alpha[i] * prc [i] +(1-Cyclepart*alpha[i])*FAMA[i-1]; } Plot( MAMA, "MAMA", colorTurquoise, styleLine|styleThick ); Plot( FAMA, "FAMA", colorYellow, styleLine|styleThick ); PlotOHLC(O,H,L,C,"MAMA",IIf(MAma>fama,colorLime,colorRed),styleBar|styleThick); Title = EncodeColor(colorWhite)+ "MAMA System" + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) + " - " + Date() +" - "+"\n" +EncodeColor(colorYellow) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+ "Cl-"+C+" "+ "Vol= "+ WriteVal(V,1); _SECTION_END();