Metatrader Expert Advisor

Indicatore MetaTrader //+------------------------------------------------------------------+ //| ATR ratio.mq4 | //| Copyright © 2005, Luis Guilherme Damiani | //| http://www.damianifx.com.br | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, Luis Guilherme Damiani" #property link "http://www.damianifx.com.br" #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Silver #property indicator_color2 Violet //---- input parameters extern int short_atr=7; extern int long_atr=49; extern double triglevel=1.00; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //Comment("ATR ratio= "+short_atr+" / "+long_atr); for(int i=0;i<Bars-counted_bars;i++) { ExtMapBuffer1[i]=triglevel; double sa=iATR(NULL,0,short_atr,i); ExtMapBuffer2[i]= sa/iATR(NULL,0,long_atr,i); } //---- //---- return(0); } //+------------------------------------------------------------------+
Indicatore MetaTrader //+------------------------------------------------------------------+ //| ATR Levels New.mq4 | //| Tamir Bleicher | //+------------------------------------------------------------------+ #property copyright "Tamir Bleicher" #property indicator_chart_window extern int ATRPeriod = 10; extern string TimeFrame = "D"; extern bool IgnoreSunday = true; extern int MinVolume = 1; extern color DynamicLevel = Teal; extern color StaticLevel=Indigo; extern color OpenLevel=Navy; extern int LevelBarDisplay=40; extern string Remark1 = "=========================================================================="; extern string Remark2 = "TimeFrames: MN-Monthly W-Weekly D-Daily H4-4 Hours H1- 1 Hour M30-30 Minutes M15-15 Minutes M5-5 Minutes M1-1 Minute =="; extern string Remark3 = "IgnoreSunday is relevant only for Daily levels"; extern string Remark4 = "MinVolue is the minimum volume to take in ATR calculation in order to skip holidays"; extern string Remark5 = "LevelBarDisplay is the line titles and value position in bars, counting backward from the last bar"; extern string Remark6 = "Levels are: Dynamic levels (support and resist), Static Levels (support and resist) and open period level"; double rates_d1[][6]; double Static_Resist, Dynamic_Resist, Static_Support, Dynamic_Support, atr; int periods, TF; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- if (TimeFrame=="MN" || TimeFrame=="mn" || TimeFrame=="M" || TimeFrame=="m") TF=PERIOD_MN1; else if (TimeFrame=="W" || TimeFrame=="w") TF=PERIOD_W1; else if (TimeFrame=="D" || TimeFrame=="d") TF=PERIOD_D1; else if (TimeFrame=="H4" || TimeFrame=="h4") TF=PERIOD_H4; else if (TimeFrame=="H1" || TimeFrame=="h1") TF=PERIOD_H1; else if (TimeFrame=="M30" || TimeFrame=="m30") TF=PERIOD_M30; else if (TimeFrame=="M15" || TimeFrame=="m15") TF=PERIOD_M15; else if (TimeFrame=="M5" || TimeFrame=="m5") TF=PERIOD_M5; else if (TimeFrame=="M1" || TimeFrame=="m1") TF=PERIOD_M1; else TF=PERIOD_D1; return(0); } int deinit() { ObjectDelete("ATR Static Resist"); ObjectDelete("ATR Static Support"); ObjectDelete("ATR Static Support Label"); ObjectDelete("ATR Static Resist Label"); ObjectDelete("Period Open"); ObjectDelete("ATR Dynamic Resist"); ObjectDelete("ATR Dynamic Support"); ObjectDelete("ATR Dynamic Support Label"); ObjectDelete("ATR Dynamic Resist Label"); ObjectDelete("Period Open Label"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); string Remark; int Yesterday; ArrayCopyRates(rates_d1, Symbol(), TF); atr = ATR(Symbol(), TF, ATRPeriod, 1, IgnoreSunday); switch(TF) { case PERIOD_MN1: Remark="(Monthly)"; break; case PERIOD_W1: Remark="(Weekly)"; break; case PERIOD_D1: if (IgnoreSunday) Remark="(Daily ignoring Sundays)"; else Remark="(Daily including Sundays)"; break; case PERIOD_H4: Remark="(4 Hours)"; break; case PERIOD_H1: Remark="(1 Hour)"; break; case PERIOD_M30: Remark="(30 Minutes)"; break; case PERIOD_M15: Remark="(15 Minutes)"; break; case PERIOD_M5: Remark="(5 Minutes)"; break; case PERIOD_M1: Remark="(1 Minute)"; break; } Comment("ATR (",ATRPeriod,") = ",atr," ",Remark); if (TF==PERIOD_D1 && IgnoreSunday && TimeDayOfWeek(iTime(NULL,TF,1))==0) Yesterday=2; else Yesterday=1; Static_Support = rates_d1[Yesterday][3] - atr; Static_Resist = rates_d1[Yesterday][2] + atr; Dynamic_Support = rates_d1[0][3] - atr; Dynamic_Resist = rates_d1[0][2] + atr; if (ObjectFind("ATR Static Resist") != 0) { ObjectCreate("ATR Static Resist",OBJ_HLINE,0,Time[0],Static_Resist); ObjectSet("ATR Static Resist",OBJPROP_COLOR,StaticLevel); ObjectSet("ATR Static Resist",OBJPROP_WIDTH,1); } else { ObjectMove("ATR Static Resist", 0,Time[0],Static_Resist); } if (ObjectFind("ATR Static Support") != 0) { ObjectCreate("ATR Static Support",OBJ_HLINE,0,Time[0],Static_Support); ObjectSet("ATR Static Support",OBJPROP_COLOR,StaticLevel); ObjectSet("ATR Static Support",OBJPROP_WIDTH,1); } else { ObjectMove("ATR Static Support", 0,Time[0],Static_Support); } if (ObjectFind("ATR Dynamic Resist") != 0) { ObjectCreate("ATR Dynamic Resist",OBJ_HLINE,0,Time[0],Dynamic_Resist); ObjectSet("ATR Dynamic Resist",OBJPROP_COLOR,DynamicLevel); ObjectSet("ATR Dynamic Resist",OBJPROP_WIDTH,1); } else { ObjectMove("ATR Dynamic Resist", 0,Time[0],Dynamic_Resist); } if (ObjectFind("ATR Dynamic Support") != 0) { ObjectCreate("ATR Dynamic Support",OBJ_HLINE,0,Time[0],Dynamic_Support); ObjectSet("ATR Dynamic Support",OBJPROP_COLOR,DynamicLevel); ObjectSet("ATR Dynamic Support",OBJPROP_WIDTH,1); } else { ObjectMove("ATR Dynamic Support", 0,Time[0],Dynamic_Support); } if (ObjectFind("Period Open") != 0) { ObjectCreate("Period Open",OBJ_HLINE,0,Time[LevelBarDisplay],iOpen(0,TF,0)); ObjectSet("Period Open",OBJPROP_COLOR,OpenLevel); ObjectSet("Period Open",OBJPROP_STYLE,STYLE_DOT); } else { ObjectMove("Period Open", 0,Time[LevelBarDisplay],iOpen(0,TF,0)); } if(ObjectFind("ATR Static Resist Label") != 0) { ObjectCreate("ATR Static Resist Label", OBJ_TEXT, 0, Time[LevelBarDisplay], Static_Resist); ObjectSetText("ATR Static Resist Label", "ATR Static res: " + DoubleToStr(Static_Resist,4), 8, "Verdana", Black); } else { ObjectMove("ATR Static Resist Label", 0, Time[LevelBarDisplay], Static_Resist); } if(ObjectFind("ATR Static Support Label") != 0) { ObjectCreate("ATR Static Support Label", OBJ_TEXT, 0, Time[LevelBarDisplay], Static_Support); ObjectSetText("ATR Static Support Label", "ATR Static sup: " + DoubleToStr(Static_Support,4), 8, "Verdana", Black); } else { ObjectMove("ATR Static Support Label", 0, Time[LevelBarDisplay], Static_Support); } if(ObjectFind("ATR Dynamic Resist Label") != 0) { ObjectCreate("ATR Dynamic Resist Label", OBJ_TEXT, 0, Time[LevelBarDisplay], Dynamic_Resist); ObjectSetText("ATR Dynamic Resist Label", "ATR Dynamic res: " + DoubleToStr(Dynamic_Resist,4), 8, "Verdana", Black); } else { ObjectMove("ATR Dynamic Resist Label", 0, Time[LevelBarDisplay], Dynamic_Resist); } if(ObjectFind("ATR Dynamic Support Label") != 0) { ObjectCreate("ATR Dynamic Support Label", OBJ_TEXT, 0, Time[LevelBarDisplay], Dynamic_Support); ObjectSetText("ATR Dynamic Support Label", "ATR Dynamic sup: " + DoubleToStr(Dynamic_Support,4), 8, "Verdana", Black); } else { ObjectMove("ATR Dynamic Support Label", 0, Time[LevelBarDisplay], Dynamic_Support); } if(ObjectFind("Period Open Label") != 0) { ObjectCreate("Period Open Label", OBJ_TEXT, 0, Time[LevelBarDisplay], iOpen(0,TF,0)); ObjectSetText("Period Open Label", "Period Open: " + DoubleToStr(iOpen(0,TF,0),4), 8, "Verdana", Black); } else { ObjectMove("Period Open Label", 0, Time[LevelBarDisplay], iOpen(0,TF,0)); } return(0); } //+------------------------------------------------------------------+ double ATR(string Sym, int TimeFrame, int Per, int Shift, bool Sunday_FLG) { int i,j, Today_DOW,Yesterday_DOW; double h,l,c,tr,tr_sum=0; bool Sunday_Case; if (TimeFrame!=PERIOD_D1 || Sunday_FLG==false) return(iATR(Sym, TimeFrame, Per, Shift)); else for (i=0, j=0; i<Per; i++, j++) { while(iVolume(Sym,TimeFrame,Shift+j)<=MinVolume) j++; Today_DOW=TimeDayOfWeek(iTime(Sym,TimeFrame,Shift+j)); Yesterday_DOW=TimeDayOfWeek(iTime(Sym,TimeFrame,Shift+j+1)); if (Today_DOW==1 && Yesterday_DOW==0) { Sunday_Case=true; c=iClose(Sym,TimeFrame,Shift+j+2); h=MathMax(iHigh(Sym,TimeFrame,Shift+j),iHigh(Sym,TimeFrame,Shift+j+1)); l=MathMin(iLow(Sym,TimeFrame,Shift+j),iLow(Sym,TimeFrame,Shift+j+1)); } else { Sunday_Case=false; c=iClose(Sym,TimeFrame,Shift+j+1); h=iHigh(Sym,TimeFrame,Shift+j); l=iLow(Sym,TimeFrame,Shift+j); } if (c>h) tr=c-l; else if(c<l) tr=h-c; else tr=h-l; tr_sum=tr_sum+tr; // Ignore days with no volume if (Sunday_Case) j++; } return(tr_sum/Per); }
Indicatore MetaTrader /+------------------------------------------------------------------+ //| ATR Levels.mq4 | //| Mike Ischenko | //| Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloakcd5a8e5f4eb8b6a9c0f99ca19ebf32bc').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addycd5a8e5f4eb8b6a9c0f99ca19ebf32bc = 'mishanya_fx' + '@'; addycd5a8e5f4eb8b6a9c0f99ca19ebf32bc = addycd5a8e5f4eb8b6a9c0f99ca19ebf32bc + 'yahoo' + '.' + 'com'; var addy_textcd5a8e5f4eb8b6a9c0f99ca19ebf32bc = 'mishanya_fx' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloakcd5a8e5f4eb8b6a9c0f99ca19ebf32bc').innerHTML += ''+addy_textcd5a8e5f4eb8b6a9c0f99ca19ebf32bc+''; | //+------------------------------------------------------------------+ #property copyright "Mike Ischenko" #property link "Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloaka1450f0740f53445f229c1d23af0b593').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addya1450f0740f53445f229c1d23af0b593 = 'mishanya_fx' + '@'; addya1450f0740f53445f229c1d23af0b593 = addya1450f0740f53445f229c1d23af0b593 + 'yahoo' + '.' + 'com'; var addy_texta1450f0740f53445f229c1d23af0b593 = 'mishanya_fx' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloaka1450f0740f53445f229c1d23af0b593').innerHTML += ''+addy_texta1450f0740f53445f229c1d23af0b593+''; " #property indicator_chart_window extern int ATRPeriod = 10; double rates_d1[][6]; double H1, H2, H3, H4, H4t, H5, L5, L4, L4t, L3, L2, L1, halfatr, fullatr; int timeshift=0, timeshifts=0, beginner=0; int periods; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- TODO: add your code here ObjectDelete("H4atr line"); ObjectDelete("L4atr line"); ObjectDelete("L4atr label"); ObjectDelete("H4atr label"); ObjectDelete("H4tatr line"); ObjectDelete("L4tatr line"); ObjectDelete("L4tatr label"); ObjectDelete("H4tatr label"); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //if (counted_bars<1) return(0); switch (Period()) { case PERIOD_M1: {timeshifts=60; beginner=Hour()*60;} break; case PERIOD_M5: {timeshifts=300; beginner=Hour()*12;} break; case PERIOD_M15: {timeshifts=900; beginner=Hour()*4;} break; case PERIOD_M30: {timeshifts=1800; beginner=Hour()*2;} break; case PERIOD_H1: {timeshifts=3600; beginner=Hour()*1;} break; case PERIOD_H4: {timeshifts=14400; beginner=Hour()*0.25;} break; case PERIOD_D1: {timeshifts=86400; beginner=Hour()*0;} break; } timeshift=timeshifts*24; if(Period() > 86400) { Print("Error - Chart period is greater than 1 day."); return(-1); // then exit } ArrayCopyRates(rates_d1, Symbol(), PERIOD_D1); //beginner=Hour(); fullatr = iATR(Symbol(), PERIOD_D1, ATRPeriod, 1); L4 = rates_d1[1][3] - fullatr; H4 = rates_d1[1][2] + fullatr; L4t = rates_d1[0][3] - fullatr; H4t = rates_d1[0][2] + fullatr; halfatr = fullatr * 0.5; H1 = H4+1.5*fullatr; H2 = H4+fullatr; H3 = H4+halfatr; L3 = L4-halfatr; L2 = L4-fullatr; L1 = L4-1.5*fullatr; if (ObjectFind("H4atr Line") != 0) { ObjectCreate("H4atr line",OBJ_HLINE,0,Time[0],H4); ObjectSet("H4atr line",OBJPROP_COLOR,Yellow); ObjectSet("H4atr line",OBJPROP_WIDTH,1); } else { ObjectMove("H4atr line", 0,Time[0],H4); } if (ObjectFind("L4atr Line") != 0) { ObjectCreate("L4atr line",OBJ_HLINE,0,Time[0],L4); ObjectSet("L4atr line",OBJPROP_COLOR,Yellow); ObjectSet("L4atr line",OBJPROP_WIDTH,1); } else { ObjectMove("L4atr line", 0,Time[0],L4); } if (ObjectFind("H4tatr Line") != 0) { ObjectCreate("H4tatr line",OBJ_HLINE,0,Time[0],H4t); ObjectSet("H4tatr line",OBJPROP_COLOR,Yellow); ObjectSet("H4tatr line",OBJPROP_WIDTH,1); } else { ObjectMove("H4tatr line", 0,Time[0],H4t); } if (ObjectFind("L4tatr Line") != 0) { ObjectCreate("L4tatr line",OBJ_HLINE,0,Time[0],L4t); ObjectSet("L4tatr line",OBJPROP_COLOR,Yellow); ObjectSet("L4tatr line",OBJPROP_WIDTH,1); } else { ObjectMove("L4tatr line", 0,Time[0],L4t); } if(ObjectFind("H4atr label") != 0) { ObjectCreate("H4atr label", OBJ_TEXT, 0, Time[0]+timeshift, H4); ObjectSetText("H4atr label", "ATR(y) res: " + DoubleToStr(H4,4), 8, "Verdana", Yellow); } else { ObjectMove("H4atr label", 0, Time[0]+timeshift, H4); } if(ObjectFind("L4atr label") != 0) { ObjectCreate("L4atr label", OBJ_TEXT, 0, Time[0]+timeshift, L4); ObjectSetText("L4atr label", "ATR(y) sup: " + DoubleToStr(L4,4), 8, "Verdana", Yellow); } else { ObjectMove("L4atr label", 0, Time[0]+timeshift, L4); } if(ObjectFind("H4tatr label") != 0) { ObjectCreate("H4tatr label", OBJ_TEXT, 0, Time[0]+timeshift, H4t); ObjectSetText("H4tatr label", "ATR(t) res: " + DoubleToStr(H4t,4), 8, "Verdana", Yellow); } else { ObjectMove("H4tatr label", 0, Time[0]+timeshift, H4t); } if(ObjectFind("L4tatr label") != 0) { ObjectCreate("L4tatr label", OBJ_TEXT, 0, Time[0]+timeshift, L4t); ObjectSetText("L4tatr label", "ATR(t) sup: " + DoubleToStr(L4t,4), 8, "Verdana", Yellow); } else { ObjectMove("L4tatr label", 0, Time[0]+timeshift, L4t); } return(0); } //+------------------------------------------------------------------+
Qui di seguito potete vedere il codice dell'indicatore di Metatrader.//+------------------------------------------------------------------+ //| ATR Channels.mq4 | //| Copyright © 2005, Luis Guilherme Damiani | //| http://www.damianifx.com.br | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, Luis Guilherme Damiani" #property link "http://www.damianifx.com.br" #property indicator_chart_window #property indicator_buffers 7 #property indicator_color1 Aqua //Moving Average #property indicator_color2 DeepSkyBlue // Lower band 1 #property indicator_color3 DeepSkyBlue // Upper band 1 #property indicator_color4 RoyalBlue // Lower band 2 #property indicator_color5 RoyalBlue // Upper band 2 #property indicator_color6 BlueViolet // Lower band 3 #property indicator_color7 BlueViolet // Upper band 3 //---- indicator buffers double MA_Buffer0[]; double Ch1up_Buffer1[]; double Ch1dn_Buffer2[]; double Ch2up_Buffer3[]; double Ch2dn_Buffer4[]; double Ch3up_Buffer5[]; double Ch3dn_Buffer6[]; //---- input parameters extern int PeriodsATR=18; extern int MA_Periods=49; extern int MA_type=MODE_LWMA; extern double Mult_Factor1= 1.6; extern double Mult_Factor2= 3.2; extern double Mult_Factor3= 4.8; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string mat; //---7- indicators // MA SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,MA_Buffer0); SetIndexDrawBegin(0,0); /*if (MA_type==MODE_LWMA)SetIndexLabel(0,"WMA"+MA_Periods) else { if (MA_type==MODE_SMA) SetIndexLabel(0,"SMA"+MA_Periods) else { if (MA_type==MODE_EMA) SetIndexLabel(0,"EMA"+MA_Periods) else SetIndexLabel(0,"SMMA"+MA_Periods); }; };*/ // ATR 1 up SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,Ch1up_Buffer1); SetIndexDrawBegin(1,0); SetIndexLabel(1,"ATRu "+PeriodsATR+", "+Mult_Factor1); // ATR 1 down SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,Ch1dn_Buffer2); SetIndexDrawBegin(2,0); SetIndexLabel(2,"ATRd "+PeriodsATR+", "+Mult_Factor1); // ATR 2 up SetIndexStyle(3,DRAW_LINE); SetIndexBuffer(3,Ch2up_Buffer3); SetIndexDrawBegin(3,0); SetIndexLabel(3,"ATRu "+PeriodsATR+", "+Mult_Factor2); // ATR 2 down SetIndexStyle(4,DRAW_LINE); SetIndexBuffer(4,Ch2dn_Buffer4); SetIndexDrawBegin(4,0); SetIndexLabel(4,"ATRd "+PeriodsATR+", "+Mult_Factor2); // ATR 3 up SetIndexStyle(5,DRAW_LINE); SetIndexBuffer(5,Ch3up_Buffer5); SetIndexDrawBegin(5,0); SetIndexLabel(5,"ATRu "+PeriodsATR+", "+Mult_Factor3); // ATR 3 down SetIndexStyle(6,DRAW_LINE); SetIndexBuffer(6,Ch3dn_Buffer6); SetIndexDrawBegin(6,0); SetIndexLabel(6,"ATRd "+PeriodsATR+", "+Mult_Factor3); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() {//---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int fixed_bars=IndicatorCounted(); for(int i=0;i< Bars - fixed_bars;i++) { double atr=iATR(NULL,0,PeriodsATR,i); double ma=iMA(NULL,0,MA_Periods,0,MA_type,PRICE_TYPICAL,i); MA_Buffer0[i]=ma; Ch1up_Buffer1[i]=ma+atr*Mult_Factor1; Ch1dn_Buffer2[i]=ma-atr*Mult_Factor1; Ch2up_Buffer3[i]=ma+atr*Mult_Factor2; Ch2dn_Buffer4[i]=ma-atr*Mult_Factor2; Ch3up_Buffer5[i]=ma+atr*Mult_Factor3; Ch3dn_Buffer6[i]=ma-atr*Mult_Factor3; } //---- //---- return(0); }
Indicatore Metatrader - AltrTrend_Signal_v2_2//+------------------------------------------------------------------+ //| AltrTrend_Signal_v2_2.mq4 //| Ramdass - Conversion only //+------------------------------------------------------------------+ #property copyright "Author - OlegVS, GOODMAN" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Green #property indicator_color2 Crimson //---- input parameters extern int K=30; extern double Kstop=0.5; extern int Kperiod=150; extern int PerADX=14; extern int CountBars=350; //---- buffers double val1[]; double val2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line IndicatorBuffers(2); SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,108); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,108); SetIndexBuffer(0,val1); SetIndexBuffer(1,val2); //---- return(0); } //+------------------------------------------------------------------+ //| AltrTrend_Signal_v2_2 | //+------------------------------------------------------------------+ int start() { if (CountBars>=Bars) CountBars=Bars; SetIndexDrawBegin(0,Bars-CountBars+PerADX); SetIndexDrawBegin(1,Bars-CountBars+PerADX); int i,shift,counted_bars=IndicatorCounted(); int i1,i2; double Range,AvgRange,smin,smax,SsMax,SsMin,SSP,price; bool uptrend,old; //---- if(Bars<=PerADX+1) return(0); //---- initial zero if(counted_bars<PerADX+1) { for(i=1;i<=PerADX;i++) val1[CountBars-i]=0.0; for(i=1;i<=PerADX;i++) val2[CountBars-i]=0.0; } //---- for (shift = CountBars-PerADX; shift>=0; shift--) { SSP=MathCeil(Kperiod/iADX(NULL,0,PerADX,PRICE_CLOSE,MODE_MAIN,1)); Range=0; AvgRange=0; for (i1=shift; i1<=shift+SSP; i1++) {AvgRange=AvgRange+MathAbs(High[i1]-Low[i1]); } Range=AvgRange/(SSP+1); SsMax=High[shift]; SsMin=Low[shift]; for (i2=shift;i2<=shift+SSP-1;i2++) { price=High[i2]; if(SsMax<price) SsMax=price; price=Low[i2]; if(SsMin>=price) SsMin=price; } smin = SsMin+(SsMax-SsMin)*K/100; smax = SsMax-(SsMax-SsMin)*K/100; val1[shift]=0; val2[shift]=0; if (Close[shift]<smin) { uptrend = false; } if (Close[shift]>smax) { uptrend = true; } if (uptrend!=old && uptrend==true) {val1[shift]=Low[shift]-Range*Kstop;} if (uptrend!=old && uptrend==false) {val2[shift]=High[shift]+Range*Kstop;} old=uptrend; } return(0); } //+------------------------------------------------------------------+
Indicatore Metatrader - 4 Period MA//+------------------------------------------------------------------+ //| 4 Period MA.mq4 | //| Copyright © 2006, tageiger aka Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak97faa7fce3ac86fb8c8da799a63a4c6e').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy97faa7fce3ac86fb8c8da799a63a4c6e = 'fxid10t' + '@'; addy97faa7fce3ac86fb8c8da799a63a4c6e = addy97faa7fce3ac86fb8c8da799a63a4c6e + 'yahoo' + '.' + 'com'; var addy_text97faa7fce3ac86fb8c8da799a63a4c6e = 'fxid10t' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak97faa7fce3ac86fb8c8da799a63a4c6e').innerHTML += ''+addy_text97faa7fce3ac86fb8c8da799a63a4c6e+''; | //| http://www.metatrader.org | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, tageiger aka Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak4e873a2b7f02b0495e99ce8c427f20da').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy4e873a2b7f02b0495e99ce8c427f20da = 'fxid10t' + '@'; addy4e873a2b7f02b0495e99ce8c427f20da = addy4e873a2b7f02b0495e99ce8c427f20da + 'yahoo' + '.' + 'com'; var addy_text4e873a2b7f02b0495e99ce8c427f20da = 'fxid10t' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak4e873a2b7f02b0495e99ce8c427f20da').innerHTML += ''+addy_text4e873a2b7f02b0495e99ce8c427f20da+''; " #property link "mailto:Questo indirizzo email è protetto dagli spambots. È necessario abilitare JavaScript per vederlo. document.getElementById('cloak89aae26118ad231a5e6c7fe6ffe06e81').innerHTML = ''; var prefix = 'ma' + 'il' + 'to'; var path = 'hr' + 'ef' + '='; var addy89aae26118ad231a5e6c7fe6ffe06e81 = 'fxid10t' + '@'; addy89aae26118ad231a5e6c7fe6ffe06e81 = addy89aae26118ad231a5e6c7fe6ffe06e81 + 'yahoo' + '.' + 'com'; var addy_text89aae26118ad231a5e6c7fe6ffe06e81 = 'fxid10t' + '@' + 'yahoo' + '.' + 'com';document.getElementById('cloak89aae26118ad231a5e6c7fe6ffe06e81').innerHTML += ''+addy_text89aae26118ad231a5e6c7fe6ffe06e81+''; " #property indicator_chart_window extern int p1.ma=1;//Period() in minutes extern int p2.ma=5;//Period() in minutes extern int p3.ma=15;//Period() in minutes extern int p4.ma=60;//Period() in minutes extern bool Use_Std_Reg=true; extern int STD.Rgres.period=0; extern int STD.Rgres.length=56; extern double STD.Rgres.width=1.618; extern double STD.width=0.618; extern int ma.applied.price=1;/* Applied price constants. It can be any of the following values: Constant Value Description PRICE_CLOSE 0 Close price. PRICE_OPEN 1 Open price. PRICE_HIGH 2 High price. PRICE_LOW 3 Low price. PRICE_MEDIAN 4 Median price, (high+low)/2. PRICE_TYPICAL 5 Typical price, (high+low+close)/3. PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4.*/ extern int ma.Method=0;/* Moving Average Method Constant Value Description MODE_SMA 0 Simple moving average, MODE_EMA 1 Exponential moving average, MODE_SMMA 2 Smoothed moving average, MODE_LWMA 3 Linear weighted moving average. */ extern int ma1.Length=13; extern int ma2.Length=21; extern int ma3.Length=34; extern int ma4.Length=55; extern int ma5.Length=89; extern int ma6.Length=144; extern int ma7.Length=233; extern int fib.SR.shadow.1=8; extern int fib.SR.shadow.2=13; extern int fib.SR.shadow.3=21; extern int fib.SR.shadow.4=34; extern int fib.SR.shadow.5=55; extern int fib.SR.shadow.6=89; extern int fib.SR.shadow.7=144; extern color fib.SR.shadow.1.c=AliceBlue; extern color fib.SR.shadow.2.c=LightBlue; extern color fib.SR.shadow.3.c=DodgerBlue; extern color fib.SR.shadow.4.c=RoyalBlue; extern color fib.SR.shadow.5.c=Blue; extern color fib.SR.shadow.6.c=MediumBlue; extern color fib.SR.shadow.7.c=DarkBlue; double ma1.p1, ma2.p1, ma3.p1, ma4.p1, ma5.p1, ma6.p1, ma7.p1; double ma1.p2, ma2.p2, ma3.p2, ma4.p2, ma5.p2, ma6.p2, ma7.p2; double ma1.p3, ma2.p3, ma3.p3, ma4.p3, ma5.p3, ma6.p3, ma7.p3; double ma1.p4, ma2.p4, ma3.p4, ma4.p4, ma5.p4, ma6.p4, ma7.p4; datetime t1.p1, t2.p1, t1.p2, t2.p2, t1.p3, t2.p3, t1.p4, t2.p4; int init() { return(0); } int deinit() { Refresh(); return(0); } int start() { Refresh(); if(Use_Std_Reg) { //Time[STD.Rgres.length],Time[0] ObjectCreate("regression channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD.Rgres.period,STD.Rgres.length),Bid,Time[0],Ask); ObjectSet("regression channel",OBJPROP_DEVIATION,STD.Rgres.width); ObjectSet("std channel",OBJPROP_COLOR,Orange); ObjectSet("regression channel",OBJPROP_RAY,true); ObjectCreate("std channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD.Rgres.period,STD.Rgres.length),Bid,Time[0],Ask); ObjectSet("std channel",OBJPROP_DEVIATION,STD.width); ObjectSet("std channel",OBJPROP_COLOR,Olive); ObjectSet("std channel",OBJPROP_RAY,true); } //p1 ma settings ma1.p1=iMA(Symbol(),p1.ma,ma1.Length,0,ma.Method,ma.applied.price,0); ma2.p1=iMA(Symbol(),p1.ma,ma2.Length,0,ma.Method,ma.applied.price,0); ma3.p1=iMA(Symbol(),p1.ma,ma3.Length,0,ma.Method,ma.applied.price,0); ma4.p1=iMA(Symbol(),p1.ma,ma4.Length,0,ma.Method,ma.applied.price,0); ma5.p1=iMA(Symbol(),p1.ma,ma5.Length,0,ma.Method,ma.applied.price,0); ma6.p1=iMA(Symbol(),p1.ma,ma6.Length,0,ma.Method,ma.applied.price,0); ma7.p1=iMA(Symbol(),p1.ma,ma7.Length,0,ma.Method,ma.applied.price,0); //-------------- //p2 ma settings ma1.p2=iMA(Symbol(),p2.ma,ma1.Length,0,ma.Method,ma.applied.price,0); ma2.p2=iMA(Symbol(),p2.ma,ma2.Length,0,ma.Method,ma.applied.price,0); ma3.p2=iMA(Symbol(),p2.ma,ma3.Length,0,ma.Method,ma.applied.price,0); ma4.p2=iMA(Symbol(),p2.ma,ma4.Length,0,ma.Method,ma.applied.price,0); ma5.p2=iMA(Symbol(),p2.ma,ma5.Length,0,ma.Method,ma.applied.price,0); ma6.p2=iMA(Symbol(),p2.ma,ma6.Length,0,ma.Method,ma.applied.price,0); ma7.p2=iMA(Symbol(),p2.ma,ma7.Length,0,ma.Method,ma.applied.price,0); //-------------- //p3 ma settings ma1.p3=iMA(Symbol(),p3.ma,ma1.Length,0,ma.Method,ma.applied.price,0); ma2.p3=iMA(Symbol(),p3.ma,ma2.Length,0,ma.Method,ma.applied.price,0); ma3.p3=iMA(Symbol(),p3.ma,ma3.Length,0,ma.Method,ma.applied.price,0); ma4.p3=iMA(Symbol(),p3.ma,ma4.Length,0,ma.Method,ma.applied.price,0); ma5.p3=iMA(Symbol(),p3.ma,ma5.Length,0,ma.Method,ma.applied.price,0); ma6.p3=iMA(Symbol(),p3.ma,ma6.Length,0,ma.Method,ma.applied.price,0); ma7.p3=iMA(Symbol(),p3.ma,ma7.Length,0,ma.Method,ma.applied.price,0); //-------------- //p4 ma settings ma1.p4=iMA(Symbol(),p4.ma,ma1.Length,0,ma.Method,ma.applied.price,0); ma2.p4=iMA(Symbol(),p4.ma,ma2.Length,0,ma.Method,ma.applied.price,0); ma3.p4=iMA(Symbol(),p4.ma,ma3.Length,0,ma.Method,ma.applied.price,0); ma4.p4=iMA(Symbol(),p4.ma,ma4.Length,0,ma.Method,ma.applied.price,0); ma5.p4=iMA(Symbol(),p4.ma,ma5.Length,0,ma.Method,ma.applied.price,0); ma6.p4=iMA(Symbol(),p4.ma,ma6.Length,0,ma.Method,ma.applied.price,0); ma7.p4=iMA(Symbol(),p4.ma,ma7.Length,0,ma.Method,ma.applied.price,0); //-------------- Time.Coordinate.Set(); p1.Fib.Plot(); p2.Fib.Plot(); p3.Fib.Plot(); p4.Fib.Plot(); column(); //-------------- return(0);} //+------------------------------------------------------------------+ void Time.Coordinate.Set() { //....Variable Settings for Object Spatial Placement..... double zoom.multiplier;int bpw=BarsPerWindow(); if(bpw<25) {zoom.multiplier=0.05;} if(bpw>25 && bpw<50) {zoom.multiplier=0.07;} if(bpw>50 && bpw<175) {zoom.multiplier=0.12;} if(bpw>175 && bpw<375) {zoom.multiplier=0.25;} if(bpw>375 && bpw<750) {zoom.multiplier=0.5;} if(bpw>750) {zoom.multiplier=1;} double time.frame.multiplier; if(Period()==1) {time.frame.multiplier=0.65;} if(Period()==5) {time.frame.multiplier=3.25;} if(Period()==15) {time.frame.multiplier=9.75;} if(Period()==30) {time.frame.multiplier=19.5;} if(Period()==60) {time.frame.multiplier=39;} if(Period()==240) {time.frame.multiplier=156;} if(Period()==1440) {time.frame.multiplier=936;} if(Period()==10080) {time.frame.multiplier=6552;} if(Period()==43200) {time.frame.multiplier=28043;} t1.p1=Time[0]+(1000*time.frame.multiplier*zoom.multiplier); t2.p1=Time[0]+(3000*time.frame.multiplier*zoom.multiplier); t1.p2=Time[0]+(5000*time.frame.multiplier*zoom.multiplier); t2.p2=Time[0]+(7000*time.frame.multiplier*zoom.multiplier); t1.p3=Time[0]+(9000*time.frame.multiplier*zoom.multiplier); t2.p3=Time[0]+(11000*time.frame.multiplier*zoom.multiplier); t1.p4=Time[0]+(13000*time.frame.multiplier*zoom.multiplier); t2.p4=Time[0]+(16000*time.frame.multiplier*zoom.multiplier);}//end Time.Coordinate.Set() void p1.Fib.Plot() { //p1 dynamic fibo levels double lo.ma.p1,hi.ma.p1; lo.ma.p1=ma1.p1; if(ma2.p1<lo.ma.p1) {lo.ma.p1=ma2.p1;} if(ma3.p1<lo.ma.p1) {lo.ma.p1=ma3.p1;} if(ma4.p1<lo.ma.p1) {lo.ma.p1=ma4.p1;} if(ma5.p1<lo.ma.p1) {lo.ma.p1=ma5.p1;} if(ma6.p1<lo.ma.p1) {lo.ma.p1=ma6.p1;} if(ma7.p1<lo.ma.p1) {lo.ma.p1=ma7.p1;} lo.ma.p1=NormalizeDouble(lo.ma.p1+(fib.SR.shadow.1*Point),Digits); hi.ma.p1=ma7.p1; if(ma6.p1>hi.ma.p1) {hi.ma.p1=ma6.p1;} if(ma5.p1>hi.ma.p1) {hi.ma.p1=ma5.p1;} if(ma4.p1>hi.ma.p1) {hi.ma.p1=ma4.p1;} if(ma3.p1>hi.ma.p1) {hi.ma.p1=ma3.p1;} if(ma2.p1>hi.ma.p1) {hi.ma.p1=ma2.p1;} if(ma1.p1>hi.ma.p1) {hi.ma.p1=ma1.p1;} hi.ma.p1=NormalizeDouble(hi.ma.p1-(fib.SR.shadow.1*Point),Digits); //p1 center dynamic fib placement if(lo.ma.p1-hi.ma.p1>Ask-Bid) { ObjectCreate("lcf.p1",OBJ_TREND,0,t1.p1, lo.ma.p1, t2.p1, lo.ma.p1); ObjectSet("lcf.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lcf.p1",OBJPROP_WIDTH,2); ObjectSet("lcf.p1",OBJPROP_RAY,false); ObjectSet("lcf.p1",OBJPROP_COLOR,fib.SR.shadow.1.c); ObjectSetText("lcf.p1",DoubleToStr(lo.ma.p1,Digits),7,"Arial",fib.SR.shadow.1.c); ObjectCreate("hcf.p1",OBJ_TREND,0,t1.p1, hi.ma.p1, t2.p1, hi.ma.p1); ObjectSet("hcf.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hcf.p1",OBJPROP_WIDTH,2); ObjectSet("hcf.p1",OBJPROP_RAY,false); ObjectSet("hcf.p1",OBJPROP_COLOR,fib.SR.shadow.1.c); ObjectSetText("hcf.p1",DoubleToStr(hi.ma.p1,Digits),7,"Arial",fib.SR.shadow.1.c); } double lo.ma.p1.1, lo.ma.p1.2, lo.ma.p1.3, lo.ma.p1.4, lo.ma.p1.5, lo.ma.p1.6; lo.ma.p1.1=lo.ma.p1+(fib.SR.shadow.2*Point); lo.ma.p1.2=lo.ma.p1.1+(fib.SR.shadow.3*Point); lo.ma.p1.3=lo.ma.p1.2+(fib.SR.shadow.4*Point); lo.ma.p1.4=lo.ma.p1.3+(fib.SR.shadow.5*Point); lo.ma.p1.5=lo.ma.p1.4+(fib.SR.shadow.6*Point); lo.ma.p1.6=lo.ma.p1.5+(fib.SR.shadow.7*Point); double hi.ma.p1.1, hi.ma.p1.2, hi.ma.p1.3, hi.ma.p1.4, hi.ma.p1.5, hi.ma.p1.6; hi.ma.p1.1=hi.ma.p1-(fib.SR.shadow.2*Point); hi.ma.p1.2=hi.ma.p1.1-(fib.SR.shadow.3*Point); hi.ma.p1.3=hi.ma.p1.2-(fib.SR.shadow.4*Point); hi.ma.p1.4=hi.ma.p1.3-(fib.SR.shadow.5*Point); hi.ma.p1.5=hi.ma.p1.4-(fib.SR.shadow.6*Point); hi.ma.p1.6=hi.ma.p1.5-(fib.SR.shadow.7*Point); //p1 1st level (hi.1.p1, lo.1.p1) if(lo.ma.p1.1-hi.ma.p1.1>Ask-Bid) { ObjectCreate("lo.1.p1",OBJ_TREND,0,t1.p1, lo.ma.p1.1, t2.p1, lo.ma.p1.1); ObjectSet("lo.1.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.1.p1",OBJPROP_WIDTH,2); ObjectSet("lo.1.p1",OBJPROP_RAY,false); ObjectSet("lo.1.p1",OBJPROP_COLOR,fib.SR.shadow.2.c); ObjectSetText("lo.1.p1",DoubleToStr(lo.ma.p1.1,Digits),7,"Arial",fib.SR.shadow.2.c); ObjectCreate("hi.1.p1",OBJ_TREND,0,t1.p1, hi.ma.p1.1, t2.p1, hi.ma.p1.1); ObjectSet("hi.1.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.1.p1",OBJPROP_WIDTH,2); ObjectSet("hi.1.p1",OBJPROP_RAY,false); ObjectSet("hi.1.p1",OBJPROP_COLOR,fib.SR.shadow.2.c); ObjectSetText("hi.1.p1",DoubleToStr(hi.ma.p1.1,Digits),7,"Arial",fib.SR.shadow.2.c); } // 2st level (hi.2.p1, lo.2.p1) if(lo.ma.p1.2-hi.ma.p1.2>Ask-Bid) { ObjectCreate("lo.2.p1",OBJ_TREND,0,t1.p1, lo.ma.p1.2, t2.p1, lo.ma.p1.2); ObjectSet("lo.2.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.2.p1",OBJPROP_WIDTH,2); ObjectSet("lo.2.p1",OBJPROP_RAY,false); ObjectSet("lo.2.p1",OBJPROP_COLOR,fib.SR.shadow.3.c); ObjectSetText("lo.2.p1",DoubleToStr(lo.ma.p1.2,Digits),7,"Arial",fib.SR.shadow.3.c); ObjectCreate("hi.2.p1",OBJ_TREND,0,t1.p1, hi.ma.p1.2, t2.p1, hi.ma.p1.2); ObjectSet("hi.2.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.2.p1",OBJPROP_WIDTH,2); ObjectSet("hi.2.p1",OBJPROP_RAY,false); ObjectSet("hi.2.p1",OBJPROP_COLOR,fib.SR.shadow.3.c); ObjectSetText("hi.2.p1",DoubleToStr(hi.ma.p1.2,Digits),7,"Arial",fib.SR.shadow.3.c); } // 3rd level (hi.3.p1, lo.3.p1) if(lo.ma.p1.3-hi.ma.p1.3>Ask-Bid) { ObjectCreate("lo.3.p1",OBJ_TREND,0,t1.p1, lo.ma.p1.3, t2.p1, lo.ma.p1.3); ObjectSet("lo.3.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.3.p1",OBJPROP_WIDTH,2); ObjectSet("lo.3.p1",OBJPROP_RAY,false); ObjectSet("lo.3.p1",OBJPROP_COLOR,fib.SR.shadow.4.c); ObjectSetText("lo.3.p1",DoubleToStr(lo.ma.p1.3,Digits),7,"Arial",fib.SR.shadow.4.c); ObjectCreate("hi.3.p1",OBJ_TREND,0,t1.p1, hi.ma.p1.3, t2.p1, hi.ma.p1.3); ObjectSet("hi.3.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.3.p1",OBJPROP_WIDTH,2); ObjectSet("hi.3.p1",OBJPROP_RAY,false); ObjectSet("hi.3.p1",OBJPROP_COLOR,fib.SR.shadow.4.c); ObjectSetText("hi.3.p1",DoubleToStr(hi.ma.p1.3,Digits),7,"Arial",fib.SR.shadow.4.c); } // 4th level (hi.4.p1, lo.4.p1) if(lo.ma.p1.4-hi.ma.p1.4>Ask-Bid) { ObjectCreate("lo.4.p1",OBJ_TREND,0,t1.p1, lo.ma.p1.4, t2.p1, lo.ma.p1.4); ObjectSet("lo.4.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.4.p1",OBJPROP_WIDTH,2); ObjectSet("lo.4.p1",OBJPROP_RAY,false); ObjectSet("lo.4.p1",OBJPROP_COLOR,fib.SR.shadow.5.c); ObjectSetText("lo.4.p1",DoubleToStr(lo.ma.p1.4,Digits),7,"Arial",fib.SR.shadow.5.c); ObjectCreate("hi.4.p1",OBJ_TREND,0,t1.p1, hi.ma.p1.4, t2.p1, hi.ma.p1.4); ObjectSet("hi.4.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.4.p1",OBJPROP_WIDTH,2); ObjectSet("hi.4.p1",OBJPROP_RAY,false); ObjectSet("hi.4.p1",OBJPROP_COLOR,fib.SR.shadow.5.c); ObjectSetText("hi.4.p1",DoubleToStr(hi.ma.p1.4,Digits),7,"Arial",fib.SR.shadow.5.c); } // 5th level (hi.5.p1, lo.5.p1) if(lo.ma.p1.5-hi.ma.p1.5>Ask-Bid) { ObjectCreate("lo.5.p1",OBJ_TREND,0,t1.p1, lo.ma.p1.5, t2.p1, lo.ma.p1.5); ObjectSet("lo.5.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.5.p1",OBJPROP_WIDTH,2); ObjectSet("lo.5.p1",OBJPROP_RAY,false); ObjectSet("lo.5.p1",OBJPROP_COLOR,fib.SR.shadow.6.c); ObjectSetText("lo.5.p1",DoubleToStr(lo.ma.p1.5,Digits),7,"Arial",fib.SR.shadow.6.c); ObjectCreate("hi.5.p1",OBJ_TREND,0,t1.p1, hi.ma.p1.5, t2.p1, hi.ma.p1.5); ObjectSet("hi.5.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.5.p1",OBJPROP_WIDTH,2); ObjectSet("hi.5.p1",OBJPROP_RAY,false); ObjectSet("hi.5.p1",OBJPROP_COLOR,fib.SR.shadow.6.c); ObjectSetText("hi.5.p1",DoubleToStr(hi.ma.p1.5,Digits),7,"Arial",fib.SR.shadow.6.c); } // 6th level (hi.6.p1, lo.6.p1) if(lo.ma.p1.6-hi.ma.p1.6>Ask-Bid) { ObjectCreate("lo.6.p1",OBJ_TREND,0,t1.p1, lo.ma.p1.6, t2.p1, lo.ma.p1.6); ObjectSet("lo.6.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.6.p1",OBJPROP_WIDTH,2); ObjectSet("lo.6.p1",OBJPROP_RAY,false); ObjectSet("lo.6.p1",OBJPROP_COLOR,fib.SR.shadow.7.c); ObjectSetText("lo.6.p1",DoubleToStr(lo.ma.p1.6,Digits),7,"Arial",fib.SR.shadow.7.c); ObjectCreate("hi.6.p1",OBJ_TREND,0,t1.p1, hi.ma.p1.6, t2.p1, hi.ma.p1.6); ObjectSet("hi.6.p1",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.6.p1",OBJPROP_WIDTH,2); ObjectSet("hi.6.p1",OBJPROP_RAY,false); ObjectSet("hi.6.p1",OBJPROP_COLOR,fib.SR.shadow.7.c); ObjectSetText("hi.6.p1",DoubleToStr(hi.ma.p1.6,Digits),7,"Arial",fib.SR.shadow.7.c); } //...............Moving Average Support & Resistance Levels.............................. string space=" "; ObjectCreate("ma1.p1",OBJ_TEXT,0,t1.p1,ma1.p1);//13 ma ObjectSetText("ma1.p1",space+DoubleToStr(ma1.p1,Digits),8,"Arial",White); ObjectCreate("ma2.p1",OBJ_TEXT,0,t1.p1,ma2.p1);//21 ma ObjectSetText("ma2.p1",space+DoubleToStr(ma2.p1,Digits),8,"Arial",White); ObjectCreate("ma3.p1",OBJ_TEXT,0,t1.p1,ma3.p1);//34 ma if(Bid>ma3.p1) {ObjectSetText("ma3.p1",space+DoubleToStr(ma3.p1,Digits),8,"Arial",LightGreen);} if(Ask<ma3.p1) {ObjectSetText("ma3.p1",space+DoubleToStr(ma3.p1,Digits),8,"Arial",Pink);} if(Bid<=ma3.p1 && Ask>=ma3.p1) { ObjectSetText("ma3.p1",space+DoubleToStr(ma3.p1,Digits),8,"Arial",Yellow);} ObjectCreate("ma4.p1",OBJ_TEXT,0,t1.p1,ma4.p1);//55 ma if(Bid>ma4.p1) {ObjectSetText("ma4.p1",space+DoubleToStr(ma4.p1,Digits),8,"Arial",LightGreen);} if(Ask<ma4.p1) {ObjectSetText("ma4.p1",space+DoubleToStr(ma4.p1,Digits),8,"Arial",Pink);} if(Bid<=ma4.p1 && Ask>=ma4.p1) { ObjectSetText("ma4.p1",space+DoubleToStr(ma4.p1,Digits),8,"Arial",Yellow);} ObjectCreate("ma5.p1",OBJ_TEXT,0,t1.p1,ma5.p1);//89 ma if(Bid>ma5.p1) {ObjectSetText("ma5.p1",space+DoubleToStr(ma5.p1,Digits),8,"Arial",Green);} if(Ask<ma5.p1) {ObjectSetText("ma5.p1",space+DoubleToStr(ma5.p1,Digits),8,"Arial",Red);} if(Bid<=ma5.p1 && Ask>=ma5.p1) { ObjectSetText("ma5.p1",space+DoubleToStr(ma5.p1,Digits),8,"Arial",Yellow);} ObjectCreate("ma6.p1",OBJ_TEXT,0,t1.p1,NormalizeDouble(ma6.p1,Digits));//144 ma if(Bid>ma6.p1) {ObjectSetText("ma6.p1",space+DoubleToStr(ma6.p1,Digits),8,"Arial",Green);} if(Ask<ma6.p1) {ObjectSetText("ma6.p1",space+DoubleToStr(ma6.p1,Digits),8,"Arial",Red);} if(Bid<=ma6.p1 && Ask>=ma6.p1) { ObjectSetText("ma6.p1",space+DoubleToStr(ma6.p1,Digits),8,"Arial",Yellow);} ObjectCreate("ma7.p1",OBJ_TEXT,0,t1.p1,NormalizeDouble(ma7.p1,Digits));//233 ma if(Bid>ma7.p1) {ObjectSetText("ma7.p1",space+DoubleToStr(ma7.p1,Digits),8,"Arial",Green);} if(Ask<ma7.p1) {ObjectSetText("ma7.p1",space+DoubleToStr(ma7.p1,Digits),8,"Arial",Red);} if(Bid<=ma7.p1 && Ask>=ma7.p1) { ObjectSetText("ma7.p1",space+DoubleToStr(ma7.p1,Digits),8,"Arial",Yellow);} }//end p1.Fib.Plot() void p2.Fib.Plot() { //p2 dynamic fibo levels double lo.ma.p2,hi.ma.p2; lo.ma.p2=ma1.p2; if(ma2.p2<lo.ma.p2) {lo.ma.p2=ma2.p2;} if(ma3.p2<lo.ma.p2) {lo.ma.p2=ma3.p2;} if(ma4.p2<lo.ma.p2) {lo.ma.p2=ma4.p2;} if(ma5.p2<lo.ma.p2) {lo.ma.p2=ma5.p2;} if(ma6.p2<lo.ma.p2) {lo.ma.p2=ma6.p2;} if(ma7.p2<lo.ma.p2) {lo.ma.p2=ma7.p2;} lo.ma.p2=NormalizeDouble(lo.ma.p2+(fib.SR.shadow.1*Point),Digits); hi.ma.p2=ma7.p2; if(ma6.p2>hi.ma.p2) {hi.ma.p2=ma6.p2;} if(ma5.p2>hi.ma.p2) {hi.ma.p2=ma5.p2;} if(ma4.p2>hi.ma.p2) {hi.ma.p2=ma4.p2;} if(ma3.p2>hi.ma.p2) {hi.ma.p2=ma3.p2;} if(ma2.p2>hi.ma.p2) {hi.ma.p2=ma2.p2;} if(ma1.p2>hi.ma.p2) {hi.ma.p2=ma1.p2;} hi.ma.p2=NormalizeDouble(hi.ma.p2-(fib.SR.shadow.1*Point),Digits); //p2 center dynamic fib placement if(lo.ma.p2-hi.ma.p2>Ask-Bid) { ObjectCreate("lcf.p2",OBJ_TREND,0,t1.p2, lo.ma.p2, t2.p2, lo.ma.p2); ObjectSet("lcf.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lcf.p2",OBJPROP_WIDTH,2); ObjectSet("lcf.p2",OBJPROP_RAY,false); ObjectSet("lcf.p2",OBJPROP_COLOR,fib.SR.shadow.1.c); ObjectSetText("lcf.p2",DoubleToStr(lo.ma.p2,Digits),7,"Arial",fib.SR.shadow.1.c); ObjectCreate("hcf.p2",OBJ_TREND,0,t1.p2, hi.ma.p2, t2.p2, hi.ma.p2); ObjectSet("hcf.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hcf.p2",OBJPROP_WIDTH,2); ObjectSet("hcf.p2",OBJPROP_RAY,false); ObjectSet("hcf.p2",OBJPROP_COLOR,fib.SR.shadow.1.c); ObjectSetText("hcf.p2",DoubleToStr(hi.ma.p2,Digits),7,"Arial",fib.SR.shadow.1.c); } double lo.ma.p2.1, lo.ma.p2.2, lo.ma.p2.3, lo.ma.p2.4, lo.ma.p2.5, lo.ma.p2.6; lo.ma.p2.1=lo.ma.p2+(fib.SR.shadow.2*Point); lo.ma.p2.2=lo.ma.p2.1+(fib.SR.shadow.3*Point); lo.ma.p2.3=lo.ma.p2.2+(fib.SR.shadow.4*Point); lo.ma.p2.4=lo.ma.p2.3+(fib.SR.shadow.5*Point); lo.ma.p2.5=lo.ma.p2.4+(fib.SR.shadow.6*Point); lo.ma.p2.6=lo.ma.p2.5+(fib.SR.shadow.7*Point); double hi.ma.p2.1, hi.ma.p2.2, hi.ma.p2.3, hi.ma.p2.4, hi.ma.p2.5, hi.ma.p2.6; hi.ma.p2.1=hi.ma.p2-(fib.SR.shadow.2*Point); hi.ma.p2.2=hi.ma.p2.1-(fib.SR.shadow.3*Point); hi.ma.p2.3=hi.ma.p2.2-(fib.SR.shadow.4*Point); hi.ma.p2.4=hi.ma.p2.3-(fib.SR.shadow.5*Point); hi.ma.p2.5=hi.ma.p2.4-(fib.SR.shadow.6*Point); hi.ma.p2.6=hi.ma.p2.5-(fib.SR.shadow.7*Point); //p2 1st level (hi.1.p2, lo.1.p2) if(lo.ma.p2.1-hi.ma.p2.1>Ask-Bid) { ObjectCreate("lo.1.p2",OBJ_TREND,0,t1.p2, lo.ma.p2.1, t2.p2, lo.ma.p2.1); ObjectSet("lo.1.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.1.p2",OBJPROP_WIDTH,2); ObjectSet("lo.1.p2",OBJPROP_RAY,false); ObjectSet("lo.1.p2",OBJPROP_COLOR,fib.SR.shadow.2.c); ObjectSetText("lo.1.p2",DoubleToStr(lo.ma.p2.1,Digits),7,"Arial",fib.SR.shadow.2.c); ObjectCreate("hi.1.p2",OBJ_TREND,0,t1.p2, hi.ma.p2.1, t2.p2, hi.ma.p2.1); ObjectSet("hi.1.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.1.p2",OBJPROP_WIDTH,2); ObjectSet("hi.1.p2",OBJPROP_RAY,false); ObjectSet("hi.1.p2",OBJPROP_COLOR,fib.SR.shadow.2.c); ObjectSetText("hi.1.p2",DoubleToStr(hi.ma.p2.1,Digits),7,"Arial",fib.SR.shadow.2.c); } // 2st level (hi.2.p2, lo.2.p2) if(lo.ma.p2.2-hi.ma.p2.2>Ask-Bid) { ObjectCreate("lo.2.p2",OBJ_TREND,0,t1.p2, lo.ma.p2.2, t2.p2, lo.ma.p2.2); ObjectSet("lo.2.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.2.p2",OBJPROP_WIDTH,2); ObjectSet("lo.2.p2",OBJPROP_RAY,false); ObjectSet("lo.2.p2",OBJPROP_COLOR,fib.SR.shadow.3.c); ObjectSetText("lo.2.p2",DoubleToStr(lo.ma.p2.2,Digits),7,"Arial",fib.SR.shadow.3.c); ObjectCreate("hi.2.p2",OBJ_TREND,0,t1.p2, hi.ma.p2.2, t2.p2, hi.ma.p2.2); ObjectSet("hi.2.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.2.p2",OBJPROP_WIDTH,2); ObjectSet("hi.2.p2",OBJPROP_RAY,false); ObjectSet("hi.2.p2",OBJPROP_COLOR,fib.SR.shadow.3.c); ObjectSetText("hi.2.p2",DoubleToStr(hi.ma.p2.2,Digits),7,"Arial",fib.SR.shadow.3.c); } // 3rd level (hi.3.p2, lo.3.p2) if(lo.ma.p2.3-hi.ma.p2.3>Ask-Bid) { ObjectCreate("lo.3.p2",OBJ_TREND,0,t1.p2, lo.ma.p2.3, t2.p2, lo.ma.p2.3); ObjectSet("lo.3.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.3.p2",OBJPROP_WIDTH,2); ObjectSet("lo.3.p2",OBJPROP_RAY,false); ObjectSet("lo.3.p2",OBJPROP_COLOR,fib.SR.shadow.4.c); ObjectSetText("lo.3.p2",DoubleToStr(lo.ma.p2.3,Digits),7,"Arial",fib.SR.shadow.4.c); ObjectCreate("hi.3.p2",OBJ_TREND,0,t1.p2, hi.ma.p2.3, t2.p2, hi.ma.p2.3); ObjectSet("hi.3.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.3.p2",OBJPROP_WIDTH,2); ObjectSet("hi.3.p2",OBJPROP_RAY,false); ObjectSet("hi.3.p2",OBJPROP_COLOR,fib.SR.shadow.4.c); ObjectSetText("hi.3.p2",DoubleToStr(hi.ma.p2.3,Digits),7,"Arial",fib.SR.shadow.4.c); } // 4th level (hi.4.p2, lo.4.p2) if(lo.ma.p2.4-hi.ma.p2.4>Ask-Bid) { ObjectCreate("lo.4.p2",OBJ_TREND,0,t1.p2, lo.ma.p2.4, t2.p2, lo.ma.p2.4); ObjectSet("lo.4.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.4.p2",OBJPROP_WIDTH,2); ObjectSet("lo.4.p2",OBJPROP_RAY,false); ObjectSet("lo.4.p2",OBJPROP_COLOR,fib.SR.shadow.5.c); ObjectSetText("lo.4.p2",DoubleToStr(lo.ma.p2.4,Digits),7,"Arial",fib.SR.shadow.5.c); ObjectCreate("hi.4.p2",OBJ_TREND,0,t1.p2, hi.ma.p2.4, t2.p2, hi.ma.p2.4); ObjectSet("hi.4.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.4.p2",OBJPROP_WIDTH,2); ObjectSet("hi.4.p2",OBJPROP_RAY,false); ObjectSet("hi.4.p2",OBJPROP_COLOR,fib.SR.shadow.5.c); ObjectSetText("hi.4.p2",DoubleToStr(hi.ma.p2.4,Digits),7,"Arial",fib.SR.shadow.5.c); } // 5th level (hi.5.p2, lo.5.p2) if(lo.ma.p2.5-hi.ma.p2.5>Ask-Bid) { ObjectCreate("lo.5.p2",OBJ_TREND,0,t1.p2, lo.ma.p2.5, t2.p2, lo.ma.p2.5); ObjectSet("lo.5.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.5.p2",OBJPROP_WIDTH,2); ObjectSet("lo.5.p2",OBJPROP_RAY,false); ObjectSet("lo.5.p2",OBJPROP_COLOR,fib.SR.shadow.6.c); ObjectSetText("lo.5.p2",DoubleToStr(lo.ma.p2.5,Digits),7,"Arial",fib.SR.shadow.6.c); ObjectCreate("hi.5.p2",OBJ_TREND,0,t1.p2, hi.ma.p2.5, t2.p2, hi.ma.p2.5); ObjectSet("hi.5.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.5.p2",OBJPROP_WIDTH,2); ObjectSet("hi.5.p2",OBJPROP_RAY,false); ObjectSet("hi.5.p2",OBJPROP_COLOR,fib.SR.shadow.6.c); ObjectSetText("hi.5.p2",DoubleToStr(hi.ma.p2.5,Digits),7,"Arial",fib.SR.shadow.6.c); } // 6th level (hi.6.p2, lo.6.p2) if(lo.ma.p2.6-hi.ma.p2.6>Ask-Bid) { ObjectCreate("lo.6.p2",OBJ_TREND,0,t1.p2, lo.ma.p2.6, t2.p2, lo.ma.p2.6); ObjectSet("lo.6.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.6.p2",OBJPROP_WIDTH,2); ObjectSet("lo.6.p2",OBJPROP_RAY,false); ObjectSet("lo.6.p2",OBJPROP_COLOR,fib.SR.shadow.7.c); ObjectSetText("lo.6.p2",DoubleToStr(lo.ma.p2.6,Digits),7,"Arial",fib.SR.shadow.7.c); ObjectCreate("hi.6.p2",OBJ_TREND,0,t1.p2, hi.ma.p2.6, t2.p2, hi.ma.p2.6); ObjectSet("hi.6.p2",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.6.p2",OBJPROP_WIDTH,2); ObjectSet("hi.6.p2",OBJPROP_RAY,false); ObjectSet("hi.6.p2",OBJPROP_COLOR,fib.SR.shadow.7.c); ObjectSetText("hi.6.p2",DoubleToStr(hi.ma.p2.6,Digits),7,"Arial",fib.SR.shadow.7.c); } //...............Moving Average Support & Resistance Levels.............................. string space=" "; ObjectCreate("ma1.p2",OBJ_TEXT,0,t1.p2,ma1.p2);//13 ma ObjectSetText("ma1.p2",space+DoubleToStr(ma1.p2,Digits),8,"Arial",White); ObjectCreate("ma2.p2",OBJ_TEXT,0,t1.p2,ma2.p2);//21 ma ObjectSetText("ma2.p2",space+DoubleToStr(ma2.p2,Digits),8,"Arial",White); ObjectCreate("ma3.p2",OBJ_TEXT,0,t1.p2,ma3.p2);//34 ma if(Bid>ma3.p2) {ObjectSetText("ma3.p2",space+DoubleToStr(ma3.p2,Digits),8,"Arial",LightGreen);} if(Ask<ma3.p2) {ObjectSetText("ma3.p2",space+DoubleToStr(ma3.p2,Digits),8,"Arial",Pink);} if(Bid<=ma3.p2 && Ask>=ma3.p2) { ObjectSetText("ma3.p2",space+DoubleToStr(ma3.p2,Digits),8,"Arial",Yellow);} ObjectCreate("ma4.p2",OBJ_TEXT,0,t1.p2,ma4.p2);//55 ma if(Bid>ma4.p2) {ObjectSetText("ma4.p2",space+DoubleToStr(ma4.p2,Digits),8,"Arial",LightGreen);} if(Ask<ma4.p2) {ObjectSetText("ma4.p2",space+DoubleToStr(ma4.p2,Digits),8,"Arial",Pink);} if(Bid<=ma4.p2 && Ask>=ma4.p2) { ObjectSetText("ma4.p2",space+DoubleToStr(ma4.p2,Digits),8,"Arial",Yellow);} ObjectCreate("ma5.p2",OBJ_TEXT,0,t1.p2,ma5.p2);//89 ma if(Bid>ma5.p2) {ObjectSetText("ma5.p2",space+DoubleToStr(ma5.p2,Digits),8,"Arial",Green);} if(Ask<ma5.p2) {ObjectSetText("ma5.p2",space+DoubleToStr(ma5.p2,Digits),8,"Arial",Red);} if(Bid<=ma5.p2 && Ask>=ma5.p2) { ObjectSetText("ma5.p2",space+DoubleToStr(ma5.p2,Digits),8,"Arial",Yellow);} ObjectCreate("ma6.p2",OBJ_TEXT,0,t1.p2,NormalizeDouble(ma6.p2,Digits));//144 ma if(Bid>ma6.p2) {ObjectSetText("ma6.p2",space+DoubleToStr(ma6.p2,Digits),8,"Arial",Green);} if(Ask<ma6.p2) {ObjectSetText("ma6.p2",space+DoubleToStr(ma6.p2,Digits),8,"Arial",Red);} if(Bid<=ma6.p2 && Ask>=ma6.p2) { ObjectSetText("ma6.p2",space+DoubleToStr(ma6.p2,Digits),8,"Arial",Yellow);} ObjectCreate("ma7.p2",OBJ_TEXT,0,t1.p2,NormalizeDouble(ma7.p2,Digits));//233 ma if(Bid>ma7.p2) {ObjectSetText("ma7.p2",space+DoubleToStr(ma7.p2,Digits),8,"Arial",Green);} if(Ask<ma7.p2) {ObjectSetText("ma7.p2",space+DoubleToStr(ma7.p2,Digits),8,"Arial",Red);} if(Bid<=ma7.p2 && Ask>=ma7.p2) { ObjectSetText("ma7.p2",space+DoubleToStr(ma7.p2,Digits),8,"Arial",Yellow);} }//end p2.Fib.Plot() void p3.Fib.Plot() { //p3 dynamic fibo levels double lo.ma.p3,hi.ma.p3; lo.ma.p3=ma1.p3; if(ma2.p3<lo.ma.p3) {lo.ma.p3=ma2.p3;} if(ma3.p3<lo.ma.p3) {lo.ma.p3=ma3.p3;} if(ma4.p3<lo.ma.p3) {lo.ma.p3=ma4.p3;} if(ma5.p3<lo.ma.p3) {lo.ma.p3=ma5.p3;} if(ma6.p3<lo.ma.p3) {lo.ma.p3=ma6.p3;} if(ma7.p3<lo.ma.p3) {lo.ma.p3=ma7.p3;} lo.ma.p3=NormalizeDouble(lo.ma.p3+(fib.SR.shadow.1*Point),Digits); hi.ma.p3=ma7.p3; if(ma6.p3>hi.ma.p3) {hi.ma.p3=ma6.p3;} if(ma5.p3>hi.ma.p3) {hi.ma.p3=ma5.p3;} if(ma4.p3>hi.ma.p3) {hi.ma.p3=ma4.p3;} if(ma3.p3>hi.ma.p3) {hi.ma.p3=ma3.p3;} if(ma2.p3>hi.ma.p3) {hi.ma.p3=ma2.p3;} if(ma1.p3>hi.ma.p3) {hi.ma.p3=ma1.p3;} hi.ma.p3=NormalizeDouble(hi.ma.p3-(fib.SR.shadow.1*Point),Digits); //p3 center dynamic fib placement if(lo.ma.p3-hi.ma.p3>Ask-Bid) { ObjectCreate("lcf.p3",OBJ_TREND,0,t1.p3, lo.ma.p3, t2.p3, lo.ma.p3); ObjectSet("lcf.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lcf.p3",OBJPROP_WIDTH,2); ObjectSet("lcf.p3",OBJPROP_RAY,false); ObjectSet("lcf.p3",OBJPROP_COLOR,fib.SR.shadow.1.c); ObjectSetText("lcf.p3",DoubleToStr(lo.ma.p3,Digits),7,"Arial",fib.SR.shadow.1.c); ObjectCreate("hcf.p3",OBJ_TREND,0,t1.p3, hi.ma.p3, t2.p3, hi.ma.p3); ObjectSet("hcf.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hcf.p3",OBJPROP_WIDTH,2); ObjectSet("hcf.p3",OBJPROP_RAY,false); ObjectSet("hcf.p3",OBJPROP_COLOR,fib.SR.shadow.1.c); ObjectSetText("hcf.p3",DoubleToStr(hi.ma.p3,Digits),7,"Arial",fib.SR.shadow.1.c); } double lo.ma.p3.1, lo.ma.p3.2, lo.ma.p3.3, lo.ma.p3.4, lo.ma.p3.5, lo.ma.p3.6; lo.ma.p3.1=lo.ma.p3+(fib.SR.shadow.2*Point); lo.ma.p3.2=lo.ma.p3.1+(fib.SR.shadow.3*Point); lo.ma.p3.3=lo.ma.p3.2+(fib.SR.shadow.4*Point); lo.ma.p3.4=lo.ma.p3.3+(fib.SR.shadow.5*Point); lo.ma.p3.5=lo.ma.p3.4+(fib.SR.shadow.6*Point); lo.ma.p3.6=lo.ma.p3.5+(fib.SR.shadow.7*Point); double hi.ma.p3.1, hi.ma.p3.2, hi.ma.p3.3, hi.ma.p3.4, hi.ma.p3.5, hi.ma.p3.6; hi.ma.p3.1=hi.ma.p3-(fib.SR.shadow.2*Point); hi.ma.p3.2=hi.ma.p3.1-(fib.SR.shadow.3*Point); hi.ma.p3.3=hi.ma.p3.2-(fib.SR.shadow.4*Point); hi.ma.p3.4=hi.ma.p3.3-(fib.SR.shadow.5*Point); hi.ma.p3.5=hi.ma.p3.4-(fib.SR.shadow.6*Point); hi.ma.p3.6=hi.ma.p3.5-(fib.SR.shadow.7*Point); //p3 1st level (hi.1.p3, lo.1.p3) if(lo.ma.p3.1-hi.ma.p3.1>Ask-Bid) { ObjectCreate("lo.1.p3",OBJ_TREND,0,t1.p3, lo.ma.p3.1, t2.p3, lo.ma.p3.1); ObjectSet("lo.1.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.1.p3",OBJPROP_WIDTH,2); ObjectSet("lo.1.p3",OBJPROP_RAY,false); ObjectSet("lo.1.p3",OBJPROP_COLOR,fib.SR.shadow.2.c); ObjectSetText("lo.1.p3",DoubleToStr(lo.ma.p3.1,Digits),7,"Arial",fib.SR.shadow.2.c); ObjectCreate("hi.1.p3",OBJ_TREND,0,t1.p3, hi.ma.p3.1, t2.p3, hi.ma.p3.1); ObjectSet("hi.1.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.1.p3",OBJPROP_WIDTH,2); ObjectSet("hi.1.p3",OBJPROP_RAY,false); ObjectSet("hi.1.p3",OBJPROP_COLOR,fib.SR.shadow.2.c); ObjectSetText("hi.1.p3",DoubleToStr(hi.ma.p3.1,Digits),7,"Arial",fib.SR.shadow.2.c); } // 2st level (hi.2.p3, lo.2.p3) if(lo.ma.p3.2-hi.ma.p3.2>Ask-Bid) { ObjectCreate("lo.2.p3",OBJ_TREND,0,t1.p3, lo.ma.p3.2, t2.p3, lo.ma.p3.2); ObjectSet("lo.2.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.2.p3",OBJPROP_WIDTH,2); ObjectSet("lo.2.p3",OBJPROP_RAY,false); ObjectSet("lo.2.p3",OBJPROP_COLOR,fib.SR.shadow.3.c); ObjectSetText("lo.2.p3",DoubleToStr(lo.ma.p3.2,Digits),7,"Arial",fib.SR.shadow.3.c); ObjectCreate("hi.2.p3",OBJ_TREND,0,t1.p3, hi.ma.p3.2, t2.p3, hi.ma.p3.2); ObjectSet("hi.2.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.2.p3",OBJPROP_WIDTH,2); ObjectSet("hi.2.p3",OBJPROP_RAY,false); ObjectSet("hi.2.p3",OBJPROP_COLOR,fib.SR.shadow.3.c); ObjectSetText("hi.2.p3",DoubleToStr(hi.ma.p3.2,Digits),7,"Arial",fib.SR.shadow.3.c); } // 3rd level (hi.3.p3, lo.3.p3) if(lo.ma.p3.3-hi.ma.p3.3>Ask-Bid) { ObjectCreate("lo.3.p3",OBJ_TREND,0,t1.p3, lo.ma.p3.3, t2.p3, lo.ma.p3.3); ObjectSet("lo.3.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.3.p3",OBJPROP_WIDTH,2); ObjectSet("lo.3.p3",OBJPROP_RAY,false); ObjectSet("lo.3.p3",OBJPROP_COLOR,fib.SR.shadow.4.c); ObjectSetText("lo.3.p3",DoubleToStr(lo.ma.p3.3,Digits),7,"Arial",fib.SR.shadow.4.c); ObjectCreate("hi.3.p3",OBJ_TREND,0,t1.p3, hi.ma.p3.3, t2.p3, hi.ma.p3.3); ObjectSet("hi.3.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.3.p3",OBJPROP_WIDTH,2); ObjectSet("hi.3.p3",OBJPROP_RAY,false); ObjectSet("hi.3.p3",OBJPROP_COLOR,fib.SR.shadow.4.c); ObjectSetText("hi.3.p3",DoubleToStr(hi.ma.p3.3,Digits),7,"Arial",fib.SR.shadow.4.c); } // 4th level (hi.4.p3, lo.4.p3) if(lo.ma.p3.4-hi.ma.p3.4>Ask-Bid) { ObjectCreate("lo.4.p3",OBJ_TREND,0,t1.p3, lo.ma.p3.4, t2.p3, lo.ma.p3.4); ObjectSet("lo.4.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.4.p3",OBJPROP_WIDTH,2); ObjectSet("lo.4.p3",OBJPROP_RAY,false); ObjectSet("lo.4.p3",OBJPROP_COLOR,fib.SR.shadow.5.c); ObjectSetText("lo.4.p3",DoubleToStr(lo.ma.p3.4,Digits),7,"Arial",fib.SR.shadow.5.c); ObjectCreate("hi.4.p3",OBJ_TREND,0,t1.p3, hi.ma.p3.4, t2.p3, hi.ma.p3.4); ObjectSet("hi.4.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.4.p3",OBJPROP_WIDTH,2); ObjectSet("hi.4.p3",OBJPROP_RAY,false); ObjectSet("hi.4.p3",OBJPROP_COLOR,fib.SR.shadow.5.c); ObjectSetText("hi.4.p3",DoubleToStr(hi.ma.p3.4,Digits),7,"Arial",fib.SR.shadow.5.c); } // 5th level (hi.5.p3, lo.5.p3) if(lo.ma.p3.5-hi.ma.p3.5>Ask-Bid) { ObjectCreate("lo.5.p3",OBJ_TREND,0,t1.p3, lo.ma.p3.5, t2.p3, lo.ma.p3.5); ObjectSet("lo.5.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.5.p3",OBJPROP_WIDTH,2); ObjectSet("lo.5.p3",OBJPROP_RAY,false); ObjectSet("lo.5.p3",OBJPROP_COLOR,fib.SR.shadow.6.c); ObjectSetText("lo.5.p3",DoubleToStr(lo.ma.p3.5,Digits),7,"Arial",fib.SR.shadow.6.c); ObjectCreate("hi.5.p3",OBJ_TREND,0,t1.p3, hi.ma.p3.5, t2.p3, hi.ma.p3.5); ObjectSet("hi.5.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.5.p3",OBJPROP_WIDTH,2); ObjectSet("hi.5.p3",OBJPROP_RAY,false); ObjectSet("hi.5.p3",OBJPROP_COLOR,fib.SR.shadow.6.c); ObjectSetText("hi.5.p3",DoubleToStr(hi.ma.p3.5,Digits),7,"Arial",fib.SR.shadow.6.c); } // 6th level (hi.6.p3, lo.6.p3) if(lo.ma.p3.6-hi.ma.p3.6>Ask-Bid) { ObjectCreate("lo.6.p3",OBJ_TREND,0,t1.p3, lo.ma.p3.6, t2.p3, lo.ma.p3.6); ObjectSet("lo.6.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.6.p3",OBJPROP_WIDTH,2); ObjectSet("lo.6.p3",OBJPROP_RAY,false); ObjectSet("lo.6.p3",OBJPROP_COLOR,fib.SR.shadow.7.c); ObjectSetText("lo.6.p3",DoubleToStr(lo.ma.p3.6,Digits),7,"Arial",fib.SR.shadow.7.c); ObjectCreate("hi.6.p3",OBJ_TREND,0,t1.p3, hi.ma.p3.6, t2.p3, hi.ma.p3.6); ObjectSet("hi.6.p3",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.6.p3",OBJPROP_WIDTH,2); ObjectSet("hi.6.p3",OBJPROP_RAY,false); ObjectSet("hi.6.p3",OBJPROP_COLOR,fib.SR.shadow.7.c); ObjectSetText("hi.6.p3",DoubleToStr(hi.ma.p3.6,Digits),7,"Arial",fib.SR.shadow.7.c); } //...............Moving Average Support & Resistance Levels.............................. string space=" "; ObjectCreate("ma1.p3",OBJ_TEXT,0,t1.p3,ma1.p3);//13 ma ObjectSetText("ma1.p3",space+DoubleToStr(ma1.p3,Digits),8,"Arial",White); ObjectCreate("ma2.p3",OBJ_TEXT,0,t1.p3,ma2.p3);//21 ma ObjectSetText("ma2.p3",space+DoubleToStr(ma2.p3,Digits),8,"Arial",White); ObjectCreate("ma3.p3",OBJ_TEXT,0,t1.p3,ma3.p3);//34 ma if(Bid>ma3.p3) {ObjectSetText("ma3.p3",space+DoubleToStr(ma3.p3,Digits),8,"Arial",LightGreen);} if(Ask<ma3.p3) {ObjectSetText("ma3.p3",space+DoubleToStr(ma3.p3,Digits),8,"Arial",Pink);} if(Bid<=ma3.p3 && Ask>=ma3.p3) { ObjectSetText("ma3.p3",space+DoubleToStr(ma3.p3,Digits),8,"Arial",Yellow);} ObjectCreate("ma4.p3",OBJ_TEXT,0,t1.p3,ma4.p3);//55 ma if(Bid>ma4.p3) {ObjectSetText("ma4.p3",space+DoubleToStr(ma4.p3,Digits),8,"Arial",LightGreen);} if(Ask<ma4.p3) {ObjectSetText("ma4.p3",space+DoubleToStr(ma4.p3,Digits),8,"Arial",Pink);} if(Bid<=ma4.p3 && Ask>=ma4.p3) { ObjectSetText("ma4.p3",space+DoubleToStr(ma4.p3,Digits),8,"Arial",Yellow);} ObjectCreate("ma5.p3",OBJ_TEXT,0,t1.p3,ma5.p3);//89 ma if(Bid>ma5.p3) {ObjectSetText("ma5.p3",space+DoubleToStr(ma5.p3,Digits),8,"Arial",Green);} if(Ask<ma5.p3) {ObjectSetText("ma5.p3",space+DoubleToStr(ma5.p3,Digits),8,"Arial",Red);} if(Bid<=ma5.p3 && Ask>=ma5.p3) { ObjectSetText("ma5.p3",space+DoubleToStr(ma5.p3,Digits),8,"Arial",Yellow);} ObjectCreate("ma6.p3",OBJ_TEXT,0,t1.p3,NormalizeDouble(ma6.p3,Digits));//144 ma if(Bid>ma6.p3) {ObjectSetText("ma6.p3",space+DoubleToStr(ma6.p3,Digits),8,"Arial",Green);} if(Ask<ma6.p3) {ObjectSetText("ma6.p3",space+DoubleToStr(ma6.p3,Digits),8,"Arial",Red);} if(Bid<=ma6.p3 && Ask>=ma6.p3) { ObjectSetText("ma6.p3",space+DoubleToStr(ma6.p3,Digits),8,"Arial",Yellow);} ObjectCreate("ma7.p3",OBJ_TEXT,0,t1.p3,NormalizeDouble(ma7.p3,Digits));//233 ma if(Bid>ma7.p3) {ObjectSetText("ma7.p3",space+DoubleToStr(ma7.p3,Digits),8,"Arial",Green);} if(Ask<ma7.p3) {ObjectSetText("ma7.p3",space+DoubleToStr(ma7.p3,Digits),8,"Arial",Red);} if(Bid<=ma7.p3 && Ask>=ma7.p3) { ObjectSetText("ma7.p3",space+DoubleToStr(ma7.p3,Digits),8,"Arial",Yellow);} }//end p3.Fib.Plot() void p4.Fib.Plot() { //p4 dynamic fibo levels double lo.ma.p4,hi.ma.p4; lo.ma.p4=ma1.p4; if(ma2.p4<lo.ma.p4) {lo.ma.p4=ma2.p4;} if(ma3.p4<lo.ma.p4) {lo.ma.p4=ma3.p4;} if(ma4.p4<lo.ma.p4) {lo.ma.p4=ma4.p4;} if(ma5.p4<lo.ma.p4) {lo.ma.p4=ma5.p4;} if(ma6.p4<lo.ma.p4) {lo.ma.p4=ma6.p4;} if(ma7.p4<lo.ma.p4) {lo.ma.p4=ma7.p4;} lo.ma.p4=NormalizeDouble(lo.ma.p4+(fib.SR.shadow.1*Point),Digits); hi.ma.p4=ma7.p4; if(ma6.p4>hi.ma.p4) {hi.ma.p4=ma6.p4;} if(ma5.p4>hi.ma.p4) {hi.ma.p4=ma5.p4;} if(ma4.p4>hi.ma.p4) {hi.ma.p4=ma4.p4;} if(ma3.p4>hi.ma.p4) {hi.ma.p4=ma3.p4;} if(ma2.p4>hi.ma.p4) {hi.ma.p4=ma2.p4;} if(ma1.p4>hi.ma.p4) {hi.ma.p4=ma1.p4;} hi.ma.p4=NormalizeDouble(hi.ma.p4-(fib.SR.shadow.1*Point),Digits); //p4 center dynamic fib placement if(lo.ma.p4-hi.ma.p4>Ask-Bid) { ObjectCreate("lcf.p4",OBJ_TREND,0,t1.p4, lo.ma.p4, t2.p4, lo.ma.p4); ObjectSet("lcf.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lcf.p4",OBJPROP_WIDTH,2); ObjectSet("lcf.p4",OBJPROP_RAY,false); ObjectSet("lcf.p4",OBJPROP_COLOR,fib.SR.shadow.1.c); ObjectSetText("lcf.p4",DoubleToStr(lo.ma.p4,Digits),7,"Arial",fib.SR.shadow.1.c); ObjectCreate("hcf.p4",OBJ_TREND,0,t1.p4, hi.ma.p4, t2.p4, hi.ma.p4); ObjectSet("hcf.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hcf.p4",OBJPROP_WIDTH,2); ObjectSet("hcf.p4",OBJPROP_RAY,false); ObjectSet("hcf.p4",OBJPROP_COLOR,fib.SR.shadow.1.c); ObjectSetText("hcf.p4",DoubleToStr(hi.ma.p4,Digits),7,"Arial",fib.SR.shadow.1.c); } double lo.ma.p4.1, lo.ma.p4.2, lo.ma.p4.3, lo.ma.p4.4, lo.ma.p4.5, lo.ma.p4.6; lo.ma.p4.1=lo.ma.p4+(fib.SR.shadow.2*Point); lo.ma.p4.2=lo.ma.p4.1+(fib.SR.shadow.3*Point); lo.ma.p4.3=lo.ma.p4.2+(fib.SR.shadow.4*Point); lo.ma.p4.4=lo.ma.p4.3+(fib.SR.shadow.5*Point); lo.ma.p4.5=lo.ma.p4.4+(fib.SR.shadow.6*Point); lo.ma.p4.6=lo.ma.p4.5+(fib.SR.shadow.7*Point); double hi.ma.p4.1, hi.ma.p4.2, hi.ma.p4.3, hi.ma.p4.4, hi.ma.p4.5, hi.ma.p4.6; hi.ma.p4.1=hi.ma.p4-(fib.SR.shadow.2*Point); hi.ma.p4.2=hi.ma.p4.1-(fib.SR.shadow.3*Point); hi.ma.p4.3=hi.ma.p4.2-(fib.SR.shadow.4*Point); hi.ma.p4.4=hi.ma.p4.3-(fib.SR.shadow.5*Point); hi.ma.p4.5=hi.ma.p4.4-(fib.SR.shadow.6*Point); hi.ma.p4.6=hi.ma.p4.5-(fib.SR.shadow.7*Point); //p4 1st level (hi.1.p4, lo.1.p4) if(lo.ma.p4.1-hi.ma.p4.1>Ask-Bid) { ObjectCreate("lo.1.p4",OBJ_TREND,0,t1.p4, lo.ma.p4.1, t2.p4, lo.ma.p4.1); ObjectSet("lo.1.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.1.p4",OBJPROP_WIDTH,2); ObjectSet("lo.1.p4",OBJPROP_RAY,false); ObjectSet("lo.1.p4",OBJPROP_COLOR,fib.SR.shadow.2.c); ObjectSetText("lo.1.p4",DoubleToStr(lo.ma.p4.1,Digits),7,"Arial",fib.SR.shadow.2.c); ObjectCreate("hi.1.p4",OBJ_TREND,0,t1.p4, hi.ma.p4.1, t2.p4, hi.ma.p4.1); ObjectSet("hi.1.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.1.p4",OBJPROP_WIDTH,2); ObjectSet("hi.1.p4",OBJPROP_RAY,false); ObjectSet("hi.1.p4",OBJPROP_COLOR,fib.SR.shadow.2.c); ObjectSetText("hi.1.p4",DoubleToStr(hi.ma.p4.1,Digits),7,"Arial",fib.SR.shadow.2.c); } // 2st level (hi.2.p4, lo.2.p4) if(lo.ma.p4.2-hi.ma.p4.2>Ask-Bid) { ObjectCreate("lo.2.p4",OBJ_TREND,0,t1.p4, lo.ma.p4.2, t2.p4, lo.ma.p4.2); ObjectSet("lo.2.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.2.p4",OBJPROP_WIDTH,2); ObjectSet("lo.2.p4",OBJPROP_RAY,false); ObjectSet("lo.2.p4",OBJPROP_COLOR,fib.SR.shadow.3.c); ObjectSetText("lo.2.p4",DoubleToStr(lo.ma.p4.2,Digits),7,"Arial",fib.SR.shadow.3.c); ObjectCreate("hi.2.p4",OBJ_TREND,0,t1.p4, hi.ma.p4.2, t2.p4, hi.ma.p4.2); ObjectSet("hi.2.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.2.p4",OBJPROP_WIDTH,2); ObjectSet("hi.2.p4",OBJPROP_RAY,false); ObjectSet("hi.2.p4",OBJPROP_COLOR,fib.SR.shadow.3.c); ObjectSetText("hi.2.p4",DoubleToStr(hi.ma.p4.2,Digits),7,"Arial",fib.SR.shadow.3.c); } // 3rd level (hi.3.p4, lo.3.p4) if(lo.ma.p4.3-hi.ma.p4.3>Ask-Bid) { ObjectCreate("lo.3.p4",OBJ_TREND,0,t1.p4, lo.ma.p4.3, t2.p4, lo.ma.p4.3); ObjectSet("lo.3.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.3.p4",OBJPROP_WIDTH,2); ObjectSet("lo.3.p4",OBJPROP_RAY,false); ObjectSet("lo.3.p4",OBJPROP_COLOR,fib.SR.shadow.4.c); ObjectSetText("lo.3.p4",DoubleToStr(lo.ma.p4.3,Digits),7,"Arial",fib.SR.shadow.4.c); ObjectCreate("hi.3.p4",OBJ_TREND,0,t1.p4, hi.ma.p4.3, t2.p4, hi.ma.p4.3); ObjectSet("hi.3.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.3.p4",OBJPROP_WIDTH,2); ObjectSet("hi.3.p4",OBJPROP_RAY,false); ObjectSet("hi.3.p4",OBJPROP_COLOR,fib.SR.shadow.4.c); ObjectSetText("hi.3.p4",DoubleToStr(hi.ma.p4.3,Digits),7,"Arial",fib.SR.shadow.4.c); } // 4th level (hi.4.p4, lo.4.p4) if(lo.ma.p4.4-hi.ma.p4.4>Ask-Bid) { ObjectCreate("lo.4.p4",OBJ_TREND,0,t1.p4, lo.ma.p4.4, t2.p4, lo.ma.p4.4); ObjectSet("lo.4.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.4.p4",OBJPROP_WIDTH,2); ObjectSet("lo.4.p4",OBJPROP_RAY,false); ObjectSet("lo.4.p4",OBJPROP_COLOR,fib.SR.shadow.5.c); ObjectSetText("lo.4.p4",DoubleToStr(lo.ma.p4.4,Digits),7,"Arial",fib.SR.shadow.5.c); ObjectCreate("hi.4.p4",OBJ_TREND,0,t1.p4, hi.ma.p4.4, t2.p4, hi.ma.p4.4); ObjectSet("hi.4.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.4.p4",OBJPROP_WIDTH,2); ObjectSet("hi.4.p4",OBJPROP_RAY,false); ObjectSet("hi.4.p4",OBJPROP_COLOR,fib.SR.shadow.5.c); ObjectSetText("hi.4.p4",DoubleToStr(hi.ma.p4.4,Digits),7,"Arial",fib.SR.shadow.5.c); } // 5th level (hi.5.p4, lo.5.p4) if(lo.ma.p4.5-hi.ma.p4.5>Ask-Bid) { ObjectCreate("lo.5.p4",OBJ_TREND,0,t1.p4, lo.ma.p4.5, t2.p4, lo.ma.p4.5); ObjectSet("lo.5.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.5.p4",OBJPROP_WIDTH,2); ObjectSet("lo.5.p4",OBJPROP_RAY,false); ObjectSet("lo.5.p4",OBJPROP_COLOR,fib.SR.shadow.6.c); ObjectSetText("lo.5.p4",DoubleToStr(lo.ma.p4.5,Digits),7,"Arial",fib.SR.shadow.6.c); ObjectCreate("hi.5.p4",OBJ_TREND,0,t1.p4, hi.ma.p4.5, t2.p4, hi.ma.p4.5); ObjectSet("hi.5.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.5.p4",OBJPROP_WIDTH,2); ObjectSet("hi.5.p4",OBJPROP_RAY,false); ObjectSet("hi.5.p4",OBJPROP_COLOR,fib.SR.shadow.6.c); ObjectSetText("hi.5.p4",DoubleToStr(hi.ma.p4.5,Digits),7,"Arial",fib.SR.shadow.6.c); } // 6th level (hi.6.p4, lo.6.p4) if(lo.ma.p4.6-hi.ma.p4.6>Ask-Bid) { ObjectCreate("lo.6.p4",OBJ_TREND,0,t1.p4, lo.ma.p4.6, t2.p4, lo.ma.p4.6); ObjectSet("lo.6.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("lo.6.p4",OBJPROP_WIDTH,2); ObjectSet("lo.6.p4",OBJPROP_RAY,false); ObjectSet("lo.6.p4",OBJPROP_COLOR,fib.SR.shadow.7.c); ObjectSetText("lo.6.p4",DoubleToStr(lo.ma.p4.6,Digits),7,"Arial",fib.SR.shadow.7.c); ObjectCreate("hi.6.p4",OBJ_TREND,0,t1.p4, hi.ma.p4.6, t2.p4, hi.ma.p4.6); ObjectSet("hi.6.p4",OBJPROP_STYLE,STYLE_SOLID); ObjectSet("hi.6.p4",OBJPROP_WIDTH,2); ObjectSet("hi.6.p4",OBJPROP_RAY,false); ObjectSet("hi.6.p4",OBJPROP_COLOR,fib.SR.shadow.7.c); ObjectSetText("hi.6.p4",DoubleToStr(hi.ma.p4.6,Digits),7,"Arial",fib.SR.shadow.7.c); } //...............Moving Average Support & Resistance Levels.............................. string space=" "; ObjectCreate("ma1.p4",OBJ_TEXT,0,t1.p4,ma1.p4);//13 ma ObjectSetText("ma1.p4",space+DoubleToStr(ma1.p4,Digits),8,"Arial",White); ObjectCreate("ma2.p4",OBJ_TEXT,0,t1.p4,ma2.p4);//21 ma ObjectSetText("ma2.p4",space+DoubleToStr(ma2.p4,Digits),8,"Arial",White); ObjectCreate("ma3.p4",OBJ_TEXT,0,t1.p4,ma3.p4);//34 ma if(Bid>ma3.p4) {ObjectSetText("ma3.p4",space+DoubleToStr(ma3.p4,Digits),8,"Arial",LightGreen);} if(Ask<ma3.p4) {ObjectSetText("ma3.p4",space+DoubleToStr(ma3.p4,Digits),8,"Arial",Pink);} if(Bid<=ma3.p4 && Ask>=ma3.p4) { ObjectSetText("ma3.p4",space+DoubleToStr(ma3.p4,Digits),8,"Arial",Yellow);} ObjectCreate("ma4.p4",OBJ_TEXT,0,t1.p4,ma4.p4);//55 ma if(Bid>ma4.p4) {ObjectSetText("ma4.p4",space+DoubleToStr(ma4.p4,Digits),8,"Arial",LightGreen);} if(Ask<ma4.p4) {ObjectSetText("ma4.p4",space+DoubleToStr(ma4.p4,Digits),8,"Arial",Pink);} if(Bid<=ma4.p4 && Ask>=ma4.p4) { ObjectSetText("ma4.p4",space+DoubleToStr(ma4.p4,Digits),8,"Arial",Yellow);} ObjectCreate("ma5.p4",OBJ_TEXT,0,t1.p4,ma5.p4);//89 ma if(Bid>ma5.p4) {ObjectSetText("ma5.p4",space+DoubleToStr(ma5.p4,Digits),8,"Arial",Green);} if(Ask<ma5.p4) {ObjectSetText("ma5.p4",space+DoubleToStr(ma5.p4,Digits),8,"Arial",Red);} if(Bid<=ma5.p4 && Ask>=ma5.p4) { ObjectSetText("ma5.p4",space+DoubleToStr(ma5.p4,Digits),8,"Arial",Yellow);} ObjectCreate("ma6.p4",OBJ_TEXT,0,t1.p4,NormalizeDouble(ma6.p4,Digits));//144 ma if(Bid>ma6.p4) {ObjectSetText("ma6.p4",space+DoubleToStr(ma6.p4,Digits),8,"Arial",Green);} if(Ask<ma6.p4) {ObjectSetText("ma6.p4",space+DoubleToStr(ma6.p4,Digits),8,"Arial",Red);} if(Bid<=ma6.p4 && Ask>=ma6.p4) { ObjectSetText("ma6.p4",space+DoubleToStr(ma6.p4,Digits),8,"Arial",Yellow);} ObjectCreate("ma7.p4",OBJ_TEXT,0,t1.p4,NormalizeDouble(ma7.p4,Digits));//233 ma if(Bid>ma7.p4) {ObjectSetText("ma7.p4",space+DoubleToStr(ma7.p4,Digits),8,"Arial",Green);} if(Ask<ma7.p4) {ObjectSetText("ma7.p4",space+DoubleToStr(ma7.p4,Digits),8,"Arial",Red);} if(Bid<=ma7.p4 && Ask>=ma7.p4) { ObjectSetText("ma7.p4",space+DoubleToStr(ma7.p4,Digits),8,"Arial",Yellow);} }//end p4.Fib.Plot() void column() { //..................Time Frame Columns................................................. //Addition - uses Psar of that timeframe to colour the lanes //Dull red-green psars are not with you //brighter red-green psar in your favour // because Psar appears with the new bar I thing i can use Bar 0 // for faster notification. //1st Column if(iSAR(NULL,p1.ma,0.02,0.2,0)<Open[0])// no equals for 1 min its sensitive { ObjectCreate("up.p1",OBJ_RECTANGLE,0,t1.p1,Ask,t2.p1,Ask*1.5); ObjectSet("up.p1",OBJPROP_COLOR,LimeGreen); } else { ObjectCreate("up.p1",OBJ_RECTANGLE,0,t1.p1,Ask,t2.p1,Ask*1.5); ObjectSet("up.p1",OBJPROP_COLOR,Green); } if(iSAR(NULL,p1.ma,0.02,0.2,0)>Open[0])// no equals for 1 min its sensitive { ObjectCreate("down.p1",OBJ_RECTANGLE,0,t1.p1,Bid,t2.p1,0); ObjectSet("down.p1",OBJPROP_COLOR,Red); } else { ObjectCreate("down.p1",OBJ_RECTANGLE,0,t1.p1,Bid,t2.p1,0); ObjectSet("down.p1",OBJPROP_COLOR,IndianRed); } //2nd Column if(iSAR(NULL,p2.ma,0.02,0.2,0)<=Open[0]) { ObjectCreate("up.p2",OBJ_RECTANGLE,0,t1.p2,Ask,t2.p2,Ask*1.5); ObjectSet("up.p2",OBJPROP_COLOR,LimeGreen); } else { ObjectCreate("up.p2",OBJ_RECTANGLE,0,t1.p2,Ask,t2.p2,Ask*1.5); ObjectSet("up.p2",OBJPROP_COLOR,Green); } if(iSAR(NULL,p2.ma,0.02,0.2,0)>=Open[0]) { ObjectCreate("down.p2",OBJ_RECTANGLE,0,t1.p2,0,t2.p2,Bid); ObjectSet("down.p2",OBJPROP_COLOR,Red); } else { ObjectCreate("down.p2",OBJ_RECTANGLE,0,t1.p2,0,t2.p2,Bid); ObjectSet("down.p2",OBJPROP_COLOR,IndianRed); } //3rd Column if(iSAR(NULL,p3.ma,0.02,0.2,0)<=Open[0]) { ObjectCreate("up.p3",OBJ_RECTANGLE,0,t1.p3,Ask,t2.p3,Ask*1.5); ObjectSet("up.p3",OBJPROP_COLOR,LimeGreen); } else { ObjectCreate("up.p3",OBJ_RECTANGLE,0,t1.p3,Ask,t2.p3,Ask*1.5); ObjectSet("up.p3",OBJPROP_COLOR,Green); } if(iSAR(NULL,p3.ma,0.02,0.2,0)>=Open[0]) { ObjectCreate("down.p3",OBJ_RECTANGLE,0,t1.p3,Bid,t2.p3,0); ObjectSet("down.p3",OBJPROP_COLOR,Red); } else { ObjectCreate("down.p3",OBJ_RECTANGLE,0,t1.p3,Bid,t2.p3,0); ObjectSet("down.p3",OBJPROP_COLOR,IndianRed); } //4th column if(iSAR(NULL,p4.ma,0.02,0.2,0)<=Open[0]) { ObjectCreate("up.p4",OBJ_RECTANGLE,0,t1.p4,Ask,t2.p4,Ask*1.5); ObjectSet("up.p4",OBJPROP_COLOR,LimeGreen); } else { ObjectCreate("up.p4",OBJ_RECTANGLE,0,t1.p4,Ask,t2.p4,Ask*1.5); ObjectSet("up.p4",OBJPROP_COLOR,Green); } if(iSAR(NULL,p4.ma,0.02,0.2,0)>=Open[0]) { ObjectCreate("down.p4",OBJ_RECTANGLE,0,t1.p4,Bid,t2.p4,0); ObjectSet("down.p4",OBJPROP_COLOR,Red); } else { ObjectCreate("down.p4",OBJ_RECTANGLE,0,t1.p4,Bid,t2.p4,0); ObjectSet("down.p4",OBJPROP_COLOR,IndianRed); } }//end Columns void Refresh() { if (Use_Std_Reg) { ObjectDelete("regression channel");ObjectDelete("std channel"); } ObjectDelete("up.p1"); ObjectDelete("down.p1"); ObjectDelete("lcf.p1"); ObjectDelete("hcf.p1"); ObjectDelete("ma1.p1"); ObjectDelete("lo.1.p1"); ObjectDelete("hi.1.p1"); ObjectDelete("ma2.p1"); ObjectDelete("lo.2.p1"); ObjectDelete("hi.2.p1"); ObjectDelete("ma3.p1"); ObjectDelete("lo.3.p1"); ObjectDelete("hi.3.p1"); ObjectDelete("ma4.p1"); ObjectDelete("lo.4.p1"); ObjectDelete("hi.4.p1"); ObjectDelete("ma5.p1"); ObjectDelete("lo.5.p1"); ObjectDelete("hi.5.p1"); ObjectDelete("ma6.p1"); ObjectDelete("lo.6.p1"); ObjectDelete("hi.6.p1"); ObjectDelete("ma7.p1"); ObjectDelete("lo.7.p1"); ObjectDelete("hi.7.p1"); ObjectDelete("up.p2"); ObjectDelete("down.p2"); ObjectDelete("lcf.p2"); ObjectDelete("hcf.p2"); ObjectDelete("ma1.p2"); ObjectDelete("lo.1.p2"); ObjectDelete("hi.1.p2"); ObjectDelete("ma2.p2"); ObjectDelete("lo.2.p2"); ObjectDelete("hi.2.p2"); ObjectDelete("ma3.p2"); ObjectDelete("lo.3.p2"); ObjectDelete("hi.3.p2"); ObjectDelete("ma4.p2"); ObjectDelete("lo.4.p2"); ObjectDelete("hi.4.p2"); ObjectDelete("ma5.p2"); ObjectDelete("lo.5.p2"); ObjectDelete("hi.5.p2"); ObjectDelete("ma6.p2"); ObjectDelete("lo.6.p2"); ObjectDelete("hi.6.p2"); ObjectDelete("ma7.p2"); ObjectDelete("lo.7.p2"); ObjectDelete("hi.7.p2"); ObjectDelete("up.p3"); ObjectDelete("down.p3"); ObjectDelete("lcf.p3"); ObjectDelete("hcf.p3"); ObjectDelete("ma1.p3"); ObjectDelete("lo.1.p3"); ObjectDelete("hi.1.p3"); ObjectDelete("ma2.p3"); ObjectDelete("lo.2.p3"); ObjectDelete("hi.2.p3"); ObjectDelete("ma3.p3"); ObjectDelete("lo.3.p3"); ObjectDelete("hi.3.p3"); ObjectDelete("ma4.p3"); ObjectDelete("lo.4.p3"); ObjectDelete("hi.4.p3"); ObjectDelete("ma5.p3"); ObjectDelete("lo.5.p3"); ObjectDelete("hi.5.p3"); ObjectDelete("ma6.p3"); ObjectDelete("lo.6.p3"); ObjectDelete("hi.6.p3"); ObjectDelete("ma7.p3"); ObjectDelete("lo.7.p3"); ObjectDelete("hi.7.p3"); ObjectDelete("up.p4"); ObjectDelete("down.p4"); ObjectDelete("lcf.p4"); ObjectDelete("hcf.p4"); ObjectDelete("ma1.p4"); ObjectDelete("lo.1.p4"); ObjectDelete("hi.1.p4"); ObjectDelete("ma2.p4"); ObjectDelete("lo.2.p4"); ObjectDelete("hi.2.p4"); ObjectDelete("ma3.p4"); ObjectDelete("lo.3.p4"); ObjectDelete("hi.3.p4"); ObjectDelete("ma4.p4"); ObjectDelete("lo.4.p4"); ObjectDelete("hi.4.p4"); ObjectDelete("ma5.p4"); ObjectDelete("lo.5.p4"); ObjectDelete("hi.5.p4"); ObjectDelete("ma6.p4"); ObjectDelete("lo.6.p4"); ObjectDelete("hi.6.p4"); ObjectDelete("ma7.p4"); ObjectDelete("lo.7.p4"); ObjectDelete("hi.7.p4");} //---- done
Indicatore Metatrader - 5dayBreakout//+------------------------------------------------------------------+ //| 5dayBreakout.mq4 | //| Bill Sica | //| http://www.tetsuyama.com | //+------------------------------------------------------------------+ #property copyright "Bill Sica" #property link "http://www.tetsuyama.com" #property indicator_chart_window //---- input parameters extern int DAYS=5; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double daily_high[20]; double daily_low[20]; double yesterday_close; double phigh,plow; int i=1; //---- TODO: add your code here ArrayResize(daily_high,DAYS); ArrayResize(daily_low,DAYS); ArrayInitialize(daily_high,0); ArrayInitialize(daily_low,0); ArrayCopySeries(daily_low, MODE_LOW, Symbol(), PERIOD_D1); ArrayCopySeries(daily_high, MODE_HIGH, Symbol(), PERIOD_D1); /* initialise */ plow=daily_low[1]; phigh=daily_high[1]; for(i=1;i<DAYS;i++) { if(plow>daily_low[i]) { plow =daily_low[i]; } } for(i=1;i<DAYS;i++) { if(phigh<daily_high[i]) { phigh =daily_high[i]; } } Comment("\n5dayH ",phigh,"\n5dayL ",plow); ObjectDelete("5dayHigh"); ObjectDelete("5dayLow"); ObjectCreate("5dayHigh", OBJ_HLINE,0, CurTime(),phigh); ObjectSet("5dayHigh",OBJPROP_COLOR,SpringGreen); ObjectSet("5dayHigh",OBJPROP_STYLE,STYLE_SOLID); ObjectCreate("5dayLow", OBJ_HLINE,0, CurTime(),plow); ObjectSet("5dayLow",OBJPROP_COLOR,Red); ObjectSet("5dayLow",OBJPROP_STYLE,STYLE_SOLID); ObjectsRedraw(); return(0); } //+------------------------------------------------------------------
Indicatore Metatrader - 4Period RSI Arrows//+-------------------------------------------------------------------------+ //| 4Period_RSI_Arrows.mq4 | //| transport_david thanks the many friends @ | //| http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/| //+-------------------------------------------------------------------------+ #property indicator_chart_window #property indicator_buffers 8 #property indicator_color1 Honeydew #property indicator_color2 Honeydew #property indicator_color3 Pink #property indicator_color4 Pink #property indicator_color5 Coral #property indicator_color6 Coral #property indicator_color7 Red #property indicator_color8 Red //---- input parameters extern int atf=5;//Period() in minutes extern int btf=15;//Period() in minutes extern int ctf=30;//Period() in minutes extern int dtf=60;//Period() in minutes extern int first_RSIperiods=9; extern int second_RSIperiods=9; extern int third_RSIperiods=9; extern int fourth_RSIperiods=9; extern int rsi.applied.price=5;/* Applied price constants. It can be any of the following values: Constant Value Description PRICE_CLOSE 0 Close price, PRICE_OPEN 1 Open price, PRICE_HIGH 2 High price, PRICE_LOW 3 Low price, PRICE_MEDIAN 4 Median price, (high+low)/2, PRICE_TYPICAL 5 Typical price, (high+low+close)/3, PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4. */ extern int shift=0; extern int rsiUpperTrigger=62; extern int rsiLowerTrigger=38; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; double ExtMapBuffer5[]; double ExtMapBuffer6[]; double ExtMapBuffer7[]; double ExtMapBuffer8[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,234); SetIndexBuffer(0,ExtMapBuffer1); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,233); SetIndexBuffer(1,ExtMapBuffer2); SetIndexEmptyValue(1,0.0); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,234); SetIndexBuffer(2,ExtMapBuffer3); SetIndexEmptyValue(2,0.0); SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(3,233); SetIndexBuffer(3,ExtMapBuffer4); SetIndexEmptyValue(3,0.0); SetIndexStyle(4,DRAW_ARROW); SetIndexArrow(4,234); SetIndexBuffer(4,ExtMapBuffer5); SetIndexEmptyValue(4,0.0); SetIndexStyle(5,DRAW_ARROW); SetIndexArrow(5,233); SetIndexBuffer(5,ExtMapBuffer6); SetIndexEmptyValue(5,0.0); SetIndexStyle(6,DRAW_ARROW); SetIndexArrow(6,234); SetIndexBuffer(6,ExtMapBuffer7); SetIndexEmptyValue(6,0.0); SetIndexStyle(7,DRAW_ARROW); SetIndexArrow(7,233); SetIndexBuffer(7,ExtMapBuffer8); SetIndexEmptyValue(7,0.0); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int i; //---- for (i=Bars-50;i>=0;i--) { double one = iRSI(Symbol(),atf,first_RSIperiods,rsi.applied.price,i+shift); if (one < rsiLowerTrigger) ExtMapBuffer1[i]=High[i]+5*Point; if (one > rsiUpperTrigger) ExtMapBuffer2[i]=Low[i]-5*Point; } for (i=Bars-50;i>=0;i--) { double two = iRSI(Symbol(),btf,second_RSIperiods,rsi.applied.price,i+shift); if (two < rsiLowerTrigger) ExtMapBuffer3[i]=High[i]+8*Point; if (two > rsiUpperTrigger) ExtMapBuffer4[i]=Low[i]-8*Point; } for (i=Bars-50;i>=0;i--) { double three = iRSI(Symbol(),ctf,third_RSIperiods,rsi.applied.price,i+shift); if (three < rsiLowerTrigger) ExtMapBuffer5[i]=High[i]+11*Point; if (three > rsiUpperTrigger) ExtMapBuffer6[i]=Low[i]-11*Point; } for (i=Bars-50;i>=0;i--) { double four = iRSI(Symbol(),dtf,fourth_RSIperiods,rsi.applied.price,i+shift); if (four < rsiLowerTrigger) ExtMapBuffer7[i]=High[i]+14*Point; if (four > rsiUpperTrigger) ExtMapBuffer8[i]=Low[i]-14*Point; } //---- return(0); } //+------------------------------------------------------------------+
Indicatore Metatrader - 3shadeopen//+------------------------------------------------------------------+ //| 3shadeopen.mq4 | //| Copyright © 2006, sx ted | //| Purpose: shade New York or other sessions for chart time frames | //| M1 to H4 (at a push). | //| version: 2 - enhanced for speed but with MT4 beeing so fast no | //| difference will be noticed, all the sessions are | //| shaded in the init(), last session if it is current | //| is widened in the start() in lieu of repainting all.| //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, sx ted" #property link "" #property indicator_chart_window //---- input parameters extern color ShadeColor=Gold; /* // if in Moscow #define NY_OPEN_HH 17 // NY session open hour #define NY_OPEN_MM 30 // NY session open minutes #define NY_CLOSE_HH 00 // NY session close hour #define NY_CLOSE_MM 05 // NY session close minutes */ /* if in London #define NY_OPEN_HH 14 // NY session open hour #define NY_OPEN_MM 30 // NY session open minutes #define NY_CLOSE_HH 21 // NY session close hour #define NY_CLOSE_MM 05 // NY session close minutes */ // if in New York #define NY_OPEN_HH 06 // NY session open hour #define NY_OPEN_MM 30 // NY session open minutes #define NY_CLOSE_HH 13 // NY session close hour #define NY_CLOSE_MM 05 // NY session close minutes #define MAX_DAYS_TO_SHADE 5 // maximum number of days back from last chart date to be shaded //---- global variables to program string obj[]; //array of object names int iPrevious=0, iStart=-1, iEnd; double dLow, dHigh; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { if(Period()>PERIOD_H4) return(0); // no shading required int iMaxBarsOnChart=iBars(NULL,0), i, iBarDay, iBarTime; // find approximate start of first day to shade int iBarsToDo=MathMin((MAX_DAYS_TO_SHADE*PERIOD_D1)/Period(),iMaxBarsOnChart); // find start of first day to shade for(i=iBarsToDo; i<iMaxBarsOnChart; i++) { iBarDay=TimeYear(Time[i])*PERIOD_MN1*12+TimeMonth(Time[i])*PERIOD_MN1+TimeDay(Time[i])*PERIOD_D1; iBarTime=iBarDay+TimeHour(Time[i])*60+TimeMinute(Time[i]); if(iBarTime>=iBarDay+NY_OPEN_HH*60+NY_OPEN_MM && iBarTime<=iBarDay+NY_CLOSE_HH*60+NY_CLOSE_MM) iStart=i; else if(iStart>-1) break; } if(iStart>-1) iBarsToDo=iStart; iStart=-1; // shade previous sessions and current session if started for(i=iBarsToDo; i>=0; i--) { iBarDay=TimeYear(Time[i])*PERIOD_MN1*12+TimeMonth(Time[i])*PERIOD_MN1+TimeDay(Time[i])*PERIOD_D1; iBarTime=iBarDay+TimeHour(Time[i])*60+TimeMinute(Time[i]); if(iBarTime>=iBarDay+NY_OPEN_HH*60+NY_OPEN_MM && iBarTime<=iBarDay+NY_CLOSE_HH*60+NY_CLOSE_MM) { if(iBarDay==iPrevious) // current NY session { dLow =MathMin(dLow, Low[i]); dHigh=MathMax(dHigh, High[i]); } else // new NY session { dLow=Low[i]; dHigh=High[i]; iStart=i; iPrevious=iBarDay; } iEnd=i; } else if(iStart>-1) { PaintRectangle(); iStart=-1; } } if(iStart>-1) PaintRectangle(); // paint the last one if session not closed return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { int iaCount=ArraySize(obj); for(int i=0; i<iaCount; i++) { if(ObjectFind(obj[i])>-1) ObjectDelete(obj[i]); } return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i=0, iBarDay, iBarTime; iBarDay=TimeYear(Time[i])*PERIOD_MN1*12+TimeMonth(Time[i])*PERIOD_MN1+TimeDay(Time[i])*PERIOD_D1; iBarTime=iBarDay+TimeHour(Time[i])*60+TimeMinute(Time[i]); if(iBarTime>=iBarDay+NY_OPEN_HH*60+NY_OPEN_MM && iBarTime<=iBarDay+NY_CLOSE_HH*60+NY_CLOSE_MM) { if(iBarDay==iPrevious) // current NY session { dLow =MathMin(dLow, Low[i]); dHigh=MathMax(dHigh, High[i]); } else // new NY session { dLow=Low[i]; dHigh=High[i]; iStart=i; iPrevious=iBarDay; } iEnd=i; PaintRectangle(); } return(0); } //+------------------------------------------------------------------+ //| Paint rectangle | //+------------------------------------------------------------------+ void PaintRectangle() { string sObj="ShadeNY_"+DoubleToStr(iPrevious, 0); // name for the object if(ObjectFind(sObj)>-1) { // current session object found, so just widen it ObjectSet(sObj,OBJPROP_PRICE1,dLow-Point); ObjectSet(sObj,OBJPROP_TIME2 ,Time[iEnd]); ObjectSet(sObj,OBJPROP_PRICE2,dHigh+Point); } else { // otherwise create new object for the session int iaCount=ArraySize(obj); ArrayResize(obj, iaCount+1); obj[iaCount]=sObj; ObjectCreate(sObj,OBJ_RECTANGLE,0,Time[iStart],dLow-Point,Time[iEnd],dHigh+Point); ObjectSet(sObj,OBJPROP_COLOR,ShadeColor); } } //+------------------------------------------------------------------+
Indicatore Metatrader -  3LineBreak//+------------------------------------------------------------------+ //| 3LineBreak.mq4 | //| Copyright © 2004, Poul_Trade_Forum | //| Aborigen | //| http://forex.kbpauk.ru/ | //+------------------------------------------------------------------+ #property copyright "Poul Trade Forum" #property link "http://forex.kbpauk.ru/" #property indicator_chart_window #property indicator_buffers 2 //---- input parameters extern int Lines_Break=3; //---- buffers double HighBuffer[]; double LowBuffer[]; double VALUE1,VALUE2,Swing=1,OLDSwing; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,2,Blue); SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,2,Red); SetIndexBuffer(0,HighBuffer); SetIndexBuffer(1,LowBuffer); SetIndexEmptyValue(0,0); SetIndexEmptyValue(1,0); //---- name for DataWindow and indicator subwindow label short_name="3LineBreak"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); //---- SetIndexDrawBegin(0,10); SetIndexDrawBegin(1,10); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- TODO: add your code here //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(),i,shift; //---- TODO: add your code here if (counted_bars==0) counted_bars=Lines_Break+1; i=(Bars-counted_bars); for (shift=i; shift>=0;shift--) { OLDSwing=Swing; VALUE1=High[Highest(NULL,0,MODE_HIGH,Lines_Break,shift+1)]; VALUE2= Low[Lowest(NULL,0,MODE_LOW,Lines_Break,shift+1)]; if (OLDSwing==1 && Low[shift]<VALUE2) Swing=-1; if (OLDSwing==-1 && High[shift]>VALUE1 ) Swing=1; if (Swing==1) { HighBuffer[shift]=High[shift]; LowBuffer[shift]=Low[shift]; } if (Swing==-1) { LowBuffer[shift]=High[shift]; HighBuffer[shift]=Low[shift]; } //---- } return(0); } //+------------------------------------------------------------------+

Forex Expert Advisor.

Avviso. I Forex Expert Advisor ed i mercati finanziari comportano rischi. Ti invitiamo a consultare il " Disclaimer " e la " Privacy "