دعاء الفرج{ اللهم كن لوليك الحجة بن الحسن صلواتك عليه وعلى آبائهِ في هذه الساعة وفي كل ساعة ولياً وحافظاً وقائداً وناصراً ودليلاً وعيناً حتى تسكنهُ أرضكَ طوعاً وتمتعهُ فيها طويلاً}
|
| | معادلات الايمي بركر | |
| | كاتب الموضوع | رسالة |
---|
الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: معادلات الايمي بركر الأربعاء يناير 13, 2010 7:40 am | |
| معادلة الاتجاه _SECTION_BEGIN("Trend Oscolleator"); period = Param("Period", 13, 1, 240, 1); mult = Param("Multiplier", 1.7, 1, 240, 0.1); f=ATR(period); VS[0] = Close[0]; trend[0] = 0; HighC[0]=0; Lowc[0]=0; for( i = period+1; i < BarCount; i++ ) { vs[i] = vs[i-1]; trend[i] = trend[i-1]; highC[i] = HighC[i-1]; lowc[i] = lowc[i-1]; if ((trend[i]>=0) && ( C[i] <VS[i] )) { trend[i] =-1; HighC[i] = C[i]; lowc[i] = C[i]; } if ((trend[i]<=0) && (C[i] >VS[i])) { trend[i]=1; HighC[i] = C[i]; lowc[i] = C[i]; } if (trend[i]==-1) { if (C[i]<lowc[i]) lowc[i] = C[i]; VS[i]= lowc[i]+ (mult*f[i]); } if (trend[i]==1) { if (C[i]>HighC[i]) HighC[i] = C[i]; VS[i]= HighC[i]-(mult*f[i]); } } Buy=Cross(Trend,0); Sell=Cross(0, Trend); Plot(Close,"Close",colorBlue,styleCandle); Plot(VS, "Vol Stop",IIf(trend==1,10,11 ),styleThick); mkol = IIf( Trend==1, 10, 11); Plot(5, "ribbon", mkol, styleOwnScale|styleArea|styleNoLabel, 0, -5); // Weekly trend shape = Buy * shapeUpArrow + Sell * shapeDownArrow; PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low-f, High+f)); _SECTION_END(); معادلة الفيبو مع الدعم والمقاومة _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); Plot (r1,"R1",12,1); Plot (r2,"R2",12,1); Plot (r3,"R3",12,1); Plot (s1,"S1",3,1); Plot (s2,"S2",3,1); Plot (s3,"S3",3,1); _SECTION_END(); //|------------------------------------------------------------------ //|Tradingbasis.com - Fibonacci Recognition //|Version:4.6 08-July-2006 //|Copyright 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> _SECTION_BEGIN("Main Parameters"); AddparamUsefromChart(1); Sensitivity = Param("Sensitivity",10,0,100,1); if(InChart)StaticVarSet("P0O3U2",Sensitivity);if(inAA AND Usefromchart) Sensitivity = StaticVarGet("P0O3U2"); Colorstyle = ParamToggle("Color Mode","S/R|Custom",1); Color_SL= ParamColor("Support (S/R Mode)",colorLime); Color_RL= ParamColor("Resistance (S/R Mode)",colorRed); _SECTION_END(); _SECTION_BEGIN("Levels"); L1_level = Param("Level 1",38.2,0,200,1); L2_level = Param("Level 2",50.0,0,200,1); L3_level = Param("Level 3",61.8,0,200,1); L4_level = Param("Level 4",138.2,0,200,1); L5_level = Param("Level 5",150,0,200,1); L6_level = Param("Level 6",161.8,0,200,1); L7_level = Param("Level 7",200,0,300,1); _SECTION_END(); _SECTION_BEGIN("Styles"); SwingLow_style = ParamStyle("Swing Low",styleLine+styleDots,maskAll); SwingHigh_style = ParamStyle("Swing High",styleLine+styleDots,maskAll); L1_style = ParamStyle("Level 1",styleLine+styleDashed,maskAll); L2_style = ParamStyle("Level 2",styleLine,maskAll); L3_style = ParamStyle("Level 3",styleLine+styleDashed,maskAll); L4_style = ParamStyle("Level 4",styleLine+styleDashed,maskAll); L5_style = ParamStyle("Level 5",styleLine,maskAll); L6_style = ParamStyle("Level 6",styleLine+styleDashed,maskAll); L7_style = ParamStyle("Level 7",styleLine+styleThick+styleDots,maskAll); _SECTION_END(); _SECTION_BEGIN("Colors"); SwingLow_color = ParamColor("Swing Low",colorLime); SwingHigh_color = ParamColor("Swing High",colorRed); L1_color = ParamColor("Level 1",colorTurquoise); L2_color = ParamColor("Level 2",colorYellow); L3_color = ParamColor("Level 3",colorTurquoise); L4_color = ParamColor("Level 4",colorTurquoise); L5_color = ParamColor("Level 5",colorBlue); L6_color = ParamColor("Level 6",colorTurquoise); L7_color = ParamColor("Level 7",colorGold); _SECTION_END(); _SECTION_BEGIN("Selection"); L1_switch = ParamToggle("Plot Level 1", "Off|On",1); L2_switch = ParamToggle("Plot Level 2", "Off|On",1); L3_switch = ParamToggle("Plot Level 3", "Off|On",1); L4_switch = ParamToggle("Plot Level 4", "Off|On",1); L5_switch = ParamToggle("Plot Level 5", "Off|On",1); L6_switch = ParamToggle("Plot Level 6", "Off|On",1); L7_switch = ParamToggle("Plot Level 7", "Off|On",1); _SECTION_END(); #include <\TBInc\Tradingbasis_1.afl> IV_periods = 50;//for IV Middle_price = L+((H-L)/2); IV = ((H/Middle_price)-1)*100; IV_AVG = MA(IV,IV_periods); ////////////////////////// per = LastValue(Sensitivity *LastValue(0.3*IV_AVG)); x=Cum(1); Range = 0.01; PS = TroughBars(L,per,1) == 0; xa = LastValue(ValueWhen(PS,x,1));//x from last trough Ya = LastValue(ValueWhen(PS,L,1));//y (Low) last trough PR = PeakBars(H,per,1) == 0; xb = LastValue(ValueWhen(PR,x,1));//x from last peak Yb = LastValue(ValueWhen(PR,H,1));//y (High) last peak //UP = upSwing DN = downSwing UP = xb>xa;//upSwing DN = xa>xb;//DownSwing SwingLow = IIf(UP,Ya,Yb); SwingHigh = IIf(UP,Yb,Ya); L1 = IIf(L1_switch,IIf(UP,yb-(yb-ya)*(L1_Level/100),IIf(DN,ya+(yb-ya)*(L1_Level/100),-1e10)),-1e10); L2 = IIf(L2_switch,IIf(UP,yb-(yb-ya)*(L2_Level/100),IIf(DN,ya+(yb-ya)*(L2_Level/100),-1e10)),-1e10); L3 = IIf(L3_switch,IIf(UP,yb-(yb-ya)*(L3_Level/100),IIf(DN,ya+(yb-ya)*(L3_Level/100),-1e10)),-1e10); L4 = IIf(L4_switch,IIf(UP,yb-(yb-ya)*(L4_Level/100),IIf(DN,ya+(yb-ya)*(L4_Level/100),-1e10)),-1e10); L5 = IIf(L5_switch,IIf(UP,yb-(yb-ya)*(L5_Level/100),IIf(DN,ya+(yb-ya)*(L5_Level/100),-1e10)),-1e10); L6 = IIf(L6_switch,IIf(UP,yb-(yb-ya)*(L6_Level/100),IIf(DN,ya+(yb-ya)*(L6_Level/100),-1e10)),-1e10); L7 = IIf(L7_switch,IIf(UP,yb-(yb-ya)*(L7_Level/100),IIf(DN,ya+(yb-ya)*(L7_Level/100),-1e10)),-1e10); CurrentRT_EXT = IIf(UP,-100*(yb-C)/(yb-ya),100*(C-ya)/(yb-ya));//Retracement_Value MaxRT_EXT = IIf(UP,-100*(yb-L)/(yb-ya),100*(H-ya)/(yb-ya));//Retracement_Value InZone = C<yb & C>ya;//filter to receive signals in a retracement zone. Distance = 0.5*ATR(14); Sup_break = Cross(Ya,C) & X>Xa; Sup_pricejustabove = L<Ya+Distance & L>Ya & X>Xa; Sup_confirmed = L<=Ya & C>Ya & X>Xa; Res_break = Cross(C,Yb) & X>Xb; Res_pricejustbelow = H>Yb-Distance & H<Yb & X>Xb; Res_confirmed = H>=Yb & C<Yb & X>Xb; SupSignals = Sup_break | Sup_pricejustabove | Sup_confirmed; ResSignals = Res_break | Res_pricejustbelow | Res_confirmed; BS = Sup_confirmed OR Res_break; SS = Res_confirmed OR Sup_break; Filter = BarIndex()==LastValue(BarIndex()) AND NOT GroupID()==253; Adddefaultcolumns(1,1); AddColumn(CurrentRT_EXT,"Current RT/EXT %"); AddColumn(MaxRT_EXT,"Current max. RT/EXT %"); AddTextColumn( WriteIf(Sup_pricejustabove,"Price just above", WriteIf(Sup_confirmed,"Confirmed", WriteIf(Sup_break,"Break",""))),"Swing Low",1.2, IIf(Sup_pricejustabove OR sup_confirmed,colorGreen,colorRed)); AddTextColumn( WriteIf(Res_pricejustbelow,"Price just below", WriteIf(Res_confirmed,"Confirmed", WriteIf(Res_break,"Break",""))),"Swing High",1.2, IIf(Res_pricejustbelow OR Res_confirmed,colorRed,colorGreen)); AddTextColumn(FullName(),"Full name"); //Anyline_zero AnZ= ya==0 OR yb==0 OR L1==0 OR L2==0 OR L3==0 OR L4==0 OR L5==0; xab = IIf(xb>xa,xb,xa); SLcol = IIf(Colorstyle,SwingLow_color,IIf( LastValue(C)<ya, Color_RL, Color_SL )); SHcol = IIf(Colorstyle,SwingHigh_color,IIf( LastValue(C)<yb, Color_RL, Color_SL )); Plot(IIf(x>=xa &NOT AnZ,ya,-1e10),"",SLcol,1+8 + 2048); Plot(IIf(x>=xb &NOT AnZ,yb,-1e10),"",SHcol,1+8 + 2048); L1col = IIf(Colorstyle,L1_color,IIf( LastValue(C)<L1, Color_RL, Color_SL )); L2col = IIf(Colorstyle,L2_color,IIf( LastValue(C)<L2, Color_RL, Color_SL )); L3col = IIf(Colorstyle,L3_color,IIf( LastValue(C)<L3, Color_RL, Color_SL )); L4col = IIf(Colorstyle,L4_color,IIf( LastValue(C)<L4, Color_RL, Color_SL )); L5col = IIf(Colorstyle,L5_color,IIf( LastValue(C)<L5, Color_RL, Color_SL )); L6col = IIf(Colorstyle,L6_color,IIf( LastValue(C)<L6, Color_RL, Color_SL )); L7col = IIf(Colorstyle,L7_color,IIf( LastValue(C)<L7, Color_RL, Color_SL )); Plot(IIf(x>=xab &NOT AnZ,L1,-1e10),"",L1col,L1_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L2,-1e10),"",L2col,L2_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L3,-1e10),"",L3col,L3_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L4,-1e10),"",L4col,L4_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L5,-1e10),"",L5col,L5_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L6,-1e10),"",L6col,L6_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L7,-1e10),"",L7col,L7_style+styleNoRescale); PlotText(""+L1_level+" %",LastValue(BarIndex()+2),L1,L1col,colorDefault); PlotText(""+L2_level+" %",LastValue(BarIndex()+2),L2,L2col,colorDefault); PlotText(""+L3_level+" %",LastValue(BarIndex()+2),L3,L3col,colorDefault); PlotText(""+L4_level+" %",LastValue(BarIndex()+2),L4,L4col,colorDefault); PlotText(""+L5_level+" %",LastValue(BarIndex()+2),L5,L5col,colorDefault); PlotText(""+L6_level+" %",LastValue(BarIndex()+2),L6,L6col,colorDefault); PlotText(""+L7_level+" %",LastValue(BarIndex()+2),L7,L7col,colorDefault); PlotText("100 %",LastValue(BarIndex()+2),SwingLow,IIf(LastValue(up),SwingLow_color,SwingHigh_color),colorDefault); PlotText("0 %",LastValue(BarIndex()+2),Swinghigh,IIf(LastValue(dn),SwingLow_color,SwingHigh_color),colorDefault); Title = "Tradingbasis.com - Fibonacci Recognition"+ default_title + EncodeColor(IIf(NOT AnZ,colorLightBlue,colorRed))+", Sensitivity = " + WriteVal(Sensitivity,1)+ EncodeColor(colorRed)+WriteIf(NOT AnZ,""," NO POINTS AVAILABLE -> REDUCE SENSITIVITY")+ EncodeColor(IIf(LastValue(L)>0,Color_SL,Color_RL))+", Current Correction = "+WriteVal(CurrentRT_EXT,1.0)+"% "; معادلة المؤشر اليباني //|------------------------------------------------------------------ //|Tradingbasis.com - Ichimoku Chart //|Version:1.0 04-April-2005 //|Copyright 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> AddAlertParam(0,0,0); _SECTION_BEGIN("Main Parameters"); p1 = Param("Turning Line",9,5,20,1);//also known as Kijun Sen p2 = Param("Standard Line",26,5,40,1);//also known as Tenkan Sen p3 = Param("Delayed Line",26,5,40,1);//also known as Chikou Span _SECTION_END(); _SECTION_BEGIN("Styles"); TLstyle = ParamStyle("Turning Line",styleThick); SLstyle = ParamStyle("Standard Line",styleThick); DLstyle = ParamStyle("Delayed Line",styleThick|styleNoTitle); _SECTION_END(); GraphZOrder = 0; AddICHIMOKU(p1,p2,p3); HSB = 0; if(HSB) { _SECTION_BEGIN("Cloud 1"); Hue = Param("Hue",90,0,255,1); Saturation = Param("Saturation",255,0,255,1); Brightness = Param("Brightness",60,0,255,1); Cloud1color = ColorHSB(Hue,Saturation,Brightness); _SECTION_END(); _SECTION_BEGIN("Cloud 2"); Hue = Param("Hue",0,0,255,1); Saturation = Param("Saturation",180,0,255,1); Brightness = Param("Brightness",125,0,255,1); Cloud2color = ColorHSB(Hue,Saturation,Brightness); _SECTION_END(); } else { _SECTION_BEGIN("Colors"); TLcolor = ParamColor("Turning Line",colorYellow); SLcolor = ParamColor("Standard Line",colorWhite); DLcolor = ParamColor("Delayed Line",colorGrey50); Cloud1color = ParamColor("Cloud 1",colorSeaGreen); Cloud2color = ParamColor("Cloud 2",colorBlue); } #include <\TBInc\Tradingbasis_1.afl> GraphZOrder = 0; Buy = Cross(SL,TL); Sell = Cross(TL,SL); AddAlert(Buy,Audio,Email,"Tenken crossed Kijun-Sen"+DefaultAlertText,1,BarComplete); AddAlert(Sell,Audio,Email,"Kijun-Sen crossed Tenkan"+DefaultAlertText,2,BarComplete); _SECTION_BEGIN("Lines"); Plot(TL, "SL", TLcolor,TLstyle); Plot(SL, "TL", SLcolor,SLstyle); Plot(DL, "DL", DLcolor,DLstyle); PlotOHLC( 0, span1, span2, span2, "Cloud", IIf(span1>span2,Cloud1color,Cloud2color), styleCloud+styleNoTitle+styleNoLabel ); _SECTION_END(); Filter = NOT GroupID()==253; Filter = Filter AND (Buy OR Sell); Adddefaultcolumns(2,1); AddTextColumn(FullName(),"Full name"); Title = "Tradingbasis.com - Ichimoku Chart" + default_title + " "; _SECTION_BEGIN("Wilders"); P = ParamField("Price field",-1); Periods = Param("Periods", 15, 2, 200, 1, 10 ); Plot( Wilders( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); مادلة الفراشة _SECTION_BEGIN("Chart Settings"); SetChartOptions(0,chartShowArrows|chartShowDates); SetChartBkColor(ParamColor("Outer Panel",1)); GraphXSpace=Param("GraphXSpace",10,0,100,1); dec = (Param("Decimals",2,0,7,1)/10)+1; bi = BarIndex(); Lbi = LastValue(BarIndex()); sbi = SelectedValue(bi); x1= BarCount-1; Plot(C,"",IIf(C>O,51,IIf(C<O,33,55)),64); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx _SECTION_BEGIN("SV X Pivots"); pct = Param( "Pivot %",0.18,0.10,60,0.01); plt = ParamToggle("Plot Zig ","Off|On",0); ppa = ParamToggle("Plot Pattern Lines","Off|On",1); plx = ParamToggle("Plot Time Lines","Off|On",1); Vsh= Param("Time Line V Shift",0.25,0,10,0.01); ptx = ParamToggle("Plot Text","Off|On",1); HiLb= Param("Hi Lookback",1,1,x1,1); LoLb= Param("Lo Lookback",1,0,x1,1); //============================== pk=PeakBars(H,pct)==0; tr=TroughBars(L,pct)==0; zHi=Zig(H,pct); zLo=Zig(L,pct); HLAvg=(zHi+zLo)/2; zp=IIf(pk,zHi,IIf(tr,zLo,IIf(HLAvg>Ref(HLAvg,-1),H,L))); za=Zig(zp,pct); pR=Ref(za,-1)<za AND za>Ref(za,1);//pk pS=Ref(za,-1)>za AND za<Ref(za,1);//tr //============================== if(plt==1)Plot(za,"ZIG",42,32|4096); //============================== //Support xs0 = SelectedValue(ValueWhen(PS,bi,LoLb)); xs1 = SelectedValue(ValueWhen(pS,bi,LoLb+1)); xs2 = SelectedValue(ValueWhen(pS,bi,LoLb+2)); xs3 = SelectedValue(ValueWhen(pS,bi,LoLb+3)); xs4 = SelectedValue(ValueWhen(pS,bi,LoLb+4)); ys0 = SelectedValue(ValueWhen(pS,L,LoLb)); ys1 = SelectedValue(ValueWhen(pS,L,LoLb+1)); ys2 = SelectedValue(ValueWhen(pS,L,LoLb+2)); ys3 = SelectedValue(ValueWhen(pS,L,LoLb+3)); ys4 = SelectedValue(ValueWhen(pS,L,LoLb+4)); //Resistance xr0 = SelectedValue(ValueWhen(pR,bi,HiLb)); xr1 = SelectedValue(ValueWhen(pR,bi,HiLb+1)); xr2 = SelectedValue(ValueWhen(pR,bi,HiLb+2)); xr3 = SelectedValue(ValueWhen(pR,bi,HiLb+3)); xr4 = SelectedValue(ValueWhen(pR,bi,HiLb+4)); yr0 = SelectedValue(ValueWhen(pR,H,HiLb)); yr1 = SelectedValue(ValueWhen(pR,H,HiLb+1)); yr2 = SelectedValue(ValueWhen(pR,H,HiLb+2)); yr3 = SelectedValue(ValueWhen(pR,H,HiLb+3)); yr4 = SelectedValue(ValueWhen(pR,H,HiLb+4)); Sup = xs0>xr0; Res = xr0>xs0; xsh = 50; xsbi = IIf(Res, xr0-xsh, xs0-xsh);//xstart za=Zig(zp,0.01); pR=Ref(za,-1)<za AND za>Ref(za,1);//pk pS=Ref(za,-1)>za AND za<Ref(za,1);//tr eLy = SelectedValue(ValueWhen(pS,L,0)); eHy = SelectedValue(ValueWhen(pR,H,0)); d1 = IIf(sup,ely,ehy); c1 = IIf(sup,ehy,ely); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx _SECTION_BEGIN("Patterns"); //Assign Letter to Pivots if(Res==1) { col= 40; colp= 32; va1= 0.30; va2= -0.30; Sx = xs4; Sy = ys4; Tx = xr4; Ty = yr4; Ux = xs3; Uy = ys3; Vx = xr3; Vy = yr3; Wx = xs2; Wy = ys2; Xx = xr2; Xy = yr2; Ax = xs1; Ay = ys1; Bx = xr1; By = yr1; Cx = xs0; Cy = ys0; Dx = xr0; Dy = yr0; } if(Sup==1) { col= 51; colp= 43; va1= -0.30; va2= 0.30; Sx = xr4; Sy = yr4; Tx = xs4; Ty = ys4; Ux = xr3; Uy = yr3; Vx = xs3; Vy = ys3; Wx = xr2; Wy = yr2; Xx = xs2; Xy = ys2; Ax = xr1; Ay = yr1; Bx = xs1; By = ys1; Cx = xr0; Cy = yr0; Dx = xs0; Dy = ys0; } //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //Calculate Hi Lo Retracements WX=(abs(xy-wy)/abs(wy-vy))*100; XA=abs(Xy-Ay)/abs(Xy-Wy)*100; AB=abs(By-Ay)/abs(Xy-Ay)*100; BC=abs(By-Cy)/abs(By-Ay)*100; CD=abs(Dy-Cy)/abs(By-Cy)*100; CE=(abs(Cy-c1)/abs(Cy-By))*100; DE=(abs(Dy-d1)/abs(Cy-Dy))*100; //Calculate Hi-Hi Lo-Lo Retracements XBi= abs(Xy-By)/(abs(Xy-Ay))*100; XBe= abs(By-Ay)/(abs(Xy-Ay))*100; XB = IIf(By>=Ay,XBe,XBi); XD=abs(Dy-Ay)/abs(Xy-Ay)*100; ACi=abs(Cy-Ay)/abs(By-Ay)*100; ACe=abs(By-Cy)/abs(By-Ay)*100; AC = IIf(Cy>=Ay,ACi,ACe); BDi=abs(Dy-By)/abs(By-Cy)*100; BDe=abs(Dy-Cy)/abs(By-Cy)*100; BD = IIf(Dy>=By,BDe,BDi); //Plot Labels and Retracements if(ptx==1) { PlotText(" S ",sx,sy + va2, col,1); PlotText(" T ",tx,ty + va1, col,1); PlotText(" U ",ux,uy + va2, col,1); PlotText(" V ",vx,vy + va1, col,1); PlotText(" W ",IIf(sup,xr2,xs2),wy + va2, col,1); PlotText(" X = "+NumToStr(WX,1.1)+" % ",xx,xy + va1, col,1); PlotText(" A = "+NumToStr(XA,1.1)+" % ",ax,ay + va2, col,1); PlotText(" B = "+NumToStr(AB,1.1)+" % ",bx,by + va1, col,1); PlotText(" C = "+NumToStr(BC,1.1)+" % ",cx,cy + va2, col,1); PlotText(" D = "+NumToStr(CD,1.1)+" % ",dx,dy + va1, colp,1); PlotText(" "+NumToStr(de,1.1)+"%",(dx+x1)/2,(dy+d1)/2,42,1); PlotText(" "+NumToStr(ce,1.1)+"%",(cx+x1)/2,(cy+c1)/2,42,1); PlotText(" "+NumToStr(XB,1.1)+" %",((xx+bx)/2)-2,(xy+by)/2, 40,1); PlotText(" "+NumToStr(XD,1.1)+" %",(xx+dx)/2,(xy+dy)/2, 34,1); PlotText(" "+NumToStr(AC,1.1)+" %",(ax+cx)/2-2,(ay+cy)/2, 10,1); PlotText(" "+NumToStr(BD,1.1)+" %",((bx+dx)/2)-2,(by+dy)/2, 10,1); } //Plot Hi-Hi Lo-Lo Lines if(ppa==1) { Plot(LineArray(dx,dy,x1,d1,0),"",42,32|4096); Plot(LineArray(cx,cy,x1,c1,0),"",42,32|4096); Plot(LineArray(sx,sy,ax,ay,1),"",35,41|4096|2048); Plot(LineArray(ux,uy,ax,ay,1),"",25,41|4096|2048); Plot(LineArray(bx,by,dx,dy,0),"",34,32|4096); Plot(LineArray(ax,ay,cx,cy,0),"",34,32|4096); Plot(LineArray(xx,xy,dx,dy,0),"",32,32|4096); Plot(LineArray(xx,xy,bx,by,0),"",32,32|4096); } //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //Count Bars Between Pivots xXA=xsbi+abs(ax-xx); xXB=xsbi+abs(bx-xx); xXC=xsbi+abs(cx-xx); xXD=xsbi+abs(dx-xx); xAB=xsbi+abs(bx-ax); xAC=xsbi+abs(cx-ax); xAD=xsbi+abs(dx-ax); xBC=xsbi+abs(cx-bx); xBD=xsbi+abs(dx-bx); xCD=xsbi+abs(dx-cx); //============================== if(plx==1) { bc=IIf(sup,sbi-xs0,sbi-xr0); tp=IIf(sup,ys0-Vsh,yr0+Vsh); if(Res==1) { col=42; Plot(bi==xCD, "", colorYellow, styleHistogram|styleOwnScale,0,1,xsh);//sample code if lines are preferred PlotText("XA\n | "+NumToStr(abs(xx-ax)-bc,1),xxa+xsh,tp,col,1); PlotText("XB\n | "+NumToStr(abs(bx-xx)-bc,1),xxb+xsh,tp,col,1); PlotText("XC\n | "+NumToStr(abs(cx-xx)-bc,1),xxc+xsh,tp,col,1); PlotText("XD\n | "+NumToStr(abs(xx-dx)-bc,1),xxd+xsh,tp,col,1); PlotText("AB\n | "+NumToStr(abs(bx-ax)-bc,1),xab+xsh,tp,col,1); PlotText("AC\n | "+NumToStr(abs(cx-ax)-bc,1),xac+xsh,tp,col,1); PlotText("AD\n | "+NumToStr(abs(dx-ax)-bc,1),xad+xsh,tp,col,1); PlotText("BC\n | "+NumToStr(abs(cx-bx)-bc,1),xbc+xsh,tp,col,1); PlotText("BD\n | "+NumToStr(abs(dx-bx)-bc,1),xbd+xsh,tp,col,1); PlotText("CD\n | "+NumToStr(abs(dx-cx)-bc,1),xcd+xsh,tp,col,1); } if(Sup==1) { col=34; Plot(bi==xCD, "", colorYellow, styleHistogram|styleOwnScale,0,1,xsh);//sample code if lines are preferred PlotText("| "+NumToStr(abs(xx-ax)-bc,1)+"\nXA",xxa+xsh,tp,col,1); PlotText("| "+NumToStr(abs(bx-xx)-bc,1)+"\nXB",xxb+xsh,tp,col,1); PlotText("| "+NumToStr(abs(cx-xx)-bc,1)+"\nXC",xxc+xsh,tp,col,1); PlotText("| "+NumToStr(abs(xx-dx)-bc,1)+"\nXD",xxd+xsh,tp,col,1); PlotText("| "+NumToStr(abs(bx-ax)-bc,1)+"\nAB",xab+xsh,tp,col,1); PlotText("| "+NumToStr(abs(cx-ax)-bc,1)+"\nAC",xac+xsh,tp,col,1); PlotText("| "+NumToStr(abs(dx-ax)-bc,1)+"\nAD",xad+xsh,tp,col,1); PlotText("| "+NumToStr(abs(cx-bx)-bc,1)+"\nBC",xbc+xsh,tp,col,1); PlotText("| "+NumToStr(abs(dx-bx)-bc,1)+"\nBD",xbd+xsh,tp,col,1); PlotText("| "+NumToStr(abs(dx-cx)-bc,1)+"\nCD",xcd+xsh,tp,col,1); } } //example of plotting line with start at a ****** point f50= ys0+(abs(yr0-ys0)*0.50); Plot(LineArray(xxb,f50,xxd,f50,0),"",29,32,0,0,xsh ); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 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(52)+ WriteVal(C,dec)+ EncodeColor(55)+ " Volume = "+ EncodeColor(52)+ WriteVal(V,1); مؤشر الذيب _SECTION_BEGIN("Elliot Wave"); SetChartOptions(1, chartShowDates); // put dates at bottom of chart pr = Param("Elliot Wave minimum % move", 2, 1, 100); // Beginner Elliot Wave stuff EWpk = PeakBars(H, pr, 1) == 0; EWtr = TroughBars(L, pr, 1) == 0; // Intermediate Elliot Wave stuff zz = Zig(C, pr); zzHi = Zig(H, pr); zzLo = Zig(L, pr); Avg = (zzHi+zzLo)/2; // Advanced Elliot Wave stuff RetroSuccessSecret = IIf(EWpk, zzHi, IIf(EWtr, zzLo, IIf(Avg > Ref(Avg,-1), H, L))); EW = Zig(RetroSuccessSecret, pr); // Plot on price chart Plot(C, "Close", colorBlack, styleCandle); Plot(EW, "EW", colorBlue, styleLine); // Plot buy and sell arrows Buy = TroughBars(EW, pr, 1) == 0; Sell = PeakBars(EW, pr, 1) ==0; Buy = ExRem(Buy, Sell); Sell = ExRem(Sell, Buy); PlotShapes( shapeUpArrow * Buy, colorGreen, 0, Low ); PlotShapes( shapeDownArrow * Sell, colorRed, 0, High ); _SECTION_END(); /* This a pretty basic codes, recently I made using Amibroker help file,I don't know whether you already have it! The codes can be added in any AFL for changing the Chart's background color every second. Again, I have added a Parameter code by which You can adjust the Brightness of the background from Parameters Window now. Regards.SkyBlue. */ معادلة التجاه مع الفيبووو _SECTION_BEGIN("Trend Oscolleator"); period = Param("Period", 13, 1, 240, 1); mult = Param("Multiplier", 1.7, 1, 240, 0.1); f=ATR(period); VS[0] = Close[0]; trend[0] = 0; HighC[0]=0; Lowc[0]=0; for( i = period+1; i < BarCount; i++ ) { vs[i] = vs[i-1]; trend[i] = trend[i-1]; highC[i] = HighC[i-1]; lowc[i] = lowc[i-1]; if ((trend[i]>=0) && ( C[i] <VS[i] )) { trend[i] =-1; HighC[i] = C[i]; lowc[i] = C[i]; } if ((trend[i]<=0) && (C[i] >VS[i])) { trend[i]=1; HighC[i] = C[i]; lowc[i] = C[i]; } if (trend[i]==-1) { if (C[i]<lowc[i]) lowc[i] = C[i]; VS[i]= lowc[i]+ (mult*f[i]); } if (trend[i]==1) { if (C[i]>HighC[i]) HighC[i] = C[i]; VS[i]= HighC[i]-(mult*f[i]); } } Buy=Cross(Trend,0); Sell=Cross(0, Trend); Plot(Close,"Close",colorBlue,styleCandle); Plot(VS, "Vol Stop",IIf(trend==1,10,11 ),styleThick); mkol = IIf( Trend==1, 10, 11); Plot(5, "ribbon", mkol, styleOwnScale|styleArea|styleNoLabel, 0, -5); // Weekly trend shape = Buy * shapeUpArrow + Sell * shapeDownArrow; PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low-f, High+f)); _SECTION_END(); //|------------------------------------------------------------------ //|Tradingbasis.com - Fibonacci Recognition //|Version:4.6 08-July-2006 //|Copyright 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> _SECTION_BEGIN("Main Parameters"); AddparamUsefromChart(1); Sensitivity = Param("Sensitivity",10,0,100,1); if(InChart)StaticVarSet("P0O3U2",Sensitivity);if(inAA AND Usefromchart) Sensitivity = StaticVarGet("P0O3U2"); Colorstyle = ParamToggle("Color Mode","S/R|Custom",1); Color_SL= ParamColor("Support (S/R Mode)",colorLime); Color_RL= ParamColor("Resistance (S/R Mode)",colorRed); _SECTION_END(); _SECTION_BEGIN("Levels"); L1_level = Param("Level 1",38.2,0,200,1); L2_level = Param("Level 2",50.0,0,200,1); L3_level = Param("Level 3",61.8,0,200,1); L4_level = Param("Level 4",138.2,0,200,1); L5_level = Param("Level 5",150,0,200,1); L6_level = Param("Level 6",161.8,0,200,1); L7_level = Param("Level 7",200,0,300,1); _SECTION_END(); _SECTION_BEGIN("Styles"); SwingLow_style = ParamStyle("Swing Low",styleLine+styleDots,maskAll); SwingHigh_style = ParamStyle("Swing High",styleLine+styleDots,maskAll); L1_style = ParamStyle("Level 1",styleLine+styleDashed,maskAll); L2_style = ParamStyle("Level 2",styleLine,maskAll); L3_style = ParamStyle("Level 3",styleLine+styleDashed,maskAll); L4_style = ParamStyle("Level 4",styleLine+styleDashed,maskAll); L5_style = ParamStyle("Level 5",styleLine,maskAll); L6_style = ParamStyle("Level 6",styleLine+styleDashed,maskAll); L7_style = ParamStyle("Level 7",styleLine+styleThick+styleDots,maskAll); _SECTION_END(); _SECTION_BEGIN("Colors"); SwingLow_color = ParamColor("Swing Low",colorLime); SwingHigh_color = ParamColor("Swing High",colorRed); L1_color = ParamColor("Level 1",colorTurquoise); L2_color = ParamColor("Level 2",colorYellow); L3_color = ParamColor("Level 3",colorTurquoise); L4_color = ParamColor("Level 4",colorTurquoise); L5_color = ParamColor("Level 5",colorBlue); L6_color = ParamColor("Level 6",colorTurquoise); L7_color = ParamColor("Level 7",colorGold); _SECTION_END(); _SECTION_BEGIN("Selection"); L1_switch = ParamToggle("Plot Level 1", "Off|On",1); L2_switch = ParamToggle("Plot Level 2", "Off|On",1); L3_switch = ParamToggle("Plot Level 3", "Off|On",1); L4_switch = ParamToggle("Plot Level 4", "Off|On",1); L5_switch = ParamToggle("Plot Level 5", "Off|On",1); L6_switch = ParamToggle("Plot Level 6", "Off|On",1); L7_switch = ParamToggle("Plot Level 7", "Off|On",1); _SECTION_END(); #include <\TBInc\Tradingbasis_1.afl> IV_periods = 50;//for IV Middle_price = L+((H-L)/2); IV = ((H/Middle_price)-1)*100; IV_AVG = MA(IV,IV_periods); ////////////////////////// per = LastValue(Sensitivity *LastValue(0.3*IV_AVG)); x=Cum(1); Range = 0.01; PS = TroughBars(L,per,1) == 0; xa = LastValue(ValueWhen(PS,x,1));//x from last trough Ya = LastValue(ValueWhen(PS,L,1));//y (Low) last trough PR = PeakBars(H,per,1) == 0; xb = LastValue(ValueWhen(PR,x,1));//x from last peak Yb = LastValue(ValueWhen(PR,H,1));//y (High) last peak //UP = upSwing DN = downSwing UP = xb>xa;//upSwing DN = xa>xb;//DownSwing SwingLow = IIf(UP,Ya,Yb); SwingHigh = IIf(UP,Yb,Ya); L1 = IIf(L1_switch,IIf(UP,yb-(yb-ya)*(L1_Level/100),IIf(DN,ya+(yb-ya)*(L1_Level/100),-1e10)),-1e10); L2 = IIf(L2_switch,IIf(UP,yb-(yb-ya)*(L2_Level/100),IIf(DN,ya+(yb-ya)*(L2_Level/100),-1e10)),-1e10); L3 = IIf(L3_switch,IIf(UP,yb-(yb-ya)*(L3_Level/100),IIf(DN,ya+(yb-ya)*(L3_Level/100),-1e10)),-1e10); L4 = IIf(L4_switch,IIf(UP,yb-(yb-ya)*(L4_Level/100),IIf(DN,ya+(yb-ya)*(L4_Level/100),-1e10)),-1e10); L5 = IIf(L5_switch,IIf(UP,yb-(yb-ya)*(L5_Level/100),IIf(DN,ya+(yb-ya)*(L5_Level/100),-1e10)),-1e10); L6 = IIf(L6_switch,IIf(UP,yb-(yb-ya)*(L6_Level/100),IIf(DN,ya+(yb-ya)*(L6_Level/100),-1e10)),-1e10); L7 = IIf(L7_switch,IIf(UP,yb-(yb-ya)*(L7_Level/100),IIf(DN,ya+(yb-ya)*(L7_Level/100),-1e10)),-1e10); CurrentRT_EXT = IIf(UP,-100*(yb-C)/(yb-ya),100*(C-ya)/(yb-ya));//Retracement_Value MaxRT_EXT = IIf(UP,-100*(yb-L)/(yb-ya),100*(H-ya)/(yb-ya));//Retracement_Value InZone = C<yb & C>ya;//filter to receive signals in a retracement zone. Distance = 0.5*ATR(14); Sup_break = Cross(Ya,C) & X>Xa; Sup_pricejustabove = L<Ya+Distance & L>Ya & X>Xa; Sup_confirmed = L<=Ya & C>Ya & X>Xa; Res_break = Cross(C,Yb) & X>Xb; Res_pricejustbelow = H>Yb-Distance & H<Yb & X>Xb; Res_confirmed = H>=Yb & C<Yb & X>Xb; SupSignals = Sup_break | Sup_pricejustabove | Sup_confirmed; ResSignals = Res_break | Res_pricejustbelow | Res_confirmed; BS = Sup_confirmed OR Res_break; SS = Res_confirmed OR Sup_break; Filter = BarIndex()==LastValue(BarIndex()) AND NOT GroupID()==253; Adddefaultcolumns(1,1); AddColumn(CurrentRT_EXT,"Current RT/EXT %"); AddColumn(MaxRT_EXT,"Current max. RT/EXT %"); AddTextColumn( WriteIf(Sup_pricejustabove,"Price just above", WriteIf(Sup_confirmed,"Confirmed", WriteIf(Sup_break,"Break",""))),"Swing Low",1.2, IIf(Sup_pricejustabove OR sup_confirmed,colorGreen,colorRed)); AddTextColumn( WriteIf(Res_pricejustbelow,"Price just below", WriteIf(Res_confirmed,"Confirmed", WriteIf(Res_break,"Break",""))),"Swing High",1.2, IIf(Res_pricejustbelow OR Res_confirmed,colorRed,colorGreen)); AddTextColumn(FullName(),"Full name"); //Anyline_zero AnZ= ya==0 OR yb==0 OR L1==0 OR L2==0 OR L3==0 OR L4==0 OR L5==0; xab = IIf(xb>xa,xb,xa); SLcol = IIf(Colorstyle,SwingLow_color,IIf( LastValue(C)<ya, Color_RL, Color_SL )); SHcol = IIf(Colorstyle,SwingHigh_color,IIf( LastValue(C)<yb, Color_RL, Color_SL )); Plot(IIf(x>=xa &NOT AnZ,ya,-1e10),"",SLcol,1+8 + 2048); Plot(IIf(x>=xb &NOT AnZ,yb,-1e10),"",SHcol,1+8 + 2048); L1col = IIf(Colorstyle,L1_color,IIf( LastValue(C)<L1, Color_RL, Color_SL )); L2col = IIf(Colorstyle,L2_color,IIf( LastValue(C)<L2, Color_RL, Color_SL )); L3col = IIf(Colorstyle,L3_color,IIf( LastValue(C)<L3, Color_RL, Color_SL )); L4col = IIf(Colorstyle,L4_color,IIf( LastValue(C)<L4, Color_RL, Color_SL )); L5col = IIf(Colorstyle,L5_color,IIf( LastValue(C)<L5, Color_RL, Color_SL )); L6col = IIf(Colorstyle,L6_color,IIf( LastValue(C)<L6, Color_RL, Color_SL )); L7col = IIf(Colorstyle,L7_color,IIf( LastValue(C)<L7, Color_RL, Color_SL )); Plot(IIf(x>=xab &NOT AnZ,L1,-1e10),"",L1col,L1_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L2,-1e10),"",L2col,L2_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L3,-1e10),"",L3col,L3_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L4,-1e10),"",L4col,L4_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L5,-1e10),"",L5col,L5_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L6,-1e10),"",L6col,L6_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L7,-1e10),"",L7col,L7_style+styleNoRescale); PlotText(""+L1_level+" %",LastValue(BarIndex()+2),L1,L1col,colorDefault); PlotText(""+L2_level+" %",LastValue(BarIndex()+2),L2,L2col,colorDefault); PlotText(""+L3_level+" %",LastValue(BarIndex()+2),L3,L3col,colorDefault); PlotText(""+L4_level+" %",LastValue(BarIndex()+2),L4,L4col,colorDefault); PlotText(""+L5_level+" %",LastValue(BarIndex()+2),L5,L5col,colorDefault); PlotText(""+L6_level+" %",LastValue(BarIndex()+2),L6,L6col,colorDefault); PlotText(""+L7_level+" %",LastValue(BarIndex()+2),L7,L7col,colorDefault); PlotText("100 %",LastValue(BarIndex()+2),SwingLow,IIf(LastValue(up),SwingLow_color,SwingHigh_color),colorDefault); PlotText("0 %",LastValue(BarIndex()+2),Swinghigh,IIf(LastValue(dn),SwingLow_color,SwingHigh_color),colorDefault); Title = "Tradingbasis.com - Fibonacci Recognition"+ default_title + EncodeColor(IIf(NOT AnZ,colorLightBlue,colorRed))+", Sensitivity = " + WriteVal(Sensitivity,1)+ EncodeColor(colorRed)+WriteIf(NOT AnZ,""," NO POINTS AVAILABLE -> REDUCE SENSITIVITY")+ EncodeColor(IIf(LastValue(L)>0,Color_SL,Color_RL))+", Current Correction = "+WriteVal(CurrentRT_EXT,1.0)+"% "; الماكد بالصوت _SECTION_BEGIN("MACD"); r1 = Param( "Fast avg", 12, 2, 200, 1 ); r2 = Param( "Slow avg", 26, 2, 200, 1 ); r3 = Param( "Signal avg", 9, 2, 200, 1 ); r1 = Optimize( "Fast avg", r1 , 2, 200, 1 ); r2 = Optimize( "Slow avg", r2 , 2, 200, 1 ); r3 = Optimize( "Signal avg", r3 , 2, 200, 1 ); Plot( ml = MACD(r1, r2), StrFormat(_SECTION_NAME()+"(%g,%g)", r1, r2), ParamColor("MACD color", colorRed ), ParamStyle("MACD style") ); Plot( sl = Signal(r1,r2,r3), "Signal" + _PARAM_VALUES(), ParamColor("Signal color", colorBlue ), ParamStyle("Signal style") ); Plot( ml-sl, "MACD Histogram", ParamColor("Histogram color", colorBlack ), styleNoTitle | ParamStyle("Histogram style", styleHistogram | styleNoLabel, maskHistogram ) ); Buy= Cross(ml , sl); Sell= Cross( sl, ml); PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) ); AlertIf( Buy , "SOUND C:\\Windows\\Media\\chimes.wav", "Audio alert", 2 ); AlertIf( Sell , "SOUND C:\\Windows\\Media\\alert.wav", "Audio alert", 2 ); _SECTION_END(); الارون مطور // Aroon Indicator // The Advisor october-8-2007 _SECTION_BEGIN("Aroon"); if( ParamToggle("Tooltip Shows", "Aroon|Prices" ) ) { ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 ))); } Aroonswitch = ParamToggle("Aroon","On,Off"); Periods = Param("Aroon Periods", 14, 1, 100, 1 ); _SECTION_END(); _SECTION_BEGIN("Aroon_UP"); UPcolor = ParamColor( "Aroon_UP Color", colorGreen ); UPstyle = ParamStyle("Aroon_UP Style",styleThick); _SECTION_END(); _SECTION_BEGIN("Aroon_DN"); DNcolor = ParamColor( "Aroon_DN Color", colorRed ); DNstyle = ParamStyle("Aroon_DN Style",styleThick); _SECTION_END(); _SECTION_BEGIN("Aroon_Oscillator"); OSswitch = ParamToggle("Aroon_OSc","On,Off"); OScolor = ParamColor( "Aroon_OSc Color", colorBlack ); OSstyle = ParamStyle("Aroon_OSc Style",styleHistogram | styleOwnScale, maskHistogram ); _SECTION_END(); HHVBarsSince = HHVBars(H, Periods+1); LLVBarsSince = LLVBars(L, Periods+1); Aroon_Up = ((Periods - HHVBarsSince) / Periods) * 100; Aroon_Down = ((Periods - LLVBarsSince) / Periods) * 100; Aroon_Osc = Aroon_Up - Aroon_Down; Plot(IIf(Aroonswitch,Null,Aroon_Up),"Aroon_Up",UPcolor,UPstyle); Plot(IIf(Aroonswitch,Null,Aroon_Down),"Aroon_Down",DNcolor,DNstyle); Plot(IIf(OSswitch,Null,Aroon_Osc),"Aroon_Osc",OScolor,OSstyle); UPline = Param("Upper Limit",80,50,100,1); DNline = Param("Down Limit",20,1,50,1); Plot(UPline,"",ParamColor("Upper Limit Color",4),ParamStyle("Upper Limit Style",styleNoLabel+styleDashed )); Plot(DNline,"",ParamColor("Down Limit Color",5),ParamStyle("Down Limit Style",styleNoLabel+styleDashed )); Plot(50,"",6, ParamStyle("Center Line Style",styleNoLabel )); _SECTION_BEGIN("Fill Color"); Fillswitch = ParamToggle("Fill Color1","On,Off"); r1 = Aroon_down; r2 = Aroon_Up; FillColor = IIf( r1 > 50 OR r2 < 50, ParamColor("Up Fill Color1", colorRose),ParamColor("Down Fill Color1", colorPaleGreen)); if (NOT Fillswitch) PlotOHLC( r1,r1,50,r1, "", FillColor, styleNoLabel | styleCloud | styleClipMinMax, DNline, UPline ); if (NOT Fillswitch) PlotOHLC( r2,r2,50,r2, "", FillColor, styleNoLabel | styleCloud | styleClipMinMax, DNline, UPline ); _SECTION_END(); // **************************************************************************************** // END OF CODE (ARRON.AFL) // **************************************************************************************** /**/ _SECTION_END(); Buy=Cross(Aroon_UP,Aroon_Down); Sell=Cross(Aroon_Down,Aroon_UP); PlotShapes(IIf(Buy,shapeUpArrow,shapeNone) ,colorGreen); PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: رد: معادلات الايمي بركر الثلاثاء فبراير 02, 2010 8:13 am | |
| معادلة الدعم والمقاومة
_SECTION_BEGIN("ÏÚã æãÞÇæãÉ"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 ));
/*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1);
Plot (p,"Pivot",25,1); Plot (r1,"R1",12,1); Plot (r2,"R2",12,1); Plot (r3,"R3",12,1); Plot (s1,"S1",3,1); Plot (s2,"S2",3,1); Plot (s3,"S3",3,1);
_SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: رد: معادلات الايمي بركر الثلاثاء فبراير 02, 2010 8:16 am | |
| معادلة الدعم والمقاومة متقدم
_SECTION_BEGIN("pivots mw"); /***************************************/ /*SUPER PIVOT POINTS ver 1.3 day week month by Avi b a /***************************************/ /* SUPER PIVOT POINTS can by used in 2 ways: if you choose daily, the pivots are calculated from the previous day, this can be used for daily charts. the second option is next day for EOD charts. for all the options available right click on the chart parameters. to utilize all the program features you need amibroker from version 4.80.1 and above. enjoy! */ /*-----------------data------------------*/ SetChartBkColor(16 ) ; k=IIf(ParamList("select type","daily|next day")=="daily",-1,0); k1=-1; TimeFrameSet(inDaily); day_h= LastValue(Ref(H,K)); day_l= LastValue(Ref(L,K)); day_c= LastValue(Ref(C,K)); TimeFrameRestore();
TimeFrameSet(inWeekly); Week_h= LastValue(Ref(H,K1)); Week_l= LastValue(Ref(L,K1));; Week_c= LastValue(Ref(C,K1));; TimeFrameRestore();
TimeFrameSet(inMonthly); month_h= LastValue(Ref(H,K1)); month_l= LastValue(Ref(L,K1)); month_c= LastValue(Ref(C,K1)); TimeFrameRestore();
/*--------------------------------------*/ // day DH=Day_h; DL=Day_L; DC=Day_C;
// DAY PIVOT Calculation 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);
// week WH=Week_h; WL=Week_l; WC=Week_c;
// WEEK PIVOT Calculation pw = ( WH+ WL + WC )/3; sw1 = (2*pw)-WH; sw2 = pw -(WH - WL); sw3 = Sw1 - (WH-WL); rw1 = (2*pw)-WL; rw2 = pw +(WH -WL); rw3 = rw1 +(WH-WL);
// month MH=month_h; ML=month_l; MC=month_c;
// MONTH PIVOT Calculation pm = ( MH+ ML + MC )/3; sm1 = (2*pm)-MH; sm2 = pm -(MH - ML); sm3 = Sm1 - (MH-ML); rm1 = (2*pm)-ML; rm2 = pm +(MH -ML); rm3 = rm1 +(MH-ML);
/*--------------------------------------*/ // PARAMETERS slide = Param("slide all",33,-1000,1000,1); slide1 = Param("slide_day",50,0,1000,1); slide2 = Param("slide_week",70,0,1000,1); slide3 = Param("slide_month",90,0,1000,1); slide_Hight = Param("slide_Hight",0,-1000,1000,1);
SHALD = ParamList("daily Pivots", "all|selected only|hide" ); SHALW = ParamList("weekly Pivots", "selected only|all|hide" ); SHALM = ParamList("monthly Pivots", "selected only|all|hide" );
//day PDP = ParamList("DP", "SHOW|HIDE" ); PDR1 = ParamList("DR1", "SHOW|HIDE" ); PDR2 = ParamList("DR2", "HIDE|SHOW" ); PDR3 = ParamList("DR3", "HIDE|SHOW" );
PDS1 = ParamList("DS1", "SHOW|HIDE" ); PDS2 = ParamList("DS2", "HIDE|SHOW" ); PDS3 = ParamList("DS3", "HIDE|SHOW" );
//week PWP = ParamList("WP", "SHOW|HIDE" ); PWR1 = ParamList("WR1", "SHOW|HIDE" ); PWR2 = ParamList("WR2", "HIDE|SHOW" ); PWR3 = ParamList("WR3", "HIDE|SHOW" );
PWS1 = ParamList("WS1", "SHOW|HIDE" ); PWS2 = ParamList("WS2", "HIDE|SHOW" ); PWS3 = ParamList("WS3", "HIDE|SHOW" );
//month PMP = ParamList("MP", "SHOW|HIDE" ); PMR1 = ParamList("MR1", "SHOW|HIDE" ); PMR2 = ParamList("MR2", "HIDE|SHOW" ); PMR3 = ParamList("MR3", "HIDE|SHOW" );
PMS1 = ParamList("MS1", "SHOW|HIDE" ); PMS2 = ParamList("MS2", "HIDE|SHOW" ); PMS3 = ParamList("MS3", "HIDE|SHOW" );
DayCOLOR = 34; weekCOLOR =10; monthCOLOR =42; /*--------------------------------------*/ // LABELS for( i = 0; i < BarCount; i++ ) { //day if(i+slide1== BarCount && (PDP=="SHOW" OR SHALD=="all") && SHALD!="hide") PlotText( "daily Pivot "+pd ,i+slide,pd+slide_Hight ,DayCOLOR); if(i+slide1== BarCount && (PDR1=="SHOW" OR SHALD=="all")&& SHALD!="hide") PlotText( "daily R1 "+rd1 ,i+slide,rd1+slide_Hight ,DayCOLOR ); if(i+slide1== BarCount && (PDR2=="SHOW" OR SHALD=="all")&& SHALD!="hide") PlotText( "daily R2 "+rd2 ,i+slide,rd2+slide_Hight ,DayCOLOR ); if(i+slide1== BarCount && (PDR3=="SHOW" OR SHALD=="all")&& SHALD!="hide") PlotText( "daily R3 "+rd3 ,i+slide,rd3+slide_Hight ,DayCOLOR );
if(i+slide1== BarCount && (PDS1=="SHOW" OR SHALD=="all")&& SHALD!="hide") PlotText( "daily S1 "+sd1 ,i+slide,sd1+slide_Hight ,DayCOLOR ); if(i+slide1== BarCount && (PDS2=="SHOW" OR SHALD=="all")&& SHALD!="hide") PlotText( "daily S2 "+sd2 ,i+slide,sd2+slide_Hight ,DayCOLOR ); if(i+slide1== BarCount && (PDS3=="SHOW" OR SHALD=="all")&& SHALD!="hide") PlotText( "daily S3 "+sd3 ,i+slide,sd3+slide_Hight ,DayCOLOR );
//week if(i+slide2== BarCount && (PWP=="SHOW" OR SHALW=="all")&& SHALW!="hide") PlotText( "weekly Pivot "+pw ,i+slide,pw+slide_Hight ,weekCOLOR ); if(i+slide2== BarCount && (PWR1=="SHOW" OR SHALW=="all")&& SHALW!="hide") PlotText( "weekly R1 "+rw1 ,i+slide,rw1+slide_Hight ,weekCOLOR ); if(i+slide2== BarCount && (PWR2=="SHOW" OR SHALW=="all")&& SHALW!="hide") PlotText( "weekly R2 "+rw2 ,i+slide,rw2+slide_Hight ,weekCOLOR ); if(i+slide2== BarCount && (PWR3=="SHOW" OR SHALW=="all")&& SHALW!="hide") PlotText( "weekly R3 "+rw3 ,i+slide,rw3+slide_Hight ,weekCOLOR );
if(i+slide2== BarCount && (PWS1=="SHOW" OR SHALW=="all")&& SHALW!="hide") PlotText( "weekly S1 "+sw1 ,i+slide,sw1+slide_Hight ,weekCOLOR ); if(i+slide2== BarCount && (PWS2=="SHOW" OR SHALW=="all")&& SHALW!="hide") PlotText( "weekly S2 "+sw2 ,i+slide,sw2+slide_Hight ,weekCOLOR ); if(i+slide2== BarCount && (PWS3=="SHOW" OR SHALW=="all")&& SHALW!="hide") PlotText( "weekly S3 "+sw3 ,i+slide,sw3+slide_Hight ,weekCOLOR ); //month if(i+slide3== BarCount && (PMP=="SHOW" OR SHALM=="all")&& SHALM!="hide") PlotText( "monthly Pivot "+pm ,i+slide,Pm+slide_Hight ,monthCOLOR ); if(i+slide3== BarCount && (PMR1=="SHOW" OR SHALM=="all")&& SHALM!="hide") PlotText( "monthly R1 "+rm1 ,i+slide,rm1+slide_Hight ,monthCOLOR ); if(i+slide3== BarCount && (PMR2=="SHOW" OR SHALM=="all")&& SHALM!="hide") PlotText( "monthly R2 "+rm2 ,i+slide,rm2+slide_Hight ,monthCOLOR ); if(i+slide3== BarCount && (PMR3=="SHOW" OR SHALM=="all")&& SHALM!="hide") PlotText( "monthly R3 "+rm3 ,i+slide,rm3+slide_Hight ,monthCOLOR );
if(i+slide3== BarCount && (PMS1=="SHOW" OR SHALM=="all")&& SHALM!="hide")PlotText( "monthly S1 "+sm1 ,i+slide,sm1+slide_Hight ,monthCOLOR); if(i+slide3== BarCount && (PMS2=="SHOW" OR SHALM=="all")&& SHALM!="hide") PlotText( "monthly S2 "+sm2 ,i+slide,sm2+slide_Hight ,monthCOLOR ); if(i+slide3== BarCount && (PMS3=="SHOW" OR SHALM=="all")&& SHALM!="hide") PlotText( "monthly S3 "+sm3 ,i+slide,sm3+slide_Hight ,monthCOLOR ); } /*--------------------------------------*/ // PLOTS style = IIf(ParamList("Chart style", "styleCandle|styleBar")=="styleCandle",64,128); Plot (C,Date ()+" close",11,style); //day if ((PDP=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (pd,"daily Pivot ",DayCOLOR,1); if ((PDR1=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd1,"daily R1 ",DayCOLOR,32); if ((PDR2=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd2,"daily R2 ",DayCOLOR,32); if ((PDR3=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (rd3,"daily R3 ",DayCOLOR,32);
if ((PDS1=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (sd1,"daily S1 ",DayCOLOR,32); if ((PDS2=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (Sd2,"daily S2 ",DayCOLOR,32); if ((PDS3=="SHOW" OR SHALD=="all") && SHALD!="hide") Plot (Sd3,"daily S3 ",DayCOLOR,32);
//week if ((PWP=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (pW,"weekly Pivot ",weekCOLOR,1); if ((PWR1=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw1,"weekly R1 ",weekCOLOR,32); if ((PWR2=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw2,"weekly R2 ",weekCOLOR,32); if ((PWR3=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (rw3,"weekly R3 ",weekCOLOR,32);
if ((PWS1=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (sw1,"weekly S1 ",weekCOLOR,32); if ((PWS2=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (Sw2,"weekly S2 ",weekCOLOR,32); if ((PWS3=="SHOW" OR SHALW=="all") && SHALW!="hide") Plot (Sw3,"weekly S3 ",weekCOLOR,32);
//month if ((PMP=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (pm,"monthly Pivot",monthCOLOR ,1); if ((PMR1=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm1,"monthly R1",monthCOLOR ,32); if ((PMR2=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm2,"monthly R2",monthCOLOR ,32); if ((PMR3=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (rm3,"monthly R3",monthCOLOR ,32);
if ((PMS1=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm1,"monthly S1",monthCOLOR ,32); if ((PMS2=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm2,"monthly S2",monthCOLOR ,32); if ((PMS3=="SHOW" OR SHALM=="all") && SHALM!="hide") Plot (sm3,"monthly S3",monthCOLOR ,32); /*--------------------------------------*/ // TEXT "high = "+H; "low = "+L; "close = "+C; _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: رد: معادلات الايمي بركر الإثنين مارس 08, 2010 5:48 am | |
| معادلة شبيه د جوووووو مع الفيبو والدعم المتقدم _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); // ==================Plot the Linear Regression Line ========================================================== LRColor = ParamColor("LR Color", colorCycle ); LRStyle = ParamStyle("LR Style"); LRLine = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y, Null ); Plot( LRLine , "LinReg", LRCOLOR, LRSTYLE ); // styleDots ); // ========================== Plot 1st SD Channel =============================================================== SDP = Param("Standard Deviation", 1.5, 0, 6, 0.1); SD = SDP/2; width = LastValue( Ref(SD*StDev(p, Daysback),-shift) ); // THIS IS WHERE THE WIDTH OF THE CHANELS IS SET SDU = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y+width , Null ) ; SDL = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y-width , Null ) ; SDColor = ParamColor("SD Color", colorCycle ); SDStyle = ParamStyle("SD Style"); Plot( SDU , "Upper Lin Reg", SDColor,SDStyle ); Plot( SDL , "Lower Lin Reg", SDColor,SDStyle ); // ========================== Plot 2d SD Channel =============================================================== SDP2 = Param("2d Standard Deviation", 2.0, 0, 6, 0.1); SD2 = SDP2/2; width2 = LastValue( Ref(SD2*StDev(p, Daysback),-shift) ); // THIS IS WHERE THE WIDTH OF THE CHANELS IS SET SDU2 = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y+width2 , Null ) ; SDL2 = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y-width2 , Null ) ; SDColor2 = ParamColor("2 SD Color", colorCycle ); SDStyle2 = ParamStyle("2 SD Style"); Plot( SDU2 , "Upper Lin Reg", SDColor2,SDStyle2 ); Plot( SDL2 , "Lower Lin Reg", SDColor2,SDStyle2 ); // ============================ End Indicator Code ============================================================== _SECTION_END(); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); Plot (r1,"R1",12,1); Plot (r2,"R2",12,1); Plot (r3,"R3",12,1); Plot (s1,"S1",3,1); Plot (s2,"S2",3,1); Plot (s3,"S3",3,1); _SECTION_END(); //|------------------------------------------------------------------ //|Tradingbasis.com - Fibonacci Recognition //|Version:4.6 08-July-2006 //|Copyright 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> _SECTION_BEGIN("Main Parameters"); AddparamUsefromChart(1); Sensitivity = Param("Sensitivity",10,0,100,1); if(InChart)StaticVarSet("P0O3U2",Sensitivity);if(inAA AND Usefromchart) Sensitivity = StaticVarGet("P0O3U2"); Colorstyle = ParamToggle("Color Mode","S/R|Custom",1); Color_SL= ParamColor("Support (S/R Mode)",colorLime); Color_RL= ParamColor("Resistance (S/R Mode)",colorRed); _SECTION_END(); _SECTION_BEGIN("Levels"); L1_level = Param("Level 1",38.2,0,200,1); L2_level = Param("Level 2",50.0,0,200,1); L3_level = Param("Level 3",61.8,0,200,1); L4_level = Param("Level 4",138.2,0,200,1); L5_level = Param("Level 5",150,0,200,1); L6_level = Param("Level 6",161.8,0,200,1); L7_level = Param("Level 7",200,0,300,1); _SECTION_END(); _SECTION_BEGIN("Styles"); SwingLow_style = ParamStyle("Swing Low",styleLine+styleDots,maskAll); SwingHigh_style = ParamStyle("Swing High",styleLine+styleDots,maskAll); L1_style = ParamStyle("Level 1",styleLine+styleDashed,maskAll); L2_style = ParamStyle("Level 2",styleLine,maskAll); L3_style = ParamStyle("Level 3",styleLine+styleDashed,maskAll); L4_style = ParamStyle("Level 4",styleLine+styleDashed,maskAll); L5_style = ParamStyle("Level 5",styleLine,maskAll); L6_style = ParamStyle("Level 6",styleLine+styleDashed,maskAll); L7_style = ParamStyle("Level 7",styleLine+styleThick+styleDots,maskAll); _SECTION_END(); _SECTION_BEGIN("Colors"); SwingLow_color = ParamColor("Swing Low",colorLime); SwingHigh_color = ParamColor("Swing High",colorRed); L1_color = ParamColor("Level 1",colorTurquoise); L2_color = ParamColor("Level 2",colorYellow); L3_color = ParamColor("Level 3",colorTurquoise); L4_color = ParamColor("Level 4",colorTurquoise); L5_color = ParamColor("Level 5",colorBlue); L6_color = ParamColor("Level 6",colorTurquoise); L7_color = ParamColor("Level 7",colorGold); _SECTION_END(); _SECTION_BEGIN("Selection"); L1_switch = ParamToggle("Plot Level 1", "Off|On",1); L2_switch = ParamToggle("Plot Level 2", "Off|On",1); L3_switch = ParamToggle("Plot Level 3", "Off|On",1); L4_switch = ParamToggle("Plot Level 4", "Off|On",1); L5_switch = ParamToggle("Plot Level 5", "Off|On",1); L6_switch = ParamToggle("Plot Level 6", "Off|On",1); L7_switch = ParamToggle("Plot Level 7", "Off|On",1); _SECTION_END(); #include <\TBInc\Tradingbasis_1.afl> IV_periods = 50;//for IV Middle_price = L+((H-L)/2); IV = ((H/Middle_price)-1)*100; IV_AVG = MA(IV,IV_periods); ////////////////////////// per = LastValue(Sensitivity *LastValue(0.3*IV_AVG)); x=Cum(1); Range = 0.01; PS = TroughBars(L,per,1) == 0; xa = LastValue(ValueWhen(PS,x,1));//x from last trough Ya = LastValue(ValueWhen(PS,L,1));//y (Low) last trough PR = PeakBars(H,per,1) == 0; xb = LastValue(ValueWhen(PR,x,1));//x from last peak Yb = LastValue(ValueWhen(PR,H,1));//y (High) last peak //UP = upSwing DN = downSwing UP = xb>xa;//upSwing DN = xa>xb;//DownSwing SwingLow = IIf(UP,Ya,Yb); SwingHigh = IIf(UP,Yb,Ya); L1 = IIf(L1_switch,IIf(UP,yb-(yb-ya)*(L1_Level/100),IIf(DN,ya+(yb-ya)*(L1_Level/100),-1e10)),-1e10); L2 = IIf(L2_switch,IIf(UP,yb-(yb-ya)*(L2_Level/100),IIf(DN,ya+(yb-ya)*(L2_Level/100),-1e10)),-1e10); L3 = IIf(L3_switch,IIf(UP,yb-(yb-ya)*(L3_Level/100),IIf(DN,ya+(yb-ya)*(L3_Level/100),-1e10)),-1e10); L4 = IIf(L4_switch,IIf(UP,yb-(yb-ya)*(L4_Level/100),IIf(DN,ya+(yb-ya)*(L4_Level/100),-1e10)),-1e10); L5 = IIf(L5_switch,IIf(UP,yb-(yb-ya)*(L5_Level/100),IIf(DN,ya+(yb-ya)*(L5_Level/100),-1e10)),-1e10); L6 = IIf(L6_switch,IIf(UP,yb-(yb-ya)*(L6_Level/100),IIf(DN,ya+(yb-ya)*(L6_Level/100),-1e10)),-1e10); L7 = IIf(L7_switch,IIf(UP,yb-(yb-ya)*(L7_Level/100),IIf(DN,ya+(yb-ya)*(L7_Level/100),-1e10)),-1e10); CurrentRT_EXT = IIf(UP,-100*(yb-C)/(yb-ya),100*(C-ya)/(yb-ya));//Retracement_Value MaxRT_EXT = IIf(UP,-100*(yb-L)/(yb-ya),100*(H-ya)/(yb-ya));//Retracement_Value InZone = C<yb & C>ya;//filter to receive signals in a retracement zone. Distance = 0.5*ATR(14); Sup_break = Cross(Ya,C) & X>Xa; Sup_pricejustabove = L<Ya+Distance & L>Ya & X>Xa; Sup_confirmed = L<=Ya & C>Ya & X>Xa; Res_break = Cross(C,Yb) & X>Xb; Res_pricejustbelow = H>Yb-Distance & H<Yb & X>Xb; Res_confirmed = H>=Yb & C<Yb & X>Xb; SupSignals = Sup_break | Sup_pricejustabove | Sup_confirmed; ResSignals = Res_break | Res_pricejustbelow | Res_confirmed; BS = Sup_confirmed OR Res_break; SS = Res_confirmed OR Sup_break; Filter = BarIndex()==LastValue(BarIndex()) AND NOT GroupID()==253; Adddefaultcolumns(1,1); AddColumn(CurrentRT_EXT,"Current RT/EXT %"); AddColumn(MaxRT_EXT,"Current max. RT/EXT %"); AddTextColumn( WriteIf(Sup_pricejustabove,"Price just above", WriteIf(Sup_confirmed,"Confirmed", WriteIf(Sup_break,"Break",""))),"Swing Low",1.2, IIf(Sup_pricejustabove OR sup_confirmed,colorGreen,colorRed)); AddTextColumn( WriteIf(Res_pricejustbelow,"Price just below", WriteIf(Res_confirmed,"Confirmed", WriteIf(Res_break,"Break",""))),"Swing High",1.2, IIf(Res_pricejustbelow OR Res_confirmed,colorRed,colorGreen)); AddTextColumn(FullName(),"Full name"); //Anyline_zero AnZ= ya==0 OR yb==0 OR L1==0 OR L2==0 OR L3==0 OR L4==0 OR L5==0; xab = IIf(xb>xa,xb,xa); SLcol = IIf(Colorstyle,SwingLow_color,IIf( LastValue(C)<ya, Color_RL, Color_SL )); SHcol = IIf(Colorstyle,SwingHigh_color,IIf( LastValue(C)<yb, Color_RL, Color_SL )); Plot(IIf(x>=xa &NOT AnZ,ya,-1e10),"",SLcol,1+8 + 2048); Plot(IIf(x>=xb &NOT AnZ,yb,-1e10),"",SHcol,1+8 + 2048); L1col = IIf(Colorstyle,L1_color,IIf( LastValue(C)<L1, Color_RL, Color_SL )); L2col = IIf(Colorstyle,L2_color,IIf( LastValue(C)<L2, Color_RL, Color_SL )); L3col = IIf(Colorstyle,L3_color,IIf( LastValue(C)<L3, Color_RL, Color_SL )); L4col = IIf(Colorstyle,L4_color,IIf( LastValue(C)<L4, Color_RL, Color_SL )); L5col = IIf(Colorstyle,L5_color,IIf( LastValue(C)<L5, Color_RL, Color_SL )); L6col = IIf(Colorstyle,L6_color,IIf( LastValue(C)<L6, Color_RL, Color_SL )); L7col = IIf(Colorstyle,L7_color,IIf( LastValue(C)<L7, Color_RL, Color_SL )); Plot(IIf(x>=xab &NOT AnZ,L1,-1e10),"",L1col,L1_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L2,-1e10),"",L2col,L2_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L3,-1e10),"",L3col,L3_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L4,-1e10),"",L4col,L4_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L5,-1e10),"",L5col,L5_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L6,-1e10),"",L6col,L6_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L7,-1e10),"",L7col,L7_style+styleNoRescale); PlotText(""+L1_level+" %",LastValue(BarIndex()+2),L1,L1col,colorDefault); PlotText(""+L2_level+" %",LastValue(BarIndex()+2),L2,L2col,colorDefault); PlotText(""+L3_level+" %",LastValue(BarIndex()+2),L3,L3col,colorDefault); PlotText(""+L4_level+" %",LastValue(BarIndex()+2),L4,L4col,colorDefault); PlotText(""+L5_level+" %",LastValue(BarIndex()+2),L5,L5col,colorDefault); PlotText(""+L6_level+" %",LastValue(BarIndex()+2),L6,L6col,colorDefault); PlotText(""+L7_level+" %",LastValue(BarIndex()+2),L7,L7col,colorDefault); PlotText("100 %",LastValue(BarIndex()+2),SwingLow,IIf(LastValue(up),SwingLow_color,SwingHigh_color),colorDefault); PlotText("0 %",LastValue(BarIndex()+2),Swinghigh,IIf(LastValue(dn),SwingLow_color,SwingHigh_color),colorDefault); Title = "Tradingbasis.com - Fibonacci Recognition"+ default_title + EncodeColor(IIf(NOT AnZ,colorLightBlue,colorRed))+", Sensitivity = " + WriteVal(Sensitivity,1)+ EncodeColor(colorRed)+WriteIf(NOT AnZ,""," NO POINTS AVAILABLE -> REDUCE SENSITIVITY")+ EncodeColor(IIf(LastValue(L)>0,Color_SL,Color_RL))+", Current Correction = "+WriteVal(CurrentRT_EXT,1.0)+"% "; معادلة مؤشر نادر يعطي تقاطع دخول _SECTION_BEGIN("ãÄÔÑ äÇÏÑ ZERO LAG"); /*ZeroLag W%R*/ "========"; GraphXSpace = 3; R = ((HHV(H,14) - C) /(HHV (H,14) -LLV (L,14))) *-100; MaxGraph=10; Period= 10; EMA1= EMA(R,Period); EMA2= EMA(EMA1,5); Difference= EMA1 - EMA2; ZeroLagEMA= EMA1 + Difference; PR=100-abs(ZeroLagEMA); Graph0=PR; MoveAvg=MA(PR,5); Graph1=MoveAvg; Graph1Color=colorTan; Graph0Style=4; upbar= PR>= MoveAvg AND PR>= Ref(PR,-1) ; downbar=(PR < MoveAvg) OR PR>= MoveAvg AND PR< Ref(PR,-1) ; barcolor = IIf( downbar,colorRed, IIf( upbar, colorBrightGreen, 7)); Graph0BarColor = ValueWhen( barcolor != 0, barcolor ); Graph2=30; Graph3=70; Graph2Style=Graph3Style=Graph4Style=1; Graph4Color=2; Graph2Color=5; Graph3Color=4; Graph5=0; Graph6=100; Graph5Style=Graph6Style=1; Graph5Color=Graph6Color=2; Title=Name()+" < ZeroLag W%R :"+WriteVal(PR)+"%"; Buy = Cross(PR,moveAvg) AND PR<35; Sell = Cross(moveAvg,PR) AND PR>75; PlotShapes(Buy*shapeUpArrow,colorLime,0,Graph0); PlotShapes(Sell*shapeDownArrow,colorRed,0,Graph0); _SECTION_END(); _SECTION_END(); معادلة دعم ومقاومة متقدم _SECTION_BEGIN("ÏÚã æãÞÇæãÉ"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); Plot (r1,"R1",12,1); Plot (r2,"R2",12,1); Plot (r3,"R3",12,1); Plot (s1,"S1",3,1); Plot (s2,"S2",3,1); Plot (s3,"S3",3,1); _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر علي الذهبي الخميس أبريل 22, 2010 6:39 am | |
| _SECTION_BEGIN("Triangular "); //------------------------------------------------------------------------------ // // Formula Name: Triangular Moving Average // Author/Uploader: Anthony Faragasso // E-mail: ajf1111@epix.net// Date/Time Added: 2002-12-14 11:47:32 // Origin: // Keywords: Moving Average // Level: basic // Flags: indicator // Formula URL: http://www.amibroker.com/library/formula.php?id=240// Details URL: http://www.amibroker.com/library/detail.php?id=240// //------------------------------------------------------------------------------ // // A Triangular moving average is similar to exponential and // // weighted moving averages except a different weighting scheme // // is used. Exponential and Weighted averages assign the majority // // of the weight to the most recent data. Simple moving averages // // assign the weight equally across all the data. With a Triangular // // moving average, the majority of the weight is assigned to the middle // // portion of the data. // //------------------------------------------------------------------------------ //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); // ==================Plot the Linear Regression Line ========================================================== LRColor = ParamColor("LR Color", colorCycle ); LRStyle = ParamStyle("LR Style"); LRLine = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y, Null ); Plot( LRLine , "LinReg", LRCOLOR, LRSTYLE ); // styleDots ); // ========================== Plot 1st SD Channel =============================================================== _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); Plot (r1,"R1",12,1); Plot (r2,"R2",12,1); Plot (r3,"R3",12,1); Plot (s1,"S1",3,1); Plot (s2,"S2",3,1); Plot (s3,"S3",3,1); _SECTION_END(); //|------------------------------------------------------------------ //|Tradingbasis.com - Fibonacci Recognition //|Version:4.6 08-July-2006 //|Copyright 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> _SECTION_BEGIN("Main Parameters"); AddparamUsefromChart(1); Sensitivity = Param("Sensitivity",10,0,100,1); if(InChart)StaticVarSet("P0O3U2",Sensitivity);if(inAA AND Usefromchart) Sensitivity = StaticVarGet("P0O3U2"); Colorstyle = ParamToggle("Color Mode","S/R|Custom",1); Color_SL= ParamColor("Support (S/R Mode)",colorLime); Color_RL= ParamColor("Resistance (S/R Mode)",colorRed); _SECTION_END(); _SECTION_BEGIN("Levels"); L1_level = Param("Level 1",38.2,0,200,1); L2_level = Param("Level 2",50.0,0,200,1); L3_level = Param("Level 3",61.8,0,200,1); L4_level = Param("Level 4",138.2,0,200,1); L5_level = Param("Level 5",150,0,200,1); L6_level = Param("Level 6",161.8,0,200,1); L7_level = Param("Level 7",200,0,300,1); _SECTION_END(); _SECTION_BEGIN("Styles"); SwingLow_style = ParamStyle("Swing Low",styleLine+styleDots,maskAll); SwingHigh_style = ParamStyle("Swing High",styleLine+styleDots,maskAll); L1_style = ParamStyle("Level 1",styleLine+styleDashed,maskAll); L2_style = ParamStyle("Level 2",styleLine,maskAll); L3_style = ParamStyle("Level 3",styleLine+styleDashed,maskAll); L4_style = ParamStyle("Level 4",styleLine+styleDashed,maskAll); L5_style = ParamStyle("Level 5",styleLine,maskAll); L6_style = ParamStyle("Level 6",styleLine+styleDashed,maskAll); L7_style = ParamStyle("Level 7",styleLine+styleThick+styleDots,maskAll); _SECTION_END(); _SECTION_BEGIN("Colors"); SwingLow_color = ParamColor("Swing Low",colorLime); SwingHigh_color = ParamColor("Swing High",colorRed); L1_color = ParamColor("Level 1",colorTurquoise); L2_color = ParamColor("Level 2",colorYellow); L3_color = ParamColor("Level 3",colorTurquoise); L4_color = ParamColor("Level 4",colorTurquoise); L5_color = ParamColor("Level 5",colorBlue); L6_color = ParamColor("Level 6",colorTurquoise); L7_color = ParamColor("Level 7",colorGold); _SECTION_END(); _SECTION_BEGIN("Selection"); L1_switch = ParamToggle("Plot Level 1", "Off|On",1); L2_switch = ParamToggle("Plot Level 2", "Off|On",1); L3_switch = ParamToggle("Plot Level 3", "Off|On",1); L4_switch = ParamToggle("Plot Level 4", "Off|On",1); L5_switch = ParamToggle("Plot Level 5", "Off|On",1); L6_switch = ParamToggle("Plot Level 6", "Off|On",1); L7_switch = ParamToggle("Plot Level 7", "Off|On",1); _SECTION_END(); #include <\TBInc\Tradingbasis_1.afl> IV_periods = 50;//for IV Middle_price = L+((H-L)/2); IV = ((H/Middle_price)-1)*100; IV_AVG = MA(IV,IV_periods); ////////////////////////// per = LastValue(Sensitivity *LastValue(0.3*IV_AVG)); x=Cum(1); Range = 0.01; PS = TroughBars(L,per,1) == 0; xa = LastValue(ValueWhen(PS,x,1));//x from last trough Ya = LastValue(ValueWhen(PS,L,1));//y (Low) last trough PR = PeakBars(H,per,1) == 0; xb = LastValue(ValueWhen(PR,x,1));//x from last peak Yb = LastValue(ValueWhen(PR,H,1));//y (High) last peak //UP = upSwing DN = downSwing UP = xb>xa;//upSwing DN = xa>xb;//DownSwing SwingLow = IIf(UP,Ya,Yb); SwingHigh = IIf(UP,Yb,Ya); L1 = IIf(L1_switch,IIf(UP,yb-(yb-ya)*(L1_Level/100),IIf(DN,ya+(yb-ya)*(L1_Level/100),-1e10)),-1e10); L2 = IIf(L2_switch,IIf(UP,yb-(yb-ya)*(L2_Level/100),IIf(DN,ya+(yb-ya)*(L2_Level/100),-1e10)),-1e10); L3 = IIf(L3_switch,IIf(UP,yb-(yb-ya)*(L3_Level/100),IIf(DN,ya+(yb-ya)*(L3_Level/100),-1e10)),-1e10); L4 = IIf(L4_switch,IIf(UP,yb-(yb-ya)*(L4_Level/100),IIf(DN,ya+(yb-ya)*(L4_Level/100),-1e10)),-1e10); L5 = IIf(L5_switch,IIf(UP,yb-(yb-ya)*(L5_Level/100),IIf(DN,ya+(yb-ya)*(L5_Level/100),-1e10)),-1e10); L6 = IIf(L6_switch,IIf(UP,yb-(yb-ya)*(L6_Level/100),IIf(DN,ya+(yb-ya)*(L6_Level/100),-1e10)),-1e10); L7 = IIf(L7_switch,IIf(UP,yb-(yb-ya)*(L7_Level/100),IIf(DN,ya+(yb-ya)*(L7_Level/100),-1e10)),-1e10); CurrentRT_EXT = IIf(UP,-100*(yb-C)/(yb-ya),100*(C-ya)/(yb-ya));//Retracement_Value MaxRT_EXT = IIf(UP,-100*(yb-L)/(yb-ya),100*(H-ya)/(yb-ya));//Retracement_Value InZone = C<yb & C>ya;//filter to receive signals in a retracement zone. Distance = 0.5*ATR(14); Sup_break = Cross(Ya,C) & X>Xa; Sup_pricejustabove = L<Ya+Distance & L>Ya & X>Xa; Sup_confirmed = L<=Ya & C>Ya & X>Xa; Res_break = Cross(C,Yb) & X>Xb; Res_pricejustbelow = H>Yb-Distance & H<Yb & X>Xb; Res_confirmed = H>=Yb & C<Yb & X>Xb; SupSignals = Sup_break | Sup_pricejustabove | Sup_confirmed; ResSignals = Res_break | Res_pricejustbelow | Res_confirmed; BS = Sup_confirmed OR Res_break; SS = Res_confirmed OR Sup_break; Filter = BarIndex()==LastValue(BarIndex()) AND NOT GroupID()==253; Adddefaultcolumns(1,1); AddColumn(CurrentRT_EXT,"Current RT/EXT %"); AddColumn(MaxRT_EXT,"Current max. RT/EXT %"); AddTextColumn( WriteIf(Sup_pricejustabove,"Price just above", WriteIf(Sup_confirmed,"Confirmed", WriteIf(Sup_break,"Break",""))),"Swing Low",1.2, IIf(Sup_pricejustabove OR sup_confirmed,colorGreen,colorRed)); AddTextColumn( WriteIf(Res_pricejustbelow,"Price just below", WriteIf(Res_confirmed,"Confirmed", WriteIf(Res_break,"Break",""))),"Swing High",1.2, IIf(Res_pricejustbelow OR Res_confirmed,colorRed,colorGreen)); AddTextColumn(FullName(),"Full name"); //Anyline_zero AnZ= ya==0 OR yb==0 OR L1==0 OR L2==0 OR L3==0 OR L4==0 OR L5==0; xab = IIf(xb>xa,xb,xa); SLcol = IIf(Colorstyle,SwingLow_color,IIf( LastValue(C)<ya, Color_RL, Color_SL )); SHcol = IIf(Colorstyle,SwingHigh_color,IIf( LastValue(C)<yb, Color_RL, Color_SL )); Plot(IIf(x>=xa &NOT AnZ,ya,-1e10),"",SLcol,1+8 + 2048); Plot(IIf(x>=xb &NOT AnZ,yb,-1e10),"",SHcol,1+8 + 2048); L1col = IIf(Colorstyle,L1_color,IIf( LastValue(C)<L1, Color_RL, Color_SL )); L2col = IIf(Colorstyle,L2_color,IIf( LastValue(C)<L2, Color_RL, Color_SL )); L3col = IIf(Colorstyle,L3_color,IIf( LastValue(C)<L3, Color_RL, Color_SL )); L4col = IIf(Colorstyle,L4_color,IIf( LastValue(C)<L4, Color_RL, Color_SL )); L5col = IIf(Colorstyle,L5_color,IIf( LastValue(C)<L5, Color_RL, Color_SL )); L6col = IIf(Colorstyle,L6_color,IIf( LastValue(C)<L6, Color_RL, Color_SL )); L7col = IIf(Colorstyle,L7_color,IIf( LastValue(C)<L7, Color_RL, Color_SL )); Plot(IIf(x>=xab &NOT AnZ,L1,-1e10),"",L1col,L1_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L2,-1e10),"",L2col,L2_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L3,-1e10),"",L3col,L3_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L4,-1e10),"",L4col,L4_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L5,-1e10),"",L5col,L5_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L6,-1e10),"",L6col,L6_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L7,-1e10),"",L7col,L7_style+styleNoRescale); PlotText(""+L1_level+" %",LastValue(BarIndex()+2),L1,L1col,colorDefault); PlotText(""+L2_level+" %",LastValue(BarIndex()+2),L2,L2col,colorDefault); PlotText(""+L3_level+" %",LastValue(BarIndex()+2),L3,L3col,colorDefault); PlotText(""+L4_level+" %",LastValue(BarIndex()+2),L4,L4col,colorDefault); PlotText(""+L5_level+" %",LastValue(BarIndex()+2),L5,L5col,colorDefault); PlotText(""+L6_level+" %",LastValue(BarIndex()+2),L6,L6col,colorDefault); PlotText(""+L7_level+" %",LastValue(BarIndex()+2),L7,L7col,colorDefault); PlotText("100 %",LastValue(BarIndex()+2),SwingLow,IIf(LastValue(up),SwingLow_color,SwingHigh_color),colorDefault); PlotText("0 %",LastValue(BarIndex()+2),Swinghigh,IIf(LastValue(dn),SwingLow_color,SwingHigh_color),colorDefault); Title = "Tradingbasis.com - Fibonacci Recognition"+ default_title + EncodeColor(IIf(NOT AnZ,colorLightBlue,colorRed))+", Sensitivity = " + WriteVal(Sensitivity,1)+ EncodeColor(colorRed)+WriteIf(NOT AnZ,""," NO POINTS AVAILABLE -> REDUCE SENSITIVITY")+ EncodeColor(IIf(LastValue(L)>0,Color_SL,Color_RL))+", Current Correction = "+WriteVal(CurrentRT_EXT,1.0)+"% "; | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر علي الثلاثي الأربعاء أبريل 28, 2010 5:39 am | |
| _SECTION_BEGIN("Triangular "); //------------------------------------------------------------------------------ // // Formula Name: Triangular Moving Average // Author/Uploader: Anthony Faragasso // E-mail: ajf1111@epix.net// Date/Time Added: 2002-12-14 11:47:32 // Origin: // Keywords: Moving Average // Level: basic // Flags: indicator // Formula URL: http://www.amibroker.com/library/formula.php?id=240// Details URL: http://www.amibroker.com/library/detail.php?id=240// //------------------------------------------------------------------------------ // // A Triangular moving average is similar to exponential and // // weighted moving averages except a different weighting scheme // // is used. Exponential and Weighted averages assign the majority // // of the weight to the most recent data. Simple moving averages // // assign the weight equally across all the data. With a Triangular // // moving average, the majority of the weight is assigned to the middle // // portion of the data. // //------------------------------------------------------------------------------ //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر علي للقنوات الأربعاء أبريل 28, 2010 5:41 am | |
| _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); // ==================Plot the Linear Regression Line ========================================================== LRColor = ParamColor("LR Color", colorCycle ); LRStyle = ParamStyle("LR Style"); LRLine = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y, Null ); Plot( LRLine , "LinReg", LRCOLOR, LRSTYLE ); // styleDots ); // ========================== Plot 1st SD Channel =============================================================== SDP = Param("Standard Deviation", 1.5, 0, 6, 0.1); SD = SDP/2; width = LastValue( Ref(SD*StDev(p, Daysback),-shift) ); // THIS IS WHERE THE WIDTH OF THE CHANELS IS SET SDU = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y+width , Null ) ; SDL = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y-width , Null ) ; SDColor = ParamColor("SD Color", colorCycle ); SDStyle = ParamStyle("SD Style"); Plot( SDU , "Upper Lin Reg", SDColor,SDStyle ); Plot( SDL , "Lower Lin Reg", SDColor,SDStyle ); // ========================== Plot 2d SD Channel =============================================================== SDP2 = Param("2d Standard Deviation", 2.0, 0, 6, 0.1); SD2 = SDP2/2; width2 = LastValue( Ref(SD2*StDev(p, Daysback),-shift) ); // THIS IS WHERE THE WIDTH OF THE CHANELS IS SET SDU2 = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y+width2 , Null ) ; SDL2 = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y-width2 , Null ) ; SDColor2 = ParamColor("2 SD Color", colorCycle ); SDStyle2 = ParamStyle("2 SD Style"); Plot( SDU2 , "Upper Lin Reg", SDColor2,SDStyle2 ); Plot( SDL2 , "Lower Lin Reg", SDColor2,SDStyle2 ); // ============================ End Indicator Code ============================================================== _SECTION_END(); //|------------------------------------------------------------------ //|Tradingbasis.com - Fibonacci Recognition //|Version:4.6 08-July-2006 //|Copyright 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> _SECTION_BEGIN("Main Parameters"); AddparamUsefromChart(1); Sensitivity = Param("Sensitivity",10,0,100,1); if(InChart)StaticVarSet("P0O3U2",Sensitivity);if(inAA AND Usefromchart) Sensitivity = StaticVarGet("P0O3U2"); Colorstyle = ParamToggle("Color Mode","S/R|Custom",1); Color_SL= ParamColor("Support (S/R Mode)",colorLime); Color_RL= ParamColor("Resistance (S/R Mode)",colorRed); _SECTION_END(); _SECTION_BEGIN("Levels"); L1_level = Param("Level 1",38.2,0,200,1); L2_level = Param("Level 2",50.0,0,200,1); L3_level = Param("Level 3",61.8,0,200,1); L4_level = Param("Level 4",138.2,0,200,1); L5_level = Param("Level 5",150,0,200,1); L6_level = Param("Level 6",161.8,0,200,1); L7_level = Param("Level 7",200,0,300,1); _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر علي االثلاثي الذهبي السبت يونيو 05, 2010 5:44 am | |
| _SECTION_BEGIN("Triangular "); //------------------------------------------------------------------------------ // // Formula Name: Triangular Moving Average // Author/Uploader: Anthony Faragasso // E-mail: ajf1111@epix.net// Date/Time Added: 2002-12-14 11:47:32 // Origin: // Keywords: Moving Average // Level: basic // Flags: indicator // Formula URL: http://www.amibroker.com/library/formula.php?id=240// Details URL: http://www.amibroker.com/library/detail.php?id=240// //------------------------------------------------------------------------------ // // A Triangular moving average is similar to exponential and // // weighted moving averages except a different weighting scheme // // is used. Exponential and Weighted averages assign the majority // // of the weight to the most recent data. Simple moving averages // // assign the weight equally across all the data. With a Triangular // // moving average, the majority of the weight is assigned to the middle // // portion of the data. // //------------------------------------------------------------------------------ //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); _SECTION_END(); Buy = Cross ( ResBase=Base, HHV(H,HHVperiod)); Sell= Cross ( supbase=Base, LLV(L,HHVperiod)); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر علي االثلاثي الذهبي 11 السبت يونيو 05, 2010 6:40 am | |
| _SECTION_BEGIN("Triangular "); //------------------------------------------------------------------------------ // // Formula Name: Triangular Moving Average // Author/Uploader: Anthony Faragasso // E-mail: ajf1111@epix.net// Date/Time Added: 2002-12-14 11:47:32 // Origin: // Keywords: Moving Average // Level: basic // Flags: indicator // Formula URL: http://www.amibroker.com/library/formula.php?id=240// Details URL: http://www.amibroker.com/library/detail.php?id=240// //------------------------------------------------------------------------------ // // A Triangular moving average is similar to exponential and // // weighted moving averages except a different weighting scheme // // is used. Exponential and Weighted averages assign the majority // // of the weight to the most recent data. Simple moving averages // // assign the weight equally across all the data. With a Triangular // // moving average, the majority of the weight is assigned to the middle // // portion of the data. // //------------------------------------------------------------------------------ //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); _SECTION_END(); Buy = Cross ( ResBase=Base, HHV(H,HHVperiod)); Sell= Cross ( supbase=Base, LLV(L,HHVperiod)); PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) ); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر الكل الأربعاء يوليو 14, 2010 3:58 am | |
| _SECTION_BEGIN("Wilders"); P = ParamField("Price field",-1); Periods = Param("Periods", 15, 2, 200, 1, 10 ); Plot( Wilders( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); // ==================Plot the Linear Regression Line ========================================================== LRColor = ParamColor("LR Color", colorCycle ); LRStyle = ParamStyle("LR Style"); LRLine = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y, Null ); Plot( LRLine , "LinReg", LRCOLOR, LRSTYLE ); // styleDots ); // ========================== Plot 1st SD Channel =============================================================== SDP = Param("Standard Deviation", 1.5, 0, 6, 0.1); SD = SDP/2; width = LastValue( Ref(SD*StDev(p, Daysback),-shift) ); // THIS IS WHERE THE WIDTH OF THE CHANELS IS SET SDU = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y+width , Null ) ; SDL = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y-width , Null ) ; SDColor = ParamColor("SD Color", colorCycle ); SDStyle = ParamStyle("SD Style"); Plot( SDU , "Upper Lin Reg", SDColor,SDStyle ); Plot( SDL , "Lower Lin Reg", SDColor,SDStyle ); // ========================== Plot 2d SD Channel =============================================================== SDP2 = Param("2d Standard Deviation", 2.0, 0, 6, 0.1); SD2 = SDP2/2; width2 = LastValue( Ref(SD2*StDev(p, Daysback),-shift) ); // THIS IS WHERE THE WIDTH OF THE CHANELS IS SET SDU2 = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y+width2 , Null ) ; SDL2 = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y-width2 , Null ) ; SDColor2 = ParamColor("2 SD Color", colorCycle ); SDStyle2 = ParamStyle("2 SD Style"); Plot( SDU2 , "Upper Lin Reg", SDColor2,SDStyle2 ); Plot( SDL2 , "Lower Lin Reg", SDColor2,SDStyle2 ); // ============================ End Indicator Code ============================================================== _SECTION_END(); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); Plot (r1,"R1",12,1); Plot (r2,"R2",12,1); Plot (r3,"R3",12,1); Plot (s1,"S1",3,1); Plot (s2,"S2",3,1); Plot (s3,"S3",3,1); _SECTION_END(); //|------------------------------------------------------------------ //|Tradingbasis.com - Fibonacci Recognition //|Version:4.6 08-July-2006 //|Copyright © 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> _SECTION_BEGIN("Main Parameters"); AddparamUsefromChart(1); Sensitivity = Param("Sensitivity",10,0,100,1); if(InChart)StaticVarSet("P0O3U2",Sensitivity);if(inAA AND Usefromchart) Sensitivity = StaticVarGet("P0O3U2"); Colorstyle = ParamToggle("Color Mode","S/R|Custom",1); Color_SL= ParamColor("Support (S/R Mode)",colorLime); Color_RL= ParamColor("Resistance (S/R Mode)",colorRed); _SECTION_END(); _SECTION_BEGIN("Levels"); L1_level = Param("Level 1",38.2,0,200,1); L2_level = Param("Level 2",50.0,0,200,1); L3_level = Param("Level 3",61.8,0,200,1); L4_level = Param("Level 4",138.2,0,200,1); L5_level = Param("Level 5",150,0,200,1); L6_level = Param("Level 6",161.8,0,200,1); L7_level = Param("Level 7",200,0,300,1); _SECTION_END(); _SECTION_BEGIN("Styles"); SwingLow_style = ParamStyle("Swing Low",styleLine+styleDots,maskAll); SwingHigh_style = ParamStyle("Swing High",styleLine+styleDots,maskAll); L1_style = ParamStyle("Level 1",styleLine+styleDashed,maskAll); L2_style = ParamStyle("Level 2",styleLine,maskAll); L3_style = ParamStyle("Level 3",styleLine+styleDashed,maskAll); L4_style = ParamStyle("Level 4",styleLine+styleDashed,maskAll); L5_style = ParamStyle("Level 5",styleLine,maskAll); L6_style = ParamStyle("Level 6",styleLine+styleDashed,maskAll); L7_style = ParamStyle("Level 7",styleLine+styleThick+styleDots,maskAll); _SECTION_END(); _SECTION_BEGIN("Colors"); SwingLow_color = ParamColor("Swing Low",colorLime); SwingHigh_color = ParamColor("Swing High",colorRed); L1_color = ParamColor("Level 1",colorTurquoise); L2_color = ParamColor("Level 2",colorYellow); L3_color = ParamColor("Level 3",colorTurquoise); L4_color = ParamColor("Level 4",colorTurquoise); L5_color = ParamColor("Level 5",colorBlue); L6_color = ParamColor("Level 6",colorTurquoise); L7_color = ParamColor("Level 7",colorGold); _SECTION_END(); _SECTION_BEGIN("Selection"); L1_switch = ParamToggle("Plot Level 1", "Off|On",1); L2_switch = ParamToggle("Plot Level 2", "Off|On",1); L3_switch = ParamToggle("Plot Level 3", "Off|On",1); L4_switch = ParamToggle("Plot Level 4", "Off|On",1); L5_switch = ParamToggle("Plot Level 5", "Off|On",1); L6_switch = ParamToggle("Plot Level 6", "Off|On",1); L7_switch = ParamToggle("Plot Level 7", "Off|On",1); _SECTION_END(); #include <\TBInc\Tradingbasis_1.afl> IV_periods = 50;//for IV Middle_price = L+((H-L)/2); IV = ((H/Middle_price)-1)*100; IV_AVG = MA(IV,IV_periods); ////////////////////////// per = LastValue(Sensitivity *LastValue(0.3*IV_AVG)); x=Cum(1); Range = 0.01; PS = TroughBars(L,per,1) == 0; xa = LastValue(ValueWhen(PS,x,1));//x from last trough Ya = LastValue(ValueWhen(PS,L,1));//y (Low) last trough PR = PeakBars(H,per,1) == 0; xb = LastValue(ValueWhen(PR,x,1));//x from last peak Yb = LastValue(ValueWhen(PR,H,1));//y (High) last peak //UP = upSwing DN = downSwing UP = xb>xa;//upSwing DN = xa>xb;//DownSwing SwingLow = IIf(UP,Ya,Yb); SwingHigh = IIf(UP,Yb,Ya); L1 = IIf(L1_switch,IIf(UP,yb-(yb-ya)*(L1_Level/100),IIf(DN,ya+(yb-ya)*(L1_Level/100),-1e10)),-1e10); L2 = IIf(L2_switch,IIf(UP,yb-(yb-ya)*(L2_Level/100),IIf(DN,ya+(yb-ya)*(L2_Level/100),-1e10)),-1e10); L3 = IIf(L3_switch,IIf(UP,yb-(yb-ya)*(L3_Level/100),IIf(DN,ya+(yb-ya)*(L3_Level/100),-1e10)),-1e10); L4 = IIf(L4_switch,IIf(UP,yb-(yb-ya)*(L4_Level/100),IIf(DN,ya+(yb-ya)*(L4_Level/100),-1e10)),-1e10); L5 = IIf(L5_switch,IIf(UP,yb-(yb-ya)*(L5_Level/100),IIf(DN,ya+(yb-ya)*(L5_Level/100),-1e10)),-1e10); L6 = IIf(L6_switch,IIf(UP,yb-(yb-ya)*(L6_Level/100),IIf(DN,ya+(yb-ya)*(L6_Level/100),-1e10)),-1e10); L7 = IIf(L7_switch,IIf(UP,yb-(yb-ya)*(L7_Level/100),IIf(DN,ya+(yb-ya)*(L7_Level/100),-1e10)),-1e10); CurrentRT_EXT = IIf(UP,-100*(yb-C)/(yb-ya),100*(C-ya)/(yb-ya));//Retracement_Value MaxRT_EXT = IIf(UP,-100*(yb-L)/(yb-ya),100*(H-ya)/(yb-ya));//Retracement_Value InZone = C<yb & C>ya;//filter to receive signals in a retracement zone. Distance = 0.5*ATR(14); Sup_break = Cross(Ya,C) & X>Xa; Sup_pricejustabove = L<Ya+Distance & L>Ya & X>Xa; Sup_confirmed = L<=Ya & C>Ya & X>Xa; Res_break = Cross(C,Yb) & X>Xb; Res_pricejustbelow = H>Yb-Distance & H<Yb & X>Xb; Res_confirmed = H>=Yb & C<Yb & X>Xb; SupSignals = Sup_break | Sup_pricejustabove | Sup_confirmed; ResSignals = Res_break | Res_pricejustbelow | Res_confirmed; BS = Sup_confirmed OR Res_break; SS = Res_confirmed OR Sup_break; Filter = BarIndex()==LastValue(BarIndex()) AND NOT GroupID()==253; Adddefaultcolumns(1,1); AddColumn(CurrentRT_EXT,"Current RT/EXT %"); AddColumn(MaxRT_EXT,"Current max. RT/EXT %"); AddTextColumn( WriteIf(Sup_pricejustabove,"Price just above", WriteIf(Sup_confirmed,"Confirmed", WriteIf(Sup_break,"Break",""))),"Swing Low",1.2, IIf(Sup_pricejustabove OR sup_confirmed,colorGreen,colorRed)); AddTextColumn( WriteIf(Res_pricejustbelow,"Price just below", WriteIf(Res_confirmed,"Confirmed", WriteIf(Res_break,"Break",""))),"Swing High",1.2, IIf(Res_pricejustbelow OR Res_confirmed,colorRed,colorGreen)); AddTextColumn(FullName(),"Full name"); //Anyline_zero AnZ= ya==0 OR yb==0 OR L1==0 OR L2==0 OR L3==0 OR L4==0 OR L5==0; xab = IIf(xb>xa,xb,xa); SLcol = IIf(Colorstyle,SwingLow_color,IIf( LastValue(C)<ya, Color_RL, Color_SL )); SHcol = IIf(Colorstyle,SwingHigh_color,IIf( LastValue(C)<yb, Color_RL, Color_SL )); Plot(IIf(x>=xa &NOT AnZ,ya,-1e10),"",SLcol,1+8 + 2048); Plot(IIf(x>=xb &NOT AnZ,yb,-1e10),"",SHcol,1+8 + 2048); L1col = IIf(Colorstyle,L1_color,IIf( LastValue(C)<L1, Color_RL, Color_SL )); L2col = IIf(Colorstyle,L2_color,IIf( LastValue(C)<L2, Color_RL, Color_SL )); L3col = IIf(Colorstyle,L3_color,IIf( LastValue(C)<L3, Color_RL, Color_SL )); L4col = IIf(Colorstyle,L4_color,IIf( LastValue(C)<L4, Color_RL, Color_SL )); L5col = IIf(Colorstyle,L5_color,IIf( LastValue(C)<L5, Color_RL, Color_SL )); L6col = IIf(Colorstyle,L6_color,IIf( LastValue(C)<L6, Color_RL, Color_SL )); L7col = IIf(Colorstyle,L7_color,IIf( LastValue(C)<L7, Color_RL, Color_SL )); Plot(IIf(x>=xab &NOT AnZ,L1,-1e10),"",L1col,L1_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L2,-1e10),"",L2col,L2_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L3,-1e10),"",L3col,L3_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L4,-1e10),"",L4col,L4_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L5,-1e10),"",L5col,L5_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L6,-1e10),"",L6col,L6_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L7,-1e10),"",L7col,L7_style+styleNoRescale); PlotText(""+L1_level+" %",LastValue(BarIndex()+2),L1,L1col,colorDefault); PlotText(""+L2_level+" %",LastValue(BarIndex()+2),L2,L2col,colorDefault); PlotText(""+L3_level+" %",LastValue(BarIndex()+2),L3,L3col,colorDefault); PlotText(""+L4_level+" %",LastValue(BarIndex()+2),L4,L4col,colorDefault); PlotText(""+L5_level+" %",LastValue(BarIndex()+2),L5,L5col,colorDefault); PlotText(""+L6_level+" %",LastValue(BarIndex()+2),L6,L6col,colorDefault); PlotText(""+L7_level+" %",LastValue(BarIndex()+2),L7,L7col,colorDefault); PlotText("100 %",LastValue(BarIndex()+2),SwingLow,IIf(LastValue(up),SwingLow_color,SwingHigh_color),colorDefault); PlotText("0 %",LastValue(BarIndex()+2),Swinghigh,IIf(LastValue(dn),SwingLow_color,SwingHigh_color),colorDefault); Title = "Tradingbasis.com - Fibonacci Recognition"+ default_title + EncodeColor(IIf(NOT AnZ,colorLightBlue,colorRed))+", Sensitivity = " + WriteVal(Sensitivity,1)+ EncodeColor(colorRed)+WriteIf(NOT AnZ,""," NO POINTS AVAILABLE -> REDUCE SENSITIVITY")+ EncodeColor(IIf(LastValue(L)>0,Color_SL,Color_RL))+", Current Correction = "+WriteVal(CurrentRT_EXT,1.0)+"% "; _SECTION_BEGIN("Triangular "); //------------------------------------------------------------------------------ // // Formula Name: Triangular Moving Average // Author/Uploader: Anthony Faragasso // E-mail: ajf1111@epix.net// Date/Time Added: 2002-12-14 11:47:32 // Origin: // Keywords: Moving Average // Level: basic // Flags: indicator // Formula URL: http://www.amibroker.com/library/formula.php?id=240// Details URL: http://www.amibroker.com/library/detail.php?id=240// //------------------------------------------------------------------------------ // // A Triangular moving average is similar to exponential and // // weighted moving averages except a different weighting scheme // // is used. Exponential and Weighted averages assign the majority // // of the weight to the most recent data. Simple moving averages // // assign the weight equally across all the data. With a Triangular // // moving average, the majority of the weight is assigned to the middle // // portion of the data. // //------------------------------------------------------------------------------ //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر مجموع معادلات الأربعاء يوليو 14, 2010 7:00 am | |
| _SECTION_BEGIN("Triangular "); //------------------------------------------------------------------------------ // // Formula Name: Triangular Moving Average // Author/Uploader: Anthony Faragasso // E-mail: ajf1111@epix.net// Date/Time Added: 2002-12-14 11:47:32 // Origin: // Keywords: Moving Average // Level: basic // Flags: indicator // Formula URL: http://www.amibroker.com/library/formula.php?id=240// Details URL: http://www.amibroker.com/library/detail.php?id=240// //------------------------------------------------------------------------------ // // A Triangular moving average is similar to exponential and // // weighted moving averages except a different weighting scheme // // is used. Exponential and Weighted averages assign the majority // // of the weight to the most recent data. Simple moving averages // // assign the weight equally across all the data. With a Triangular // // moving average, the majority of the weight is assigned to the middle // // portion of the data. // //------------------------------------------------------------------------------ //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); _SECTION_END(); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); Plot (r1,"R1",12,1); Plot (r2,"R2",12,1); Plot (r3,"R3",12,1); Plot (s1,"S1",3,1); Plot (s2,"S2",3,1); Plot (s3,"S3",3,1); _SECTION_END(); //|------------------------------------------------------------------ //|Tradingbasis.com - Fibonacci Recognition //|Version:4.6 08-July-2006 //|Copyright © 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> _SECTION_BEGIN("Main Parameters"); AddparamUsefromChart(1); Sensitivity = Param("Sensitivity",10,0,100,1); if(InChart)StaticVarSet("P0O3U2",Sensitivity);if(inAA AND Usefromchart) Sensitivity = StaticVarGet("P0O3U2"); Colorstyle = ParamToggle("Color Mode","S/R|Custom",1); Color_SL= ParamColor("Support (S/R Mode)",colorLime); Color_RL= ParamColor("Resistance (S/R Mode)",colorRed); _SECTION_END(); _SECTION_BEGIN("Levels"); L1_level = Param("Level 1",38.2,0,200,1); L2_level = Param("Level 2",50.0,0,200,1); L3_level = Param("Level 3",61.8,0,200,1); L4_level = Param("Level 4",138.2,0,200,1); L5_level = Param("Level 5",150,0,200,1); L6_level = Param("Level 6",161.8,0,200,1); L7_level = Param("Level 7",200,0,300,1); _SECTION_END(); _SECTION_BEGIN("Styles"); SwingLow_style = ParamStyle("Swing Low",styleLine+styleDots,maskAll); SwingHigh_style = ParamStyle("Swing High",styleLine+styleDots,maskAll); L1_style = ParamStyle("Level 1",styleLine+styleDashed,maskAll); L2_style = ParamStyle("Level 2",styleLine,maskAll); L3_style = ParamStyle("Level 3",styleLine+styleDashed,maskAll); L4_style = ParamStyle("Level 4",styleLine+styleDashed,maskAll); L5_style = ParamStyle("Level 5",styleLine,maskAll); L6_style = ParamStyle("Level 6",styleLine+styleDashed,maskAll); L7_style = ParamStyle("Level 7",styleLine+styleThick+styleDots,maskAll); _SECTION_END(); _SECTION_BEGIN("Colors"); SwingLow_color = ParamColor("Swing Low",colorLime); SwingHigh_color = ParamColor("Swing High",colorRed); L1_color = ParamColor("Level 1",colorTurquoise); L2_color = ParamColor("Level 2",colorYellow); L3_color = ParamColor("Level 3",colorTurquoise); L4_color = ParamColor("Level 4",colorTurquoise); L5_color = ParamColor("Level 5",colorBlue); L6_color = ParamColor("Level 6",colorTurquoise); L7_color = ParamColor("Level 7",colorGold); _SECTION_END(); _SECTION_BEGIN("Selection"); L1_switch = ParamToggle("Plot Level 1", "Off|On",1); L2_switch = ParamToggle("Plot Level 2", "Off|On",1); L3_switch = ParamToggle("Plot Level 3", "Off|On",1); L4_switch = ParamToggle("Plot Level 4", "Off|On",1); L5_switch = ParamToggle("Plot Level 5", "Off|On",1); L6_switch = ParamToggle("Plot Level 6", "Off|On",1); L7_switch = ParamToggle("Plot Level 7", "Off|On",1); _SECTION_END(); #include <\TBInc\Tradingbasis_1.afl> IV_periods = 50;//for IV Middle_price = L+((H-L)/2); IV = ((H/Middle_price)-1)*100; IV_AVG = MA(IV,IV_periods); ////////////////////////// per = LastValue(Sensitivity *LastValue(0.3*IV_AVG)); x=Cum(1); Range = 0.01; PS = TroughBars(L,per,1) == 0; xa = LastValue(ValueWhen(PS,x,1));//x from last trough Ya = LastValue(ValueWhen(PS,L,1));//y (Low) last trough PR = PeakBars(H,per,1) == 0; xb = LastValue(ValueWhen(PR,x,1));//x from last peak Yb = LastValue(ValueWhen(PR,H,1));//y (High) last peak //UP = upSwing DN = downSwing UP = xb>xa;//upSwing DN = xa>xb;//DownSwing SwingLow = IIf(UP,Ya,Yb); SwingHigh = IIf(UP,Yb,Ya); L1 = IIf(L1_switch,IIf(UP,yb-(yb-ya)*(L1_Level/100),IIf(DN,ya+(yb-ya)*(L1_Level/100),-1e10)),-1e10); L2 = IIf(L2_switch,IIf(UP,yb-(yb-ya)*(L2_Level/100),IIf(DN,ya+(yb-ya)*(L2_Level/100),-1e10)),-1e10); L3 = IIf(L3_switch,IIf(UP,yb-(yb-ya)*(L3_Level/100),IIf(DN,ya+(yb-ya)*(L3_Level/100),-1e10)),-1e10); L4 = IIf(L4_switch,IIf(UP,yb-(yb-ya)*(L4_Level/100),IIf(DN,ya+(yb-ya)*(L4_Level/100),-1e10)),-1e10); L5 = IIf(L5_switch,IIf(UP,yb-(yb-ya)*(L5_Level/100),IIf(DN,ya+(yb-ya)*(L5_Level/100),-1e10)),-1e10); L6 = IIf(L6_switch,IIf(UP,yb-(yb-ya)*(L6_Level/100),IIf(DN,ya+(yb-ya)*(L6_Level/100),-1e10)),-1e10); L7 = IIf(L7_switch,IIf(UP,yb-(yb-ya)*(L7_Level/100),IIf(DN,ya+(yb-ya)*(L7_Level/100),-1e10)),-1e10); CurrentRT_EXT = IIf(UP,-100*(yb-C)/(yb-ya),100*(C-ya)/(yb-ya));//Retracement_Value MaxRT_EXT = IIf(UP,-100*(yb-L)/(yb-ya),100*(H-ya)/(yb-ya));//Retracement_Value InZone = C<yb & C>ya;//filter to receive signals in a retracement zone. Distance = 0.5*ATR(14); Sup_break = Cross(Ya,C) & X>Xa; Sup_pricejustabove = L<Ya+Distance & L>Ya & X>Xa; Sup_confirmed = L<=Ya & C>Ya & X>Xa; Res_break = Cross(C,Yb) & X>Xb; Res_pricejustbelow = H>Yb-Distance & H<Yb & X>Xb; Res_confirmed = H>=Yb & C<Yb & X>Xb; SupSignals = Sup_break | Sup_pricejustabove | Sup_confirmed; ResSignals = Res_break | Res_pricejustbelow | Res_confirmed; BS = Sup_confirmed OR Res_break; SS = Res_confirmed OR Sup_break; Filter = BarIndex()==LastValue(BarIndex()) AND NOT GroupID()==253; Adddefaultcolumns(1,1); AddColumn(CurrentRT_EXT,"Current RT/EXT %"); AddColumn(MaxRT_EXT,"Current max. RT/EXT %"); AddTextColumn( WriteIf(Sup_pricejustabove,"Price just above", WriteIf(Sup_confirmed,"Confirmed", WriteIf(Sup_break,"Break",""))),"Swing Low",1.2, IIf(Sup_pricejustabove OR sup_confirmed,colorGreen,colorRed)); AddTextColumn( WriteIf(Res_pricejustbelow,"Price just below", WriteIf(Res_confirmed,"Confirmed", WriteIf(Res_break,"Break",""))),"Swing High",1.2, IIf(Res_pricejustbelow OR Res_confirmed,colorRed,colorGreen)); AddTextColumn(FullName(),"Full name"); //Anyline_zero AnZ= ya==0 OR yb==0 OR L1==0 OR L2==0 OR L3==0 OR L4==0 OR L5==0; xab = IIf(xb>xa,xb,xa); SLcol = IIf(Colorstyle,SwingLow_color,IIf( LastValue(C)<ya, Color_RL, Color_SL )); SHcol = IIf(Colorstyle,SwingHigh_color,IIf( LastValue(C)<yb, Color_RL, Color_SL )); Plot(IIf(x>=xa &NOT AnZ,ya,-1e10),"",SLcol,1+8 + 2048); Plot(IIf(x>=xb &NOT AnZ,yb,-1e10),"",SHcol,1+8 + 2048); L1col = IIf(Colorstyle,L1_color,IIf( LastValue(C)<L1, Color_RL, Color_SL )); L2col = IIf(Colorstyle,L2_color,IIf( LastValue(C)<L2, Color_RL, Color_SL )); L3col = IIf(Colorstyle,L3_color,IIf( LastValue(C)<L3, Color_RL, Color_SL )); L4col = IIf(Colorstyle,L4_color,IIf( LastValue(C)<L4, Color_RL, Color_SL )); L5col = IIf(Colorstyle,L5_color,IIf( LastValue(C)<L5, Color_RL, Color_SL )); L6col = IIf(Colorstyle,L6_color,IIf( LastValue(C)<L6, Color_RL, Color_SL )); L7col = IIf(Colorstyle,L7_color,IIf( LastValue(C)<L7, Color_RL, Color_SL )); Plot(IIf(x>=xab &NOT AnZ,L1,-1e10),"",L1col,L1_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L2,-1e10),"",L2col,L2_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L3,-1e10),"",L3col,L3_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L4,-1e10),"",L4col,L4_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L5,-1e10),"",L5col,L5_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L6,-1e10),"",L6col,L6_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L7,-1e10),"",L7col,L7_style+styleNoRescale); PlotText(""+L1_level+" %",LastValue(BarIndex()+2),L1,L1col,colorDefault); PlotText(""+L2_level+" %",LastValue(BarIndex()+2),L2,L2col,colorDefault); PlotText(""+L3_level+" %",LastValue(BarIndex()+2),L3,L3col,colorDefault); PlotText(""+L4_level+" %",LastValue(BarIndex()+2),L4,L4col,colorDefault); PlotText(""+L5_level+" %",LastValue(BarIndex()+2),L5,L5col,colorDefault); PlotText(""+L6_level+" %",LastValue(BarIndex()+2),L6,L6col,colorDefault); PlotText(""+L7_level+" %",LastValue(BarIndex()+2),L7,L7col,colorDefault); PlotText("100 %",LastValue(BarIndex()+2),SwingLow,IIf(LastValue(up),SwingLow_color,SwingHigh_color),colorDefault); PlotText("0 %",LastValue(BarIndex()+2),Swinghigh,IIf(LastValue(dn),SwingLow_color,SwingHigh_color),colorDefault); Title = "Tradingbasis.com - Fibonacci Recognition"+ default_title + EncodeColor(IIf(NOT AnZ,colorLightBlue,colorRed))+", Sensitivity = " + WriteVal(Sensitivity,1)+ EncodeColor(colorRed)+WriteIf(NOT AnZ,""," NO POINTS AVAILABLE -> REDUCE SENSITIVITY")+ EncodeColor(IIf(LastValue(L)>0,Color_SL,Color_RL))+", Current Correction = "+WriteVal(CurrentRT_EXT,1.0)+"% "; _SECTION_BEGIN("Wilders"); P = ParamField("Price field",-1); Periods = Param("Periods", 15, 2, 200, 1, 10 ); Plot( Wilders( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر الفيبو والترند الثلاثاء سبتمبر 28, 2010 11:57 pm | |
| _SECTION_BEGIN("Triangular "); //------------------------------------------------------------------------------ // // Formula Name: Triangular Moving Average // Author/Uploader: Anthony Faragasso // E-mail: ajf1111@epix.net// Date/Time Added: 2002-12-14 11:47:32 // Origin: // Keywords: Moving Average // Level: basic // Flags: indicator // Formula URL: http://www.amibroker.com/library/formula.php?id=240// Details URL: http://www.amibroker.com/library/detail.php?id=240// //------------------------------------------------------------------------------ // // A Triangular moving average is similar to exponential and // // weighted moving averages except a different weighting scheme // // is used. Exponential and Weighted averages assign the majority // // of the weight to the most recent data. Simple moving averages // // assign the weight equally across all the data. With a Triangular // // moving average, the majority of the weight is assigned to the middle // // portion of the data. // //------------------------------------------------------------------------------ //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); _SECTION_END(); _SECTION_BEGIN("Triangular "); //------------------------------------------------------------------------------ // // Formula Name: Triangular Moving Average // Author/Uploader: Anthony Faragasso // E-mail: ajf1111@epix.net// Date/Time Added: 2002-12-14 11:47:32 // Origin: // Keywords: Moving Average // Level: basic // Flags: indicator // Formula URL: http://www.amibroker.com/library/formula.php?id=240// Details URL: http://www.amibroker.com/library/detail.php?id=240// //------------------------------------------------------------------------------ // // A Triangular moving average is similar to exponential and // // weighted moving averages except a different weighting scheme // // is used. Exponential and Weighted averages assign the majority // // of the weight to the most recent data. Simple moving averages // // assign the weight equally across all the data. With a Triangular // // moving average, the majority of the weight is assigned to the middle // // portion of the data. // //------------------------------------------------------------------------------ //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); // ==================Plot the Linear Regression Line ========================================================== LRColor = ParamColor("LR Color", colorCycle ); LRStyle = ParamStyle("LR Style"); LRLine = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y, Null ); Plot( LRLine , "LinReg", LRCOLOR, LRSTYLE ); // styleDots ); // ========================== Plot 1st SD Channel =============================================================== //|------------------------------------------------------------------ //|Tradingbasis.com - Fibonacci Recognition //|Version:4.6 08-July-2006 //|Copyright © 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> _SECTION_BEGIN("Main Parameters"); AddparamUsefromChart(1); Sensitivity = Param("Sensitivity",10,0,100,1); if(InChart)StaticVarSet("P0O3U2",Sensitivity);if(inAA AND Usefromchart) Sensitivity = StaticVarGet("P0O3U2"); Colorstyle = ParamToggle("Color Mode","S/R|Custom",1); Color_SL= ParamColor("Support (S/R Mode)",colorLime); Color_RL= ParamColor("Resistance (S/R Mode)",colorRed); _SECTION_END(); _SECTION_BEGIN("Levels"); L1_level = Param("Level 1",38.2,0,200,1); L2_level = Param("Level 2",50.0,0,200,1); L3_level = Param("Level 3",61.8,0,200,1); L4_level = Param("Level 4",138.2,0,200,1); L5_level = Param("Level 5",150,0,200,1); L6_level = Param("Level 6",161.8,0,200,1); L7_level = Param("Level 7",200,0,300,1); _SECTION_END(); _SECTION_BEGIN("Styles"); SwingLow_style = ParamStyle("Swing Low",styleLine+styleDots,maskAll); SwingHigh_style = ParamStyle("Swing High",styleLine+styleDots,maskAll); L1_style = ParamStyle("Level 1",styleLine+styleDashed,maskAll); L2_style = ParamStyle("Level 2",styleLine,maskAll); L3_style = ParamStyle("Level 3",styleLine+styleDashed,maskAll); L4_style = ParamStyle("Level 4",styleLine+styleDashed,maskAll); L5_style = ParamStyle("Level 5",styleLine,maskAll); L6_style = ParamStyle("Level 6",styleLine+styleDashed,maskAll); L7_style = ParamStyle("Level 7",styleLine+styleThick+styleDots,maskAll); _SECTION_END(); _SECTION_BEGIN("Colors"); SwingLow_color = ParamColor("Swing Low",colorLime); SwingHigh_color = ParamColor("Swing High",colorRed); L1_color = ParamColor("Level 1",colorTurquoise); L2_color = ParamColor("Level 2",colorYellow); L3_color = ParamColor("Level 3",colorTurquoise); L4_color = ParamColor("Level 4",colorTurquoise); L5_color = ParamColor("Level 5",colorBlue); L6_color = ParamColor("Level 6",colorTurquoise); L7_color = ParamColor("Level 7",colorGold); _SECTION_END(); _SECTION_BEGIN("Selection"); L1_switch = ParamToggle("Plot Level 1", "Off|On",1); L2_switch = ParamToggle("Plot Level 2", "Off|On",1); L3_switch = ParamToggle("Plot Level 3", "Off|On",1); L4_switch = ParamToggle("Plot Level 4", "Off|On",1); L5_switch = ParamToggle("Plot Level 5", "Off|On",1); L6_switch = ParamToggle("Plot Level 6", "Off|On",1); L7_switch = ParamToggle("Plot Level 7", "Off|On",1); _SECTION_END(); #include <\TBInc\Tradingbasis_1.afl> IV_periods = 50;//for IV Middle_price = L+((H-L)/2); IV = ((H/Middle_price)-1)*100; IV_AVG = MA(IV,IV_periods); ////////////////////////// per = LastValue(Sensitivity *LastValue(0.3*IV_AVG)); x=Cum(1); Range = 0.01; PS = TroughBars(L,per,1) == 0; xa = LastValue(ValueWhen(PS,x,1));//x from last trough Ya = LastValue(ValueWhen(PS,L,1));//y (Low) last trough PR = PeakBars(H,per,1) == 0; xb = LastValue(ValueWhen(PR,x,1));//x from last peak Yb = LastValue(ValueWhen(PR,H,1));//y (High) last peak //UP = upSwing DN = downSwing UP = xb>xa;//upSwing DN = xa>xb;//DownSwing SwingLow = IIf(UP,Ya,Yb); SwingHigh = IIf(UP,Yb,Ya); L1 = IIf(L1_switch,IIf(UP,yb-(yb-ya)*(L1_Level/100),IIf(DN,ya+(yb-ya)*(L1_Level/100),-1e10)),-1e10); L2 = IIf(L2_switch,IIf(UP,yb-(yb-ya)*(L2_Level/100),IIf(DN,ya+(yb-ya)*(L2_Level/100),-1e10)),-1e10); L3 = IIf(L3_switch,IIf(UP,yb-(yb-ya)*(L3_Level/100),IIf(DN,ya+(yb-ya)*(L3_Level/100),-1e10)),-1e10); L4 = IIf(L4_switch,IIf(UP,yb-(yb-ya)*(L4_Level/100),IIf(DN,ya+(yb-ya)*(L4_Level/100),-1e10)),-1e10); L5 = IIf(L5_switch,IIf(UP,yb-(yb-ya)*(L5_Level/100),IIf(DN,ya+(yb-ya)*(L5_Level/100),-1e10)),-1e10); L6 = IIf(L6_switch,IIf(UP,yb-(yb-ya)*(L6_Level/100),IIf(DN,ya+(yb-ya)*(L6_Level/100),-1e10)),-1e10); L7 = IIf(L7_switch,IIf(UP,yb-(yb-ya)*(L7_Level/100),IIf(DN,ya+(yb-ya)*(L7_Level/100),-1e10)),-1e10); CurrentRT_EXT = IIf(UP,-100*(yb-C)/(yb-ya),100*(C-ya)/(yb-ya));//Retracement_Value MaxRT_EXT = IIf(UP,-100*(yb-L)/(yb-ya),100*(H-ya)/(yb-ya));//Retracement_Value InZone = C<yb & C>ya;//filter to receive signals in a retracement zone. Distance = 0.5*ATR(14); Sup_break = Cross(Ya,C) & X>Xa; Sup_pricejustabove = L<Ya+Distance & L>Ya & X>Xa; Sup_confirmed = L<=Ya & C>Ya & X>Xa; Res_break = Cross(C,Yb) & X>Xb; Res_pricejustbelow = H>Yb-Distance & H<Yb & X>Xb; Res_confirmed = H>=Yb & C<Yb & X>Xb; SupSignals = Sup_break | Sup_pricejustabove | Sup_confirmed; ResSignals = Res_break | Res_pricejustbelow | Res_confirmed; BS = Sup_confirmed OR Res_break; SS = Res_confirmed OR Sup_break; Filter = BarIndex()==LastValue(BarIndex()) AND NOT GroupID()==253; Adddefaultcolumns(1,1); AddColumn(CurrentRT_EXT,"Current RT/EXT %"); AddColumn(MaxRT_EXT,"Current max. RT/EXT %"); AddTextColumn( WriteIf(Sup_pricejustabove,"Price just above", WriteIf(Sup_confirmed,"Confirmed", WriteIf(Sup_break,"Break",""))),"Swing Low",1.2, IIf(Sup_pricejustabove OR sup_confirmed,colorGreen,colorRed)); AddTextColumn( WriteIf(Res_pricejustbelow,"Price just below", WriteIf(Res_confirmed,"Confirmed", WriteIf(Res_break,"Break",""))),"Swing High",1.2, IIf(Res_pricejustbelow OR Res_confirmed,colorRed,colorGreen)); AddTextColumn(FullName(),"Full name"); //Anyline_zero AnZ= ya==0 OR yb==0 OR L1==0 OR L2==0 OR L3==0 OR L4==0 OR L5==0; xab = IIf(xb>xa,xb,xa); SLcol = IIf(Colorstyle,SwingLow_color,IIf( LastValue(C)<ya, Color_RL, Color_SL )); SHcol = IIf(Colorstyle,SwingHigh_color,IIf( LastValue(C)<yb, Color_RL, Color_SL )); Plot(IIf(x>=xa &NOT AnZ,ya,-1e10),"",SLcol,1+8 + 2048); Plot(IIf(x>=xb &NOT AnZ,yb,-1e10),"",SHcol,1+8 + 2048); L1col = IIf(Colorstyle,L1_color,IIf( LastValue(C)<L1, Color_RL, Color_SL )); L2col = IIf(Colorstyle,L2_color,IIf( LastValue(C)<L2, Color_RL, Color_SL )); L3col = IIf(Colorstyle,L3_color,IIf( LastValue(C)<L3, Color_RL, Color_SL )); L4col = IIf(Colorstyle,L4_color,IIf( LastValue(C)<L4, Color_RL, Color_SL )); L5col = IIf(Colorstyle,L5_color,IIf( LastValue(C)<L5, Color_RL, Color_SL )); L6col = IIf(Colorstyle,L6_color,IIf( LastValue(C)<L6, Color_RL, Color_SL )); L7col = IIf(Colorstyle,L7_color,IIf( LastValue(C)<L7, Color_RL, Color_SL )); Plot(IIf(x>=xab &NOT AnZ,L1,-1e10),"",L1col,L1_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L2,-1e10),"",L2col,L2_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L3,-1e10),"",L3col,L3_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L4,-1e10),"",L4col,L4_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L5,-1e10),"",L5col,L5_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L6,-1e10),"",L6col,L6_style+styleNoRescale); Plot(IIf(x>=xab &NOT AnZ,L7,-1e10),"",L7col,L7_style+styleNoRescale); PlotText(""+L1_level+" %",LastValue(BarIndex()+2),L1,L1col,colorDefault); PlotText(""+L2_level+" %",LastValue(BarIndex()+2),L2,L2col,colorDefault); PlotText(""+L3_level+" %",LastValue(BarIndex()+2),L3,L3col,colorDefault); PlotText(""+L4_level+" %",LastValue(BarIndex()+2),L4,L4col,colorDefault); PlotText(""+L5_level+" %",LastValue(BarIndex()+2),L5,L5col,colorDefault); PlotText(""+L6_level+" %",LastValue(BarIndex()+2),L6,L6col,colorDefault); PlotText(""+L7_level+" %",LastValue(BarIndex()+2),L7,L7col,colorDefault); PlotText("100 %",LastValue(BarIndex()+2),SwingLow,IIf(LastValue(up),SwingLow_color,SwingHigh_color),colorDefault); PlotText("0 %",LastValue(BarIndex()+2),Swinghigh,IIf(LastValue(dn),SwingLow_color,SwingHigh_color),colorDefault); Title = "Tradingbasis.com - Fibonacci Recognition"+ default_title + EncodeColor(IIf(NOT AnZ,colorLightBlue,colorRed))+", Sensitivity = " + WriteVal(Sensitivity,1)+ EncodeColor(colorRed)+WriteIf(NOT AnZ,""," NO POINTS AVAILABLE -> REDUCE SENSITIVITY")+ EncodeColor(IIf(LastValue(L)>0,Color_SL,Color_RL))+", Current Correction = "+WriteVal(CurrentRT_EXT,1.0)+"% "; _SECTION_BEGIN("Wilders"); P = ParamField("Price field",-1); Periods = Param("Periods", 15, 2, 200, 1, 10 ); Plot( Wilders( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر التمساح الثلاثاء نوفمبر 09, 2010 4:13 am | |
| معادلة مؤشر التمساح // Alligator & Price _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("Alligator"); A = ((H+L)/2); // Alligator Green Balance Line - Lip Lips = (Ref((Wilders(A,5)),-3)); // Alligator Blue Balance Line - Jaw Jaw = (Ref(Wilders(A,13),-8)); // Alligator Red Balance Line - Teeth Teeth = (Ref(Wilders(A,8),-5)); Plot(Lips,"LPIs",colorGreen); Plot(jaw,"JAW",colorBlue); Plot(teeth,"Teeth",colorRed); _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: الفيبو مع مؤشر اليباني الأربعاء ديسمبر 29, 2010 10:28 pm | |
| مؤشر اليبو اليباني //|------------------------------------------------------------------ //|Tradingbasis.com - Ichimoku Chart //|Version:1.0 04-April-2005 //|Copyright © 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> AddAlertParam(0,0,0); _SECTION_BEGIN("Main Parameters"); p1 = Param("Turning Line",9,5,20,1);//also known as Kijun Sen p2 = Param("Standard Line",26,5,40,1);//also known as Tenkan Sen p3 = Param("Delayed Line",26,5,40,1);//also known as Chikou Span _SECTION_END(); _SECTION_BEGIN("Styles"); TLstyle = ParamStyle("Turning Line",styleThick); SLstyle = ParamStyle("Standard Line",styleThick); DLstyle = ParamStyle("Delayed Line",styleThick|styleNoTitle); _SECTION_END(); GraphZOrder = 0; AddICHIMOKU(p1,p2,p3); HSB = 0; if(HSB) { _SECTION_BEGIN("Cloud 1"); Hue = Param("Hue",90,0,255,1); Saturation = Param("Saturation",255,0,255,1); Brightness = Param("Brightness",60,0,255,1); Cloud1color = ColorHSB(Hue,Saturation,Brightness); _SECTION_END(); _SECTION_BEGIN("Cloud 2"); Hue = Param("Hue",0,0,255,1); Saturation = Param("Saturation",180,0,255,1); Brightness = Param("Brightness",125,0,255,1); Cloud2color = ColorHSB(Hue,Saturation,Brightness); _SECTION_END(); } else { _SECTION_BEGIN("Colors"); TLcolor = ParamColor("Turning Line",colorYellow); SLcolor = ParamColor("Standard Line",colorWhite); DLcolor = ParamColor("Delayed Line",colorGrey50); Cloud1color = ParamColor("Cloud 1",colorSeaGreen); Cloud2color = ParamColor("Cloud 2",colorBlue); } #include <\TBInc\Tradingbasis_1.afl> GraphZOrder = 0; Buy = Cross(SL,TL); Sell = Cross(TL,SL); AddAlert(Buy,Audio,Email,"Tenken crossed Kijun-Sen"+DefaultAlertText,1,BarComplete); AddAlert(Sell,Audio,Email,"Kijun-Sen crossed Tenkan"+DefaultAlertText,2,BarComplete); _SECTION_BEGIN("Lines"); Plot(TL, "SL", TLcolor,TLstyle); Plot(SL, "TL", SLcolor,SLstyle); Plot(DL, "DL", DLcolor,DLstyle); PlotOHLC( 0, span1, span2, span2, "Cloud", IIf(span1>span2,Cloud1color,Cloud2color), styleCloud+styleNoTitle+styleNoLabel ); _SECTION_END(); Filter = NOT GroupID()==253; Filter = Filter AND (Buy OR Sell); Adddefaultcolumns(2,1); AddTextColumn(FullName(),"Full name"); Title = "Tradingbasis.com - Ichimoku Chart" + default_title + " "; _SECTION_BEGIN("Wilders"); P = ParamField("Price field",-1); Periods = Param("Periods", 15, 2, 200, 1, 10 ); Plot( Wilders( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") ); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); _SECTION_BEGIN("Tom DeMark Trend Lines"); /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ THIS SECTION DRAWS TD TREND LINES */ percent = 0.01 * 1; /* Adjust this percent as necessary, I use .01 because FOREX is a 0.0000 number */ firstpointL = 2; firstpointH = 2; y0=LastValue(Trough(L,percent,firstpointL)); y1=LastValue(Trough(Ref(L,-1),percent,1)); for( i = 1; i < BarCount AND y0 >= y1; i++ ) { firstpointL++; y0=LastValue(Trough(L,percent,firstpointL)); } x0=BarCount - 1 - LastValue(TroughBars(L,percent,firstpointL)); x1=BarCount - 1 - LastValue(TroughBars(Ref(L,-1),percent,1)); LineL = LineArray( x0, y0, x1, y1, 1 ); /* Plot(C, "C", colorBlack, styleCandle); */ Plot( LineL, " Support Trend line", colorWhite,4 +8 ); yt0=LastValue(Peak(H,percent,firstpointH)); yt1=LastValue(Peak(Ref(H,-1),percent,1)); for(i = 1; i < BarCount AND yt0 <= yt1; i++ ) { firstpointH++; yt0=LastValue(Peak(H,percent,firstpointH)); } xt0=BarCount - 1 - LastValue(PeakBars(H,percent,firstpointH)); xt1=BarCount - 1 - LastValue(PeakBars(Ref(H,-1),percent,1)); LineH = LineArray( xt0, yt0, xt1, yt1, 1 ); Plot( LineH, "Resistance Trend line", colorBrown,4 + 8 ); /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ _SECTION_END(); _SECTION_BEGIN("AA - Fibonacci Retracements and Goals"); /////////////////////////////////////////////////// // **************** Parameters ******************** // Period = Param("Period", 1, 1, 50); ShowExt = ParamToggle("Show Extension ?", "No|Yes"); /////////////////////////////////////////////////// // **************** Calculations ***************** // Period = Period*(13*.618); Hhb = LastValue(Ref(HHVBars(H, Period), -1))+1; Llb = LastValue(Ref(LLVBars(L, Period), -1))+1; Hv = LastValue(Ref(HHV(H, Period), -1)); Lv = LastValue(Ref(LLV(L, Period), -1)); Range = (Hv - Lv); LText = "0 %, 21.4 %, 38.2 %, 50 %, 61.8 %, 78.6 %, 100 %, 1.618 %, 1.72 %, 200 %"; if(Hhb > Llb) { Levels[0] = Lv; Levels[1]= (Range *.214)+Levels[0]; Levels[2]= (Range *.382)+Levels[0]; Levels[3]= (Range *.5)+Levels[0]; Levels[4]= (Range *.618)+Levels[0]; Levels[5]= (Range *.786)+Levels[0]; Levels[6]= Hv; Levels[7]= (Range *.618)+Levels[6]; Levels[8]= (Range *.72)+Levels[6]; Levels[9]= (Range )+Levels[6]; x0 = BarCount - 1 - Llb; x1 = BarCount - 1 - Hhb; } else { Levels[0]= Hv; Levels[1]= Levels[0]- (Range *.214); Levels[2]= Levels[0]- (Range *.382); Levels[3]= Levels[0]- (Range *.5); Levels[4]= Levels[0]- (Range *.618); Levels[5]= Levels[0]- (Range *.786); Levels[6]= Lv; Levels[7]= Levels[6]- (Range *.618); Levels[8]= Levels[6]- (Range *.72); Levels[9]= Levels[6]- (Range ); x0 = BarCount - 1 - Hhb; x1 = BarCount - 1 - Llb; } ////////////////////////////////////////////////////////////////////////////////////// /// **************************** Plotting Area ******************************** // Plot(C, "", IIf(C > O, colorBrightGreen, colorRed), ParamStyle("Price Style", styleBar, maskPrice)); for(i=0; i<10; i++) { if(i!=6) x = x0; else x = x1; if(i<7 OR ShowExt) { Plot(LineArray(x, Levels[i], BarCount, Levels[i]), "", i+2, styleDots); PlotText(StrExtract(LText, i), BarCount, Levels[i], i+2); } } Title = FullName()+" - "+Name()+"\nO:"+O+", H:"+H+", L:"+L+", C:"+C; _SECTION_END(); _SECTION_BEGIN("Unnamed 7"); //Support and resistance levels using RSI. //graham Kavanagh May 2003 //Load into Indicator Builder //Sensitivity of the levels can be changed with the variables //Can test different numbers live with the Param function ctrl-R with open pane RSIperiod = 5; // Param("RSI p",3,14,30,1); Percent = 5; // Param("ZIG %",8,9,15,1); EMAperiod = 5; //Param("EMA p",4,5,10,1); HHVperiod = 5; //Param("HHV p",3,5,10,1); NumLine = 1; //Param("Num Lines",3,1,20,1); Base = DEMA(RSI(RSIperiod),EMAperiod); GraphXSpace=0.5; Plot(C,"",colorBlack,styleCandle); for( i = 1; i <= numline; i++ ) { ResBase = LastValue(Peak(Base,Percent,i)); SupBase = LastValue(Trough(Base,Percent,i)); Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorRed, styleLine); Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorGreen, styleLine); } Title = Name() + "; " + Date() + ": Support & Resistance Levels using RSI: " + /*EncodeColor(colorGreen)+ "Support Levels are Green; "+EncodeColor(colorRed)+ "Resistance Levels are Red: "+EncodeColor(colorBlack)+*/ "Num lines ="+WriteVal(numline,1) ; // Linear Regression Line with 2 Standard Deviation Channels Plotted Above and Below // Written by Patrick Hargus, with critical hints from Marcin Gorzynski, Amibroker.com Technical Support // Designed for use with AB 4.63 beta and above, using drag and drop feature. // Permits plotting a linear regression line of any price field available on the chart for a period determined by the user. // 2 Channels, based on a standard deviation each determined by the user, are plotted above and below the linear regression line. // A look back feature is also provided for examining how the indicator would have appeared on a chart X periods in the past. P = ParamField("Price field",-1); Daysback = Param("Period for Liner Regression Line",21,1,240,1); shift = Param("Look back period",0,0,240,1); // =============================== Math Formula ============================================================= x = Cum(1); lastx = LastValue( x ) - shift; aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); _SECTION_BEGIN("??? ???????"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,1); _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: الفيبو متكامل الأربعاء ديسمبر 29, 2010 10:33 pm | |
| الفيبـــــــــــو متكامل
_SECTION_BEGIN("AA - Fibonacci Retracements and Goals"); /////////////////////////////////////////////////// // **************** Parameters ******************** // Period = Param("Period", 1, 1, 50); ShowExt = ParamToggle("Show Extension ?", "No|Yes"); /////////////////////////////////////////////////// // **************** Calculations ***************** // Period = Period*(13*.618);
Hhb = LastValue(Ref(HHVBars(H, Period), -1))+1; Llb = LastValue(Ref(LLVBars(L, Period), -1))+1; Hv = LastValue(Ref(HHV(H, Period), -1)); Lv = LastValue(Ref(LLV(L, Period), -1));
Range = (Hv - Lv); LText = "0 %, 21.4 %, 38.2 %, 50 %, 61.8 %, 78.6 %, 100 %, 1.618 %, 1.72 %, 200 %"; if(Hhb > Llb) { Levels[0] = Lv; Levels[1]= (Range *.214)+Levels[0]; Levels[2]= (Range *.382)+Levels[0]; Levels[3]= (Range *.5)+Levels[0]; Levels[4]= (Range *.618)+Levels[0]; Levels[5]= (Range *.786)+Levels[0]; Levels[6]= Hv; Levels[7]= (Range *.618)+Levels[6]; Levels[8]= (Range *.72)+Levels[6]; Levels[9]= (Range )+Levels[6]; x0 = BarCount - 1 - Llb; x1 = BarCount - 1 - Hhb; } else { Levels[0]= Hv; Levels[1]= Levels[0]- (Range *.214); Levels[2]= Levels[0]- (Range *.382); Levels[3]= Levels[0]- (Range *.5); Levels[4]= Levels[0]- (Range *.618); Levels[5]= Levels[0]- (Range *.786); Levels[6]= Lv; Levels[7]= Levels[6]- (Range *.618); Levels[8]= Levels[6]- (Range *.72); Levels[9]= Levels[6]- (Range ); x0 = BarCount - 1 - Hhb; x1 = BarCount - 1 - Llb; }
////////////////////////////////////////////////////////////////////////////////////// /// **************************** Plotting Area ******************************** // Plot(C, "", IIf(C > O, colorBrightGreen, colorRed), ParamStyle("Price Style", styleBar, maskPrice)); for(i=0; i<10; i++) { if(i!=6) x = x0; else x = x1; if(i<7 OR ShowExt) { Plot(LineArray(x, Levels[i], BarCount, Levels[i]), "", i+2, styleDots); PlotText(StrExtract(LText, i), BarCount, Levels[i], i+2); } } Title = FullName()+" - "+Name()+"\nO:"+O+", H:"+H+", L:"+L+", C:"+C; _SECTION_END(); | |
| | | الياقوت الإدارة
عدد المساهمات : 99 تاريخ التسجيل : 23/09/2007 الموقع : ياالله حسن الخاتمة
| موضوع: مؤشر الدعم والمقاومة الجمعة فبراير 18, 2011 3:32 am | |
| مؤشر الدعم والمقاومة : _SECTION_BEGIN("pivot finder"); /* ********************************** Code to automatically identify pivots ********************************** */ // -- what will be our lookback range for the hh and ll? farback=Param("How Far back to go",100,50,5000,10); nBars = Param("Number of bars", 12, 5, 40); // -- Title. Title = Name() + " (" + StrLeft(FullName(), 15) + ") O: " + Open + ", H: " + High + ", L: " + Low + ", C: " + Close; // -- Plot basic candle chart PlotOHLC(Open, High, Low, Close, "BIdx = " + BarIndex() + "\n" + "O = " + O + "\n"+"H = "+ H + "\n"+"L = " + L + "\n"+"C ", colorBlack, styleCandle); GraphXSpace=7; // -- Create 0-initialized arrays the size of barcount aHPivs = H - H; aLPivs = L - L; // -- More for future use, not necessary for basic plotting aHPivHighs = H - H; aLPivLows = L - L; aHPivIdxs = H - H; aLPivIdxs = L - L; nHPivs = 0; nLPivs = 0; lastHPIdx = 0; lastLPIdx = 0; lastHPH = 0; lastLPL = 0; curPivBarIdx = 0; // -- looking back from the current bar, how many bars // back were the hhv and llv values of the previous // n bars, etc.? aHHVBars = HHVBars(H, nBars); aLLVBars = LLVBars(L, nBars); aHHV = HHV(H, nBars); aLLV = LLV(L, nBars); // -- Would like to set this up so pivots are calculated back from // last visible bar to make it easy to "go back" and see the pivots // this code would find. However, the first instance of // _Trace output will show a value of 0 aVisBars = Status("barvisible"); nLastVisBar = LastValue(Highest(IIf(aVisBars, BarIndex(), 0))); _TRACE("Last visible bar: " + nLastVisBar); // -- Initialize value of curTrend curBar = (BarCount-1); curTrend = ""; if (aLLVBars[curBar] < aHHVBars[curBar]) { curTrend = "D"; } else { curTrend = "U"; } // -- Loop through bars. Search for // entirely array-based approach // in future version for (i=0; i<farback; i++) { curBar = (BarCount - 1) - i; // -- Have we identified a pivot? If trend is down... if (aLLVBars[curBar] < aHHVBars[curBar]) { // ... and had been up, this is a trend change if (curTrend == "U") { curTrend = "D"; // -- Capture pivot information curPivBarIdx = curBar - aLLVBars[curBar]; aLPivs[curPivBarIdx] = 1; aLPivLows[nLPivs] = L[curPivBarIdx]; aLPivIdxs[nLPivs] = curPivBarIdx; nLPivs++; } // -- or current trend is up } else { if (curTrend == "D") { curTrend = "U"; curPivBarIdx = curBar - aHHVBars[curBar]; aHPivs[curPivBarIdx] = 1; aHPivHighs[nHPivs] = H[curPivBarIdx]; aHPivIdxs[nHPivs] = curPivBarIdx; nHPivs++; } // -- If curTrend is up...else... } // -- loop through bars } // -- Basic attempt to add a pivot this logic may have missed // -- OK, now I want to look at last two pivots. If the most // recent low pivot is after the last high, I could // still have a high pivot that I didn't catch // -- Start at last bar curBar = (BarCount-1); candIdx = 0; candPrc = 0; lastLPIdx = aLPivIdxs[0]; lastLPL = aLPivLows[0]; lastHPIdx = aHPivIdxs[0]; lastHPH = aHPivHighs[0]; if (lastLPIdx > lastHPIdx) { // -- Bar and price info for candidate pivot candIdx = curBar - aHHVBars[curBar]; candPrc = aHHV[curBar]; if ( lastHPH < candPrc AND candIdx > lastLPIdx AND candIdx < curBar) { // -- OK, we'll add this as a pivot... aHPivs[candIdx] = 1; // ...and then rearrange elements in the // pivot information arrays for (j=0; j<nHPivs; j++) { aHPivHighs[nHPivs-j] = aHPivHighs[nHPivs- (j+1)]; aHPivIdxs[nHPivs-j] = aHPivIdxs[nHPivs-(j+1)]; } aHPivHighs[0] = candPrc ; aHPivIdxs[0] = candIdx; nHPivs++; } } else { // -- Bar and price info for candidate pivot candIdx = curBar - aLLVBars[curBar]; candPrc = aLLV[curBar]; if ( lastLPL > candPrc AND candIdx > lastHPIdx AND candIdx < curBar) { // -- OK, we'll add this as a pivot... aLPivs[candIdx] = 1; // ...and then rearrange elements in the // pivot information arrays for (j=0; j<nLPivs; j++) { aLPivLows[nLPivs-j] = aLPivLows[nLPivs-(j+1)]; aLPivIdxs[nLPivs-j] = aLPivIdxs[nLPivs-(j+1)]; } aLPivLows[0] = candPrc; aLPivIdxs[0] = candIdx; nLPivs++; } } // -- Dump inventory of high pivots for debugging /* for (k=0; k<nHPivs; k++) { _TRACE("High pivot no. " + k + " at barindex: " + aHPivIdxs[k] + ", " + WriteVal(ValueWhen(BarIndex()==aHPivIdxs[k], DateTime(), 1), formatDateTime) + ", " + aHPivHighs[k]); } */ // -- OK, let's plot the pivots using arrows PlotShapes( IIf(aHPivs==1, shapeDownArrow, shapeNone), colorRed, 0, High, Offset=-15); PlotShapes( IIf(aLPivs==1, shapeUpArrow , shapeNone), colorGreen, 0, Low, Offset=-15); _SECTION_END(); _SECTION_BEGIN("Triangular Moving average"); //Triangular Moving average //Anthony Faragasso //December, 2002 /* A Triangular moving average is similar to exponential AND weighted moving averages except A different weighting scheme is used. Exponential AND Weighted averages assign the majority of the weight to the most recent data. Simple moving averages assign the weight equally across all the data. With A Triangular moving average, the majority of the weight is assigned to the middle portion of the data.*/ Odd=13;//enter Odd numbers only CoefOdd=round(Odd/2); Even=12;//enter Even numbers only Coefeven=Even/2; Coefeven2=Coefeven+1; CongestionPercent=2.8;/*Set % above/below Moving average for congestion / sideways market*/ TriangularOdd=MA(MA(C,CoefOdd),CoefOdd); TriangularEven=MA(MA(C,Coefeven),Coefeven2); finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven); Color=colorBrightGreen;//select Moving average line color tickercolor=colorBlack;//select price color Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick); Plot(C,"",tickercolor,styleCandle); Title=Name()+"..."+"( "+WriteIf(Odd > even,WriteVal(Odd,1),WriteVal(even,1))+" ) Period "+EncodeColor(Color)+"Triangular"+WriteIf(Odd > even,"ODD","EVEN")+" Moving Average"+"..."+EncodeColor(colorBlack)+ WriteIf(C < finalMov_avg,"Close is "+EncodeColor(colorRed)+"Below"+EncodeColor(colorBlack)+" Moving Average by ","Close is"+EncodeColor(colorBrightGreen)+" Above"+EncodeColor(colorBlack)+" Moving Average by ")+"("+WriteVal(((C/finalMov_avg)-1)*100,1.1)+"% )"+"\n"+WriteIf(finalmov_avg-Ref(finalmov_avg,-1)>0," Slope Of Average is UP : ","Slope Of Average is DOWN :")+WriteIf((((C/finalMov_avg)-1)*100 <= CongestionPercent AND ((C/finalMov_avg)-1)*100 >= -CongestionPercent),EncodeColor(colorYellow)+" with Price Congestion / Divergence to Average ","")+"\n"+WriteIf(Ref(C,-1) < Ref(finalmov_avg,-1) AND C > finalmov_avg,EncodeColor(colorGreen)+"Possible Change in Trend From Down to Up"+"\n"+" OR Short Term Correction of Previous Trend",WriteIf(Ref(C,-1) > Ref(finalmov_avg,-1) AND C < finalmov_avg,EncodeColor(colorRed)+"Possible Change in Trend From Up to Down "+"\n"+" OR Short Term Correction to Previous Trend",""))+"\n"+WriteIf(C > finalmov_avg,EncodeColor(colorGreen)+"Close has been above Moving Average ( "+WriteVal(BarsSince(C < finalmov_avg),1)+" ) Bars",EncodeColor(colorRed)+"Close has been Below Moving Average ( "+WriteVal(BarsSince(C > finalmov_avg),1)+" ) Bars")+"\n"+EncodeColor(colorBlack)+"The average # of Bars Above ( "+WriteVal(round(Cum(BarsSince(C < finalmov_avg)/Cum(1))),1)+" )"+"\n"+"The average # of Bars Below ( "+WriteVal(round(Cum(BarsSince(C > finalmov_avg)/Cum(1))),1)+" )"; _SECTION_END(); //|------------------------------------------------------------------ //|Tradingbasis.com - Fractals //|Version:1.8 06-June-2006 //|Copyright © 2005, Tradingbasis.com //|http://www.tradingbasis.com //|e-mail: support@tradingbasis.com//|------------------------------------------------------------------ SetChartOptions(0,chartShowDates|chartShowArrows|chartWrapTitle); #pragma nocache #include <\TBInc\Tradingbasis_f0.afl> AddAlertParam(0,0,0); _SECTION_BEGIN("Alerts"); SRbS = ParamToggle("S/R broken","Off,On",1); SRcS = ParamToggle("S/R confirmed","Off,On",1); PjabS = ParamToggle("Price just above/below","Off,On",1); _SECTION_END(); _SECTION_BEGIN("Main parameters"); SRplot = ParamToggle("Plot S/R","Off,On",1); Sswitch = ParamToggle("PLot Swing Chart","Off,On",0); Shswitch = ParamToggle("Plot Swing Shapes","Off,On",0); SwingPeriod = Param("Swing Period",5,0.1,40,0.1); _SECTION_END(); _SECTION_BEGIN("Styles"); Swingstyle = ParamStyle("Swing Line",styleLine|styleThick,maskDefault); TopShape = Param("Top Fractal Typ",21,0,50,1); ValleyShape = Param("Valley Fractal Typ",22,0,50,1); _SECTION_END(); _SECTION_BEGIN("Colors"); SLC = ParamColor("Swing Low",colorPaleGreen); SHC = ParamColor("Swing High",colorLightOrange); Swingcolor = ParamColor("Swing Line",colorLime); Topshapecolor = ParamColor("Top Fractal",colorRed); Valleyshapecolor = ParamColor("Bottom Fractal",colorLime); _SECTION_END(); #include <\TBInc\Tradingbasis_1.afl> Hp1 = Ref(H,-1);Hp2 = Ref(H,-2); Lp1 = Ref(L,-1);Lp2 = Ref(L,-2); Hf1 = Ref(H,1);Hf2 = Ref(H,2); Lf1 = Ref(L,1);Lf2 = Ref(L,2); x = Cum(1); divx = LastValue(x)-x; //Tops A = H; Top = A > Hf2 & A > Hf1 & A > Hp1 & A > Hp2 & divx>2; TopHigh = ValueWhen(Top,H); TopX = ValueWhen(Top,X); x_lasttop = LastValue(ValueWhen(top,x,1)); //Valleys A = L; Valley = A < Lf2 & A <= Lf1 & A <= Lp1 & A < Lp2 & divx>2; ValleyLow = ValueWhen(Valley,L); ValleyX = ValueWhen(Valley,X); x_lastvalley = LastValue(ValueWhen(Valley,x,1)); PlotShapes(IIf(Top,TopShape,-1e10),Topshapecolor,0,H,12); PlotShapes(IIf(Valley,Valleyshape,-1e10),ValleyShapecolor,0,L,12); Plot(IIf(SRplot & x>= x_lasttop,LastValue(ValueWhen(top,H,1)),Null),"",Topshapecolor,1); Plot(IIf(SRplot & x>= x_lastvalley,LastValue(ValueWhen(Valley,L,1)),Null),"",Valleyshapecolor,1); Distance = 0.5*ATR(14); //Support line signals Sup_break = Cross(ValleyLow,C) & Ref(LowestSince(Ref(Valley,-1),Low)>ValleyLow,-1) & X-ValleyX >2; Sup_pricejustabove = L<ValleyLow+Distance & L>ValleyLow & LowestSince(Ref(Valley,-1),Low,1)>ValleyLow & X-ValleyX >2; Sup_confirmed = L<=ValleyLow & C>ValleyLow & Ref(LowestSince(Ref(Valley,-1),Low)>ValleyLow,-1) & X-ValleyX >2; //Resistance line signals Res_break = Cross(C,TopHigh) & Ref(HighestSince(Ref(Top,-1),High)<TopHigh,-1) & X-TopX >2; Res_pricejustbelow = H>TopHigh-Distance & H<TopHigh & HighestSince(Ref(Top,-1),High)<TopHigh & X-ValleyX >2; Res_confirmed = H>=TopHigh & C<TopHigh & Ref(HighestSince(Ref(Top,-1),High)<TopHigh,-1) & X-ValleyX >2; SupSignals = Sup_break | Sup_pricejustabove | Sup_confirmed; ResSignals = Res_break | Res_pricejustbelow | Res_confirmed; BS = Sup_confirmed OR Res_break; SS = Res_confirmed OR Sup_break; Buy = BS; Sell = SS; Filter = BarIndex()==LastValue(BarIndex()) AND NOT GroupID()==253; Filter = Filter AND (SupSignals OR ResSignals); Adddefaultcolumns(2,1); AddTextColumn( WriteIf(Sup_pricejustabove,"Price just above", WriteIf(Sup_confirmed,"Confirmed", WriteIf(Sup_break,"Break",""))),"Support",1.2, IIf(Sup_pricejustabove OR sup_confirmed,colorGreen,colorRed)); AddTextColumn( WriteIf(Res_pricejustbelow,"Price just below", WriteIf(Res_confirmed,"Confirmed", WriteIf(Res_break,"Break",""))),"Resistance",1.2, IIf(Res_pricejustbelow OR Res_confirmed,colorRed,colorGreen)); AddTextColumn(FullName(),"Full name"); ZZ = Zig(C,LastValue(SwingPeriod)); PivotLow = Ref(IIf(Ref(ROC(ZZ,1),-1) < 0 AND ROC(ZZ,1) > 0, 1, Null),1); PivotHigh = Ref(IIf(Ref(ROC(ZZ,1),-1) > 0 AND ROC(ZZ,1) < 0, 1, Null),1); PlotShapes(IIf(Shswitch AND PivotLow,shapeCircle,Null), SLC,0,L,-35) ; PlotShapes(IIf(Shswitch AND PivotHigh,shapeCircle,Null),SHC,0,H, 35) ; Plot(IIf(Sswitch,ZZ,Null)," ",Swingcolor,Swingstyle + styleNoTitle); // Alerts //////////////////////////////////////////////////////////////////// Alerttext = ""; /* DefaultAlertText +", " +"\nSupport Line = "+ WriteVal(ValleyLow)+", " +"\nResistance Line = "+WriteVal(TopHigh); */ if(SRbS){ AddAlert(Res_break,Audio,Email,"Resistance broken"+AlertText,2,BarComplete); AddAlert(Sup_break,Audio,Email,"Support broken"+AlertText,2,BarComplete); } if(SRcS){ AddAlert(Sup_confirmed,Audio,Email,"Support confirmed"+AlertText,1,BarComplete); AddAlert(Res_confirmed,Audio,Email,"Resistance confirmed"+AlertText,2,BarComplete); } if(PjabS){ AddAlert(Sup_pricejustabove,Audio,Email,"Price just above Support"+AlertText,1,BarComplete); AddAlert(Res_pricejustbelow,Audio,Email,"Price just below Resistance"+AlertText,2,BarComplete); } //////////////////////////////////////////////////////////////////////////// Title = "Tradingbasis.com - Fractals" +default_title; | |
| | | | معادلات الايمي بركر | |
|
مواضيع مماثلة | |
|
| صلاحيات هذا المنتدى: | لاتستطيع الرد على المواضيع في هذا المنتدى
| |
| |
| |
|