.

Modified Narrow Band System - Amibroker AFL Code

Click Image To Enlarge. Please Rate And Comment.

Modified Narrow Band System

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);

Plot( C, "Close", IIf(MACD(3,34) > Signal(3,34,9),colorGreen, colorRed), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("64 channel");

_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", Null ), styleNoTitle | styleCandle ); 

P = ParamField("Field");
Type = ParamList("Type", "Simple,Exponential,Double Exponential,Tripple Exponential,Wilders,Weighted");
//Periods = Param("Periods", 30, 2, 300 );
//Displacement = Param("Displacement", 4, -50, 50 );
//m = 0;

//if( Type == "Simple" ) 
A = MA( H,6 );
B = MA( L,6 );

      
x= Ref(A,-4);
y= Ref(B,-4);

D=.0003;

xb=x-x*D;

yt=y+y*D;

//PlotOHLC( 0,xt,xb,xb ,"",ColorRGB(200,0,0), styleCloud);
//PlotOHLC( 0,yt,yb,yb ,"",ColorRGB(0,200,0), styleCloud);
PlotOHLC( 0,x,xb,xb ,"",colorGold, styleCloud);
PlotOHLC( 0,yt,y,y ,"",colorGold, styleCloud);
PlotOHLC( 0,x,y,y ,"",ColorRGB(50,50,10), styleCloud);



_SECTION_END();

_SECTION_BEGIN("ribbon");

//_SECTION_BEGIN("10-70 OSCILLATOR");
A3 = MA(C,10);
B3 = MA(C,70);
D3 = A3-B3;

Colorm1=IIf(D3>Ref(D3,-1),colorBlue,colorRed);

A2 = MA(C,5);
B2 = MA(C,35);
D2 = A2-B2;

Colorm2=IIf(D2>Ref(D2,-1),colorBlue,colorRed);

A1 = MA(C,5);
B1 = MA(C,17);
D1 = A1-B1;

Colorm3=IIf(D1>Ref(D1,-1),colorBlue,colorRed);


Plot(3, "", Colorm3, styleOwnScale| styleArea|styleNoLabel,-0.5,100); 
Plot(6, "", Colorm2, styleOwnScale| styleArea|styleNoLabel,-0.5,100); 
Plot(9, "", Colorm1, styleOwnScale| styleArea|styleNoLabel,-0.5,100); 

_SECTION_END();


_SECTION_BEGIN("Fibo for all bars");

TimeFrameSet( in15Minute*2 ); 
DH=Ref(H,-1); 
DL=Ref(L,-1);
DC=Ref(C,-1);


pd = ( DH+ DL + DC )/3;
sd1 = (2*pd)-DH;
sd2 = pd -(DH - DL);
sd3 = Sd1 - (DH-DL); 
rd1 = (2*pd)-DL;
rd2 = pd +(DH -DL);
rd3 = rd1 +(DH-DL);



TimeFrameRestore();


Title = EncodeColor(colorWhite)+ "LINKON'S PIVOT TRADING SYSTEM" + " - " +  Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
 "  - " + Date() +" - "+"Op-"+O+"  "+"Hi-"+H+"  "+"Lo-"+L+"  "+ "Cl-"+C+"  "
+ WriteIf(C > pd, EncodeColor(colorGreen)+"stay long",EncodeColor(colorRed)+"stay SHORT") + "\n"
+ "Vol= "+ WriteVal(V) +WriteIf ( V > MA(V,26) ,EncodeColor(colorGreen)+"  UP "+ (V/MA(V,26))*100 + " %", EncodeColor(colorRed)+"  DOWN "+ (V/MA(V,26))*100 + " %")
+ EncodeColor(colorGreen)+   "\n R3 : "+ EncodeColor(colorWhite)+RD3
+ EncodeColor(colorGreen)+   "\n R2 : "+ EncodeColor(colorWhite)+RD2
+ EncodeColor(colorGreen)+   "\n R1 : "+ EncodeColor(colorWhite)+RD1
+ EncodeColor(colorBlue)+   "\n Pivot : "+ EncodeColor(colorWhite)+pd
+ EncodeColor(colorRed)+   "\n S1 : "+ EncodeColor(colorWhite)+SD1
+ EncodeColor(colorRed)+   "\n S2 : "+ EncodeColor(colorWhite)+SD2
+ EncodeColor(colorRed)+   "\n S3 : "+ EncodeColor(colorWhite)+SD3
;
Previous Post Next Post