ZigZag_ws_Chanel_SweetSNR.mq4
ZigZag_ws_Chanel_SweetSNR.mq4 FOREX MetaTrader4 Indicators Download
ZigZag_ws_Chanel_SweetSNR.mq4 download link will appear after 10 seconds.
ZigZag_ws_Chanel_SweetSNR.mq4 Programming source code.
#property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Red #property indicator_width1 2 #property indicator_color2 Pink #property indicator_color3 Pink //---- indicator parameters extern int ExtDepth=100; extern int ExtDeviation=10; extern int ExtBackstep=5; //---- indicator buffers double ZigzagBuffer[]; double HighMapBuffer[]; double LowMapBuffer[]; double BufChanelHigh[]; double BufChanelLow[]; double BufLastHigh[]; double BufLastLow[]; int level=3; // recounting's depth bool downloadhistory=false; string LabelName; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(7); //---- drawing settings SetIndexStyle(0,DRAW_SECTION); SetIndexBuffer(0,ZigzagBuffer); SetIndexEmptyValue(0,0.0); SetIndexStyle(1, DRAW_SECTION); SetIndexBuffer(1,BufChanelHigh); SetIndexEmptyValue(1,0.0); SetIndexStyle(2, DRAW_SECTION); SetIndexBuffer(2,BufChanelLow); SetIndexEmptyValue(2,0.0); SetIndexBuffer(3,HighMapBuffer); SetIndexBuffer(4,LowMapBuffer); SetIndexBuffer(5,BufLastHigh); SetIndexBuffer(6,BufLastLow); //---- indicator short name IndicatorShortName("ZigZag_ws_Chanel("+ExtDepth+","+ExtDeviation+","+ExtBackstep+")"); //---- initialization done return(0); } //+-------------------------------------------------------------------+ //| deinit | //+-------------------------------------------------------------------+ int deinit(){ int i,strlen,obj_total; string name; obj_total = ObjectsTotal(); strlen = StringLen(LabelName+"OBJ"); for(i=obj_total;i>=0;i--){ name = ObjectName(i); if(StringSubstr(name, 0, strlen) == LabelName+"OBJ") ObjectDelete(name); } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int i, counted_bars = IndicatorCounted(); int limit,counterZ,whatlookfor; int shift,back,lasthighpos,lastlowpos; double val,res; double curlow,curhigh,lasthigh,lastlow; if (counted_bars==0 && downloadhistory) // history was downloaded { ArrayInitialize(ZigzagBuffer,0.0); ArrayInitialize(BufChanelHigh,0.0); ArrayInitialize(BufChanelLow,0.0); ArrayInitialize(HighMapBuffer,0.0); ArrayInitialize(LowMapBuffer,0.0); } if (counted_bars==0) { limit=Bars-ExtDepth; downloadhistory=true; } if (counted_bars>0) { while (counterZ=0;i--) { ZigzagBuffer[i]=0.0; LowMapBuffer[i]=0.0; HighMapBuffer[i]=0.0; BufChanelHigh[i]=0.0; BufChanelLow[i]=0.0; } } for(shift=limit; shift>=0; shift--) { val=Low[iLowest(NULL,0,MODE_LOW,ExtDepth,shift)]; if(val==lastlow) val=0.0; else { lastlow=val; if((Low[shift]-val)>(ExtDeviation*Point)) val=0.0; else { for(back=1; back<=ExtBackstep; back++) { res=LowMapBuffer[shift+back]; if((res!=0)&&(res>val)) LowMapBuffer[shift+back]=0.0; } } } if (Low[shift]==val) LowMapBuffer[shift]=val; else LowMapBuffer[shift]=0.0; //--- high val=High[iHighest(NULL,0,MODE_HIGH,ExtDepth,shift)]; if(val==lasthigh) val=0.0; else { lasthigh=val; if((val-High[shift])>(ExtDeviation*Point)) val=0.0; else { for(back=1; back<=ExtBackstep; back++) { res=HighMapBuffer[shift+back]; if((res!=0)&&(res =0;shift--) { res=0.0; switch(whatlookfor) { case 0: // look for peak or lawn if (lastlow==0 && lasthigh==0) { if (HighMapBuffer[shift]!=0) { lasthigh=High[shift]; lasthighpos=shift; whatlookfor=-1; SetHighZZ(shift, lasthigh); res=1; } if (LowMapBuffer[shift]!=0) { lastlow=Low[shift]; lastlowpos=shift; whatlookfor=1; SetLowZZ(shift, lastlow); res=1; } } break; case 1: // look for peak if (LowMapBuffer[shift]!=0.0 && LowMapBuffer[shift] lasthigh && LowMapBuffer[shift]==0.0) { SetHighZZ(lasthighpos, 0.0); lasthighpos=shift; lasthigh=HighMapBuffer[shift]; SetHighZZ(shift, lasthigh); } if (LowMapBuffer[shift]!=0.0 && HighMapBuffer[shift]==0.0) { lastlow=LowMapBuffer[shift]; lastlowpos=shift; SetLowZZ(shift, lastlow); whatlookfor=1; } break; default: return; } } double HH,HL; if(lasthigh<=3.00000&&lasthigh>=2.99000){HH=3.00000; HL=2.99000;} if(lasthigh<=2.99000&&lasthigh>=2.98000){HH=2.99000; HL=2.98000;} if(lasthigh<=2.98000&&lasthigh>=2.97000){HH=2.98000; HL=2.97000;} if(lasthigh<=2.97000&&lasthigh>=2.96000){HH=2.97000; HL=2.96000;} if(lasthigh<=2.96000&&lasthigh>=2.95000){HH=2.96000; HL=2.95000;} if(lasthigh<=2.95000&&lasthigh>=2.94000){HH=2.95000; HL=2.94000;} if(lasthigh<=2.94000&&lasthigh>=2.93000){HH=2.94000; HL=2.93000;} if(lasthigh<=2.93000&&lasthigh>=2.92000){HH=2.93000; HL=2.92000;} if(lasthigh<=2.92000&&lasthigh>=2.91000){HH=2.92000; HL=2.91000;} if(lasthigh<=2.91000&&lasthigh>=2.90000){HH=2.91000; HL=2.90000;} if(lasthigh<=2.90000&&lasthigh>=2.89000){HH=2.90000; HL=2.89000;} if(lasthigh<=2.89000&&lasthigh>=2.88000){HH=2.89000; HL=2.88000;} if(lasthigh<=2.88000&&lasthigh>=2.87000){HH=2.88000; HL=2.87000;} if(lasthigh<=2.87000&&lasthigh>=2.86000){HH=2.87000; HL=2.86000;} if(lasthigh<=2.86000&&lasthigh>=2.85000){HH=2.86000; HL=2.85000;} if(lasthigh<=2.85000&&lasthigh>=2.84000){HH=2.85000; HL=2.84000;} if(lasthigh<=2.84000&&lasthigh>=2.83000){HH=2.84000; HL=2.83000;} if(lasthigh<=2.83000&&lasthigh>=2.82000){HH=2.83000; HL=2.82000;} if(lasthigh<=2.82000&&lasthigh>=2.81000){HH=2.82000; HL=2.81000;} if(lasthigh<=2.81000&&lasthigh>=2.80000){HH=2.81000; HL=2.80000;} if(lasthigh<=2.80000&&lasthigh>=2.79000){HH=2.80000; HL=2.79000;} if(lasthigh<=2.79000&&lasthigh>=2.78000){HH=2.79000; HL=2.78000;} if(lasthigh<=2.78000&&lasthigh>=2.77000){HH=2.78000; HL=2.77000;} if(lasthigh<=2.77000&&lasthigh>=2.76000){HH=2.77000; HL=2.76000;} if(lasthigh<=2.76000&&lasthigh>=2.75000){HH=2.76000; HL=2.75000;} if(lasthigh<=2.75000&&lasthigh>=2.74000){HH=2.75000; HL=2.74000;} if(lasthigh<=2.74000&&lasthigh>=2.73000){HH=2.74000; HL=2.73000;} if(lasthigh<=2.73000&&lasthigh>=2.72000){HH=2.73000; HL=2.72000;} if(lasthigh<=2.72000&&lasthigh>=2.71000){HH=2.72000; HL=2.71000;} if(lasthigh<=2.71000&&lasthigh>=2.70000){HH=2.71000; HL=2.70000;} if(lasthigh<=2.70000&&lasthigh>=2.69000){HH=2.70000; HL=2.69000;} if(lasthigh<=2.69000&&lasthigh>=2.68000){HH=2.69000; HL=2.68000;} if(lasthigh<=2.68000&&lasthigh>=2.67000){HH=2.68000; HL=2.67000;} if(lasthigh<=2.67000&&lasthigh>=2.66000){HH=2.67000; HL=2.66000;} if(lasthigh<=2.66000&&lasthigh>=2.65000){HH=2.66000; HL=2.65000;} if(lasthigh<=2.65000&&lasthigh>=2.64000){HH=2.65000; HL=2.64000;} if(lasthigh<=2.64000&&lasthigh>=2.63000){HH=2.64000; HL=2.63000;} if(lasthigh<=2.63000&&lasthigh>=2.62000){HH=2.63000; HL=2.62000;} if(lasthigh<=2.62000&&lasthigh>=2.61000){HH=2.62000; HL=2.61000;} if(lasthigh<=2.61000&&lasthigh>=2.60000){HH=2.61000; HL=2.60000;} if(lasthigh<=2.60000&&lasthigh>=2.59000){HH=2.60000; HL=2.59000;} if(lasthigh<=2.59000&&lasthigh>=2.58000){HH=2.59000; HL=2.58000;} if(lasthigh<=2.58000&&lasthigh>=2.57000){HH=2.58000; HL=2.57000;} if(lasthigh<=2.57000&&lasthigh>=2.56000){HH=2.57000; HL=2.56000;} if(lasthigh<=2.56000&&lasthigh>=2.55000){HH=2.56000; HL=2.55000;} if(lasthigh<=2.55000&&lasthigh>=2.54000){HH=2.55000; HL=2.54000;} if(lasthigh<=2.54000&&lasthigh>=2.53000){HH=2.54000; HL=2.53000;} if(lasthigh<=2.53000&&lasthigh>=2.52000){HH=2.53000; HL=2.52000;} if(lasthigh<=2.52000&&lasthigh>=2.51000){HH=2.52000; HL=2.51000;} if(lasthigh<=2.51000&&lasthigh>=2.50000){HH=2.51000; HL=2.50000;} if(lasthigh<=2.50000&&lasthigh>=2.49000){HH=2.50000; HL=2.49000;} if(lasthigh<=2.49000&&lasthigh>=2.48000){HH=2.49000; HL=2.48000;} if(lasthigh<=2.48000&&lasthigh>=2.47000){HH=2.48000; HL=2.47000;} if(lasthigh<=2.47000&&lasthigh>=2.46000){HH=2.47000; HL=2.46000;} if(lasthigh<=2.46000&&lasthigh>=2.45000){HH=2.46000; HL=2.45000;} if(lasthigh<=2.45000&&lasthigh>=2.44000){HH=2.45000; HL=2.44000;} if(lasthigh<=2.44000&&lasthigh>=2.43000){HH=2.44000; HL=2.43000;} if(lasthigh<=2.43000&&lasthigh>=2.42000){HH=2.43000; HL=2.42000;} if(lasthigh<=2.42000&&lasthigh>=2.41000){HH=2.42000; HL=2.41000;} if(lasthigh<=2.41000&&lasthigh>=2.40000){HH=2.41000; HL=2.40000;} if(lasthigh<=2.40000&&lasthigh>=2.39000){HH=2.40000; HL=2.39000;} if(lasthigh<=2.39000&&lasthigh>=2.38000){HH=2.39000; HL=2.38000;} if(lasthigh<=2.38000&&lasthigh>=2.37000){HH=2.38000; HL=2.37000;} if(lasthigh<=2.37000&&lasthigh>=2.36000){HH=2.37000; HL=2.36000;} if(lasthigh<=2.36000&&lasthigh>=2.35000){HH=2.36000; HL=2.35000;} if(lasthigh<=2.35000&&lasthigh>=2.34000){HH=2.35000; HL=2.34000;} if(lasthigh<=2.34000&&lasthigh>=2.33000){HH=2.34000; HL=2.33000;} if(lasthigh<=2.33000&&lasthigh>=2.32000){HH=2.33000; HL=2.32000;} if(lasthigh<=2.32000&&lasthigh>=2.31000){HH=2.32000; HL=2.31000;} if(lasthigh<=2.31000&&lasthigh>=2.30000){HH=2.31000; HL=2.30000;} if(lasthigh<=2.30000&&lasthigh>=2.29000){HH=2.30000; HL=2.29000;} if(lasthigh<=2.29000&&lasthigh>=2.28000){HH=2.29000; HL=2.28000;} if(lasthigh<=2.28000&&lasthigh>=2.27000){HH=2.28000; HL=2.27000;} if(lasthigh<=2.27000&&lasthigh>=2.26000){HH=2.27000; HL=2.26000;} if(lasthigh<=2.26000&&lasthigh>=2.25000){HH=2.26000; HL=2.25000;} if(lasthigh<=2.25000&&lasthigh>=2.24000){HH=2.25000; HL=2.24000;} if(lasthigh<=2.24000&&lasthigh>=2.23000){HH=2.24000; HL=2.23000;} if(lasthigh<=2.23000&&lasthigh>=2.22000){HH=2.23000; HL=2.22000;} if(lasthigh<=2.22000&&lasthigh>=2.21000){HH=2.22000; HL=2.21000;} if(lasthigh<=2.21000&&lasthigh>=2.20000){HH=2.21000; HL=2.20000;} if(lasthigh<=2.20000&&lasthigh>=2.19000){HH=2.20000; HL=2.19000;} if(lasthigh<=2.19000&&lasthigh>=2.18000){HH=2.19000; HL=2.18000;} if(lasthigh<=2.18000&&lasthigh>=2.17000){HH=2.18000; HL=2.17000;} if(lasthigh<=2.17000&&lasthigh>=2.16000){HH=2.17000; HL=2.16000;} if(lasthigh<=2.16000&&lasthigh>=2.15000){HH=2.16000; HL=2.15000;} if(lasthigh<=2.15000&&lasthigh>=2.14000){HH=2.15000; HL=2.14000;} if(lasthigh<=2.14000&&lasthigh>=2.13000){HH=2.14000; HL=2.13000;} if(lasthigh<=2.13000&&lasthigh>=2.12000){HH=2.13000; HL=2.12000;} if(lasthigh<=2.12000&&lasthigh>=2.11000){HH=2.12000; HL=2.11000;} if(lasthigh<=2.11000&&lasthigh>=2.10000){HH=2.11000; HL=2.10000;} ///////////////////////////////////////////////////////////////// if(lasthigh<=2.00000&&lasthigh>=1.99000){HH=2.00000; HL=1.99000;} if(lasthigh<=1.99000&&lasthigh>=1.98000){HH=1.99000; HL=1.98000;} if(lasthigh<=1.98000&&lasthigh>=1.97000){HH=1.98000; HL=1.97000;} if(lasthigh<=1.97000&&lasthigh>=1.96000){HH=1.97000; HL=1.96000;} if(lasthigh<=1.96000&&lasthigh>=1.95000){HH=1.96000; HL=1.95000;} if(lasthigh<=1.95000&&lasthigh>=1.94000){HH=1.95000; HL=1.94000;} if(lasthigh<=1.94000&&lasthigh>=1.93000){HH=1.94000; HL=1.93000;} if(lasthigh<=1.93000&&lasthigh>=1.92000){HH=1.93000; HL=1.92000;} if(lasthigh<=1.92000&&lasthigh>=1.91000){HH=1.92000; HL=1.91000;} if(lasthigh<=1.91000&&lasthigh>=1.90000){HH=1.91000; HL=1.90000;} if(lasthigh<=1.90000&&lasthigh>=1.89000){HH=1.90000; HL=1.89000;} if(lasthigh<=1.89000&&lasthigh>=1.88000){HH=1.89000; HL=1.88000;} if(lasthigh<=1.88000&&lasthigh>=1.87000){HH=1.88000; HL=1.87000;} if(lasthigh<=1.87000&&lasthigh>=1.86000){HH=1.87000; HL=1.86000;} if(lasthigh<=1.86000&&lasthigh>=1.85000){HH=1.86000; HL=1.85000;} if(lasthigh<=1.85000&&lasthigh>=1.84000){HH=1.85000; HL=1.84000;} if(lasthigh<=1.84000&&lasthigh>=1.83000){HH=1.84000; HL=1.83000;} if(lasthigh<=1.83000&&lasthigh>=1.82000){HH=1.83000; HL=1.82000;} if(lasthigh<=1.82000&&lasthigh>=1.81000){HH=1.82000; HL=1.81000;} if(lasthigh<=1.81000&&lasthigh>=1.80000){HH=1.81000; HL=1.80000;} if(lasthigh<=1.80000&&lasthigh>=1.79000){HH=1.80000; HL=1.79000;} if(lasthigh<=1.79000&&lasthigh>=1.78000){HH=1.79000; HL=1.78000;} if(lasthigh<=1.78000&&lasthigh>=1.77000){HH=1.78000; HL=1.77000;} if(lasthigh<=1.77000&&lasthigh>=1.76000){HH=1.77000; HL=1.76000;} if(lasthigh<=1.76000&&lasthigh>=1.75000){HH=1.76000; HL=1.75000;} if(lasthigh<=1.75000&&lasthigh>=1.74000){HH=1.75000; HL=1.74000;} if(lasthigh<=1.74000&&lasthigh>=1.73000){HH=1.74000; HL=1.73000;} if(lasthigh<=1.73000&&lasthigh>=1.72000){HH=1.73000; HL=1.72000;} if(lasthigh<=1.72000&&lasthigh>=1.71000){HH=1.72000; HL=1.71000;} if(lasthigh<=1.71000&&lasthigh>=1.70000){HH=1.71000; HL=1.70000;} if(lasthigh<=1.70000&&lasthigh>=1.69000){HH=1.70000; HL=1.69000;} if(lasthigh<=1.69000&&lasthigh>=1.68000){HH=1.69000; HL=1.68000;} if(lasthigh<=1.68000&&lasthigh>=1.67000){HH=1.68000; HL=1.67000;} if(lasthigh<=1.67000&&lasthigh>=1.66000){HH=1.67000; HL=1.66000;} if(lasthigh<=1.66000&&lasthigh>=1.65000){HH=1.66000; HL=1.65000;} if(lasthigh<=1.65000&&lasthigh>=1.64000){HH=1.65000; HL=1.64000;} if(lasthigh<=1.64000&&lasthigh>=1.63000){HH=1.64000; HL=1.63000;} if(lasthigh<=1.63000&&lasthigh>=1.62000){HH=1.63000; HL=1.62000;} if(lasthigh<=1.62000&&lasthigh>=1.61000){HH=1.62000; HL=1.61000;} if(lasthigh<=1.61000&&lasthigh>=1.60000){HH=1.61000; HL=1.60000;} if(lasthigh<=1.60000&&lasthigh>=1.59000){HH=1.60000; HL=1.59000;} if(lasthigh<=1.59000&&lasthigh>=1.58000){HH=1.59000; HL=1.58000;} if(lasthigh<=1.58000&&lasthigh>=1.57000){HH=1.58000; HL=1.57000;} if(lasthigh<=1.57000&&lasthigh>=1.56000){HH=1.57000; HL=1.56000;} if(lasthigh<=1.56000&&lasthigh>=1.55000){HH=1.56000; HL=1.55000;} if(lasthigh<=1.55000&&lasthigh>=1.54000){HH=1.55000; HL=1.54000;} if(lasthigh<=1.54000&&lasthigh>=1.53000){HH=1.54000; HL=1.53000;} if(lasthigh<=1.53000&&lasthigh>=1.52000){HH=1.53000; HL=1.52000;} if(lasthigh<=1.52000&&lasthigh>=1.51000){HH=1.52000; HL=1.51000;} if(lasthigh<=1.51000&&lasthigh>=1.50000){HH=1.51000; HL=1.50000;} if(lasthigh<=1.50000&&lasthigh>=1.49000){HH=1.50000; HL=1.49000;} if(lasthigh<=1.49000&&lasthigh>=1.48000){HH=1.49000; HL=1.48000;} if(lasthigh<=1.48000&&lasthigh>=1.47000){HH=1.48000; HL=1.47000;} if(lasthigh<=1.47000&&lasthigh>=1.46000){HH=1.47000; HL=1.46000;} if(lasthigh<=1.46000&&lasthigh>=1.45000){HH=1.46000; HL=1.45000;} if(lasthigh<=1.45000&&lasthigh>=1.44000){HH=1.45000; HL=1.44000;} if(lasthigh<=1.44000&&lasthigh>=1.43000){HH=1.44000; HL=1.43000;} if(lasthigh<=1.43000&&lasthigh>=1.42000){HH=1.43000; HL=1.42000;} if(lasthigh<=1.42000&&lasthigh>=1.41000){HH=1.42000; HL=1.41000;} if(lasthigh<=1.41000&&lasthigh>=1.40000){HH=1.41000; HL=1.40000;} if(lasthigh<=1.40000&&lasthigh>=1.39000){HH=1.40000; HL=1.39000;} if(lasthigh<=1.39000&&lasthigh>=1.38000){HH=1.39000; HL=1.38000;} if(lasthigh<=1.38000&&lasthigh>=1.37000){HH=1.38000; HL=1.37000;} if(lasthigh<=1.37000&&lasthigh>=1.36000){HH=1.37000; HL=1.36000;} if(lasthigh<=1.36000&&lasthigh>=1.35000){HH=1.36000; HL=1.35000;} if(lasthigh<=1.35000&&lasthigh>=1.34000){HH=1.35000; HL=1.34000;} if(lasthigh<=1.34000&&lasthigh>=1.33000){HH=1.34000; HL=1.33000;} if(lasthigh<=1.33000&&lasthigh>=1.32000){HH=1.33000; HL=1.32000;} if(lasthigh<=1.32000&&lasthigh>=1.31000){HH=1.32000; HL=1.31000;} if(lasthigh<=1.31000&&lasthigh>=1.30000){HH=1.31000; HL=1.30000;} if(lasthigh<=1.30000&&lasthigh>=1.29000){HH=1.30000; HL=1.29000;} if(lasthigh<=1.29000&&lasthigh>=1.28000){HH=1.29000; HL=1.28000;} if(lasthigh<=1.28000&&lasthigh>=1.27000){HH=1.28000; HL=1.27000;} if(lasthigh<=1.27000&&lasthigh>=1.26000){HH=1.27000; HL=1.26000;} if(lasthigh<=1.26000&&lasthigh>=1.25000){HH=1.26000; HL=1.25000;} if(lasthigh<=1.25000&&lasthigh>=1.24000){HH=1.25000; HL=1.24000;} if(lasthigh<=1.24000&&lasthigh>=1.23000){HH=1.24000; HL=1.23000;} if(lasthigh<=1.23000&&lasthigh>=1.22000){HH=1.23000; HL=1.22000;} if(lasthigh<=1.22000&&lasthigh>=1.21000){HH=1.22000; HL=1.21000;} if(lasthigh<=1.21000&&lasthigh>=1.20000){HH=1.21000; HL=1.20000;} if(lasthigh<=1.20000&&lasthigh>=1.19000){HH=1.20000; HL=1.19000;} if(lasthigh<=1.19000&&lasthigh>=1.18000){HH=1.19000; HL=1.18000;} if(lasthigh<=1.18000&&lasthigh>=1.17000){HH=1.18000; HL=1.17000;} if(lasthigh<=1.17000&&lasthigh>=1.16000){HH=1.17000; HL=1.16000;} if(lasthigh<=1.16000&&lasthigh>=1.15000){HH=1.16000; HL=1.15000;} if(lasthigh<=1.15000&&lasthigh>=1.14000){HH=1.15000; HL=1.14000;} if(lasthigh<=1.14000&&lasthigh>=1.13000){HH=1.14000; HL=1.13000;} if(lasthigh<=1.13000&&lasthigh>=1.12000){HH=1.13000; HL=1.12000;} if(lasthigh<=1.12000&&lasthigh>=1.11000){HH=1.12000; HL=1.11000;} if(lasthigh<=1.11000&&lasthigh>=1.10000){HH=1.11000; HL=1.10000;} ///////////////////////////////////////////////////////////////// if(lasthigh<=1.00000&&lasthigh>=0.99000){HH=1.00000; HL=0.99000;} if(lasthigh<=0.99000&&lasthigh>=0.98000){HH=0.99000; HL=0.98000;} if(lasthigh<=0.98000&&lasthigh>=0.97000){HH=0.98000; HL=0.97000;} if(lasthigh<=0.97000&&lasthigh>=0.96000){HH=0.97000; HL=0.96000;} if(lasthigh<=0.96000&&lasthigh>=0.95000){HH=0.96000; HL=0.95000;} if(lasthigh<=0.95000&&lasthigh>=0.94000){HH=0.95000; HL=0.94000;} if(lasthigh<=0.94000&&lasthigh>=0.93000){HH=0.94000; HL=0.93000;} if(lasthigh<=0.93000&&lasthigh>=0.92000){HH=0.93000; HL=0.92000;} if(lasthigh<=0.92000&&lasthigh>=0.91000){HH=0.92000; HL=0.91000;} if(lasthigh<=0.91000&&lasthigh>=0.90000){HH=0.91000; HL=0.90000;} if(lasthigh<=0.90000&&lasthigh>=0.89000){HH=0.90000; HL=0.89000;} if(lasthigh<=0.89000&&lasthigh>=0.88000){HH=0.89000; HL=0.88000;} if(lasthigh<=0.88000&&lasthigh>=0.87000){HH=0.88000; HL=0.87000;} if(lasthigh<=0.87000&&lasthigh>=0.86000){HH=0.87000; HL=0.86000;} if(lasthigh<=0.86000&&lasthigh>=0.85000){HH=0.86000; HL=0.85000;} if(lasthigh<=0.85000&&lasthigh>=0.84000){HH=0.85000; HL=0.84000;} if(lasthigh<=0.84000&&lasthigh>=0.83000){HH=0.84000; HL=0.83000;} if(lasthigh<=0.83000&&lasthigh>=0.82000){HH=0.83000; HL=0.82000;} if(lasthigh<=0.82000&&lasthigh>=0.81000){HH=0.82000; HL=0.81000;} if(lasthigh<=0.81000&&lasthigh>=0.80000){HH=0.81000; HL=0.80000;} if(lasthigh<=0.80000&&lasthigh>=0.79000){HH=0.80000; HL=0.79000;} if(lasthigh<=0.79000&&lasthigh>=0.78000){HH=0.79000; HL=0.78000;} if(lasthigh<=0.78000&&lasthigh>=0.77000){HH=0.78000; HL=0.77000;} if(lasthigh<=0.77000&&lasthigh>=0.76000){HH=0.77000; HL=0.76000;} if(lasthigh<=0.76000&&lasthigh>=0.75000){HH=0.76000; HL=0.75000;} if(lasthigh<=0.75000&&lasthigh>=0.74000){HH=0.75000; HL=0.74000;} if(lasthigh<=0.74000&&lasthigh>=0.73000){HH=0.74000; HL=0.73000;} if(lasthigh<=0.73000&&lasthigh>=0.72000){HH=0.73000; HL=0.72000;} if(lasthigh<=0.72000&&lasthigh>=0.71000){HH=0.72000; HL=0.71000;} if(lasthigh<=0.71000&&lasthigh>=0.70000){HH=0.71000; HL=0.70000;} if(lasthigh<=0.70000&&lasthigh>=0.69000){HH=0.70000; HL=0.69000;} if(lasthigh<=0.69000&&lasthigh>=0.68000){HH=0.69000; HL=0.68000;} if(lasthigh<=0.68000&&lasthigh>=0.67000){HH=0.68000; HL=0.67000;} if(lasthigh<=0.67000&&lasthigh>=0.66000){HH=0.67000; HL=0.66000;} if(lasthigh<=0.66000&&lasthigh>=0.65000){HH=0.66000; HL=0.65000;} if(lasthigh<=0.65000&&lasthigh>=0.64000){HH=0.65000; HL=0.64000;} if(lasthigh<=0.64000&&lasthigh>=0.63000){HH=0.64000; HL=0.63000;} if(lasthigh<=0.63000&&lasthigh>=0.62000){HH=0.63000; HL=0.62000;} if(lasthigh<=0.62000&&lasthigh>=0.61000){HH=0.62000; HL=0.61000;} if(lasthigh<=0.61000&&lasthigh>=0.60000){HH=0.61000; HL=0.60000;} if(lasthigh<=0.60000&&lasthigh>=0.59000){HH=0.60000; HL=0.59000;} if(lasthigh<=0.59000&&lasthigh>=0.58000){HH=0.59000; HL=0.58000;} if(lasthigh<=0.58000&&lasthigh>=0.57000){HH=0.58000; HL=0.57000;} if(lasthigh<=0.57000&&lasthigh>=0.56000){HH=0.57000; HL=0.56000;} if(lasthigh<=0.56000&&lasthigh>=0.55000){HH=0.56000; HL=0.55000;} if(lasthigh<=0.55000&&lasthigh>=0.54000){HH=0.55000; HL=0.54000;} if(lasthigh<=0.54000&&lasthigh>=0.53000){HH=0.54000; HL=0.53000;} if(lasthigh<=0.53000&&lasthigh>=0.52000){HH=0.53000; HL=0.52000;} if(lasthigh<=0.52000&&lasthigh>=0.51000){HH=0.52000; HL=0.51000;} if(lasthigh<=0.51000&&lasthigh>=0.50000){HH=0.51000; HL=0.50000;} if(lasthigh<=0.50000&&lasthigh>=0.49000){HH=0.50000; HL=0.49000;} if(lasthigh<=0.49000&&lasthigh>=0.48000){HH=0.49000; HL=0.48000;} if(lasthigh<=0.48000&&lasthigh>=0.47000){HH=0.48000; HL=0.47000;} if(lasthigh<=0.47000&&lasthigh>=0.46000){HH=0.47000; HL=0.46000;} if(lasthigh<=0.46000&&lasthigh>=0.45000){HH=0.46000; HL=0.45000;} if(lasthigh<=0.45000&&lasthigh>=0.44000){HH=0.45000; HL=0.44000;} if(lasthigh<=0.44000&&lasthigh>=0.43000){HH=0.44000; HL=0.43000;} if(lasthigh<=0.43000&&lasthigh>=0.42000){HH=0.43000; HL=0.42000;} if(lasthigh<=0.42000&&lasthigh>=0.41000){HH=0.42000; HL=0.41000;} if(lasthigh<=0.41000&&lasthigh>=0.40000){HH=0.41000; HL=0.40000;} if(lasthigh<=0.40000&&lasthigh>=0.39000){HH=0.40000; HL=0.39000;} if(lasthigh<=0.39000&&lasthigh>=0.38000){HH=0.39000; HL=0.38000;} if(lasthigh<=0.38000&&lasthigh>=0.37000){HH=0.38000; HL=0.37000;} if(lasthigh<=0.37000&&lasthigh>=0.36000){HH=0.37000; HL=0.36000;} if(lasthigh<=0.36000&&lasthigh>=0.35000){HH=0.36000; HL=0.35000;} if(lasthigh<=0.35000&&lasthigh>=0.34000){HH=0.35000; HL=0.34000;} if(lasthigh<=0.34000&&lasthigh>=0.33000){HH=0.34000; HL=0.33000;} if(lasthigh<=0.33000&&lasthigh>=0.32000){HH=0.33000; HL=0.32000;} if(lasthigh<=0.32000&&lasthigh>=0.31000){HH=0.32000; HL=0.31000;} if(lasthigh<=0.31000&&lasthigh>=0.30000){HH=0.31000; HL=0.30000;} if(lasthigh<=0.30000&&lasthigh>=0.29000){HH=0.30000; HL=0.29000;} if(lasthigh<=0.29000&&lasthigh>=0.28000){HH=0.29000; HL=0.28000;} if(lasthigh<=0.28000&&lasthigh>=0.27000){HH=0.28000; HL=0.27000;} if(lasthigh<=0.27000&&lasthigh>=0.26000){HH=0.27000; HL=0.26000;} if(lasthigh<=0.26000&&lasthigh>=0.25000){HH=0.26000; HL=0.25000;} if(lasthigh<=0.25000&&lasthigh>=0.24000){HH=0.25000; HL=0.24000;} if(lasthigh<=0.24000&&lasthigh>=0.23000){HH=0.24000; HL=0.23000;} if(lasthigh<=0.23000&&lasthigh>=0.22000){HH=0.23000; HL=0.22000;} if(lasthigh<=0.22000&&lasthigh>=0.21000){HH=0.22000; HL=0.21000;} if(lasthigh<=0.21000&&lasthigh>=0.20000){HH=0.21000; HL=0.20000;} if(lasthigh<=0.20000&&lasthigh>=0.19000){HH=0.20000; HL=0.19000;} if(lasthigh<=0.19000&&lasthigh>=0.18000){HH=0.19000; HL=0.18000;} if(lasthigh<=0.18000&&lasthigh>=0.17000){HH=0.18000; HL=0.17000;} if(lasthigh<=0.17000&&lasthigh>=0.16000){HH=0.17000; HL=0.16000;} if(lasthigh<=0.16000&&lasthigh>=0.15000){HH=0.16000; HL=0.15000;} if(lasthigh<=0.15000&&lasthigh>=0.14000){HH=0.15000; HL=0.14000;} if(lasthigh<=0.14000&&lasthigh>=0.13000){HH=0.14000; HL=0.13000;} if(lasthigh<=0.13000&&lasthigh>=0.12000){HH=0.13000; HL=0.12000;} if(lasthigh<=0.12000&&lasthigh>=0.11000){HH=0.12000; HL=0.11000;} if(lasthigh<=0.11000&&lasthigh>=0.10000){HH=0.11000; HL=0.10000;} ///////////////////////////////////////////////////////////////////// SET_RectangleRES("OBJRESAREA", Time[lasthighpos], HH,Time[0] + Period()*60*0, HL, Green); double LH,LL; if(lastlow<=3.00000&&lastlow>=2.99000){LH=3.00000; LL=2.99000;} if(lastlow<=2.99000&&lastlow>=2.98000){LH=2.99000; LL=2.98000;} if(lastlow<=2.98000&&lastlow>=2.97000){LH=2.98000; LL=2.97000;} if(lastlow<=2.97000&&lastlow>=2.96000){LH=2.97000; LL=2.96000;} if(lastlow<=2.96000&&lastlow>=2.95000){LH=2.96000; LL=2.95000;} if(lastlow<=2.95000&&lastlow>=2.94000){LH=2.95000; LL=2.94000;} if(lastlow<=2.94000&&lastlow>=2.93000){LH=2.94000; LL=2.93000;} if(lastlow<=2.93000&&lastlow>=2.92000){LH=2.93000; LL=2.92000;} if(lastlow<=2.92000&&lastlow>=2.91000){LH=2.92000; LL=2.91000;} if(lastlow<=2.91000&&lastlow>=2.90000){LH=2.91000; LL=2.90000;} if(lastlow<=2.90000&&lastlow>=2.89000){LH=2.90000; LL=2.89000;} if(lastlow<=2.89000&&lastlow>=2.88000){LH=2.89000; LL=2.88000;} if(lastlow<=2.88000&&lastlow>=2.87000){LH=2.88000; LL=2.87000;} if(lastlow<=2.87000&&lastlow>=2.86000){LH=2.87000; LL=2.86000;} if(lastlow<=2.86000&&lastlow>=2.85000){LH=2.86000; LL=2.85000;} if(lastlow<=2.85000&&lastlow>=2.84000){LH=2.85000; LL=2.84000;} if(lastlow<=2.84000&&lastlow>=2.83000){LH=2.84000; LL=2.83000;} if(lastlow<=2.83000&&lastlow>=2.82000){LH=2.83000; LL=2.82000;} if(lastlow<=2.82000&&lastlow>=2.81000){LH=2.82000; LL=2.81000;} if(lastlow<=2.81000&&lastlow>=2.80000){LH=2.81000; LL=2.80000;} if(lastlow<=2.80000&&lastlow>=2.79000){LH=2.80000; LL=2.79000;} if(lastlow<=2.79000&&lastlow>=2.78000){LH=2.79000; LL=2.78000;} if(lastlow<=2.78000&&lastlow>=2.77000){LH=2.78000; LL=2.77000;} if(lastlow<=2.77000&&lastlow>=2.76000){LH=2.77000; LL=2.76000;} if(lastlow<=2.76000&&lastlow>=2.75000){LH=2.76000; LL=2.75000;} if(lastlow<=2.75000&&lastlow>=2.74000){LH=2.75000; LL=2.74000;} if(lastlow<=2.74000&&lastlow>=2.73000){LH=2.74000; LL=2.73000;} if(lastlow<=2.73000&&lastlow>=2.72000){LH=2.73000; LL=2.72000;} if(lastlow<=2.72000&&lastlow>=2.71000){LH=2.72000; LL=2.71000;} if(lastlow<=2.71000&&lastlow>=2.70000){LH=2.71000; LL=2.70000;} if(lastlow<=2.70000&&lastlow>=2.69000){LH=2.70000; LL=2.69000;} if(lastlow<=2.69000&&lastlow>=2.68000){LH=2.69000; LL=2.68000;} if(lastlow<=2.68000&&lastlow>=2.67000){LH=2.68000; LL=2.67000;} if(lastlow<=2.67000&&lastlow>=2.66000){LH=2.67000; LL=2.66000;} if(lastlow<=2.66000&&lastlow>=2.65000){LH=2.66000; LL=2.65000;} if(lastlow<=2.65000&&lastlow>=2.64000){LH=2.65000; LL=2.64000;} if(lastlow<=2.64000&&lastlow>=2.63000){LH=2.64000; LL=2.63000;} if(lastlow<=2.63000&&lastlow>=2.62000){LH=2.63000; LL=2.62000;} if(lastlow<=2.62000&&lastlow>=2.61000){LH=2.62000; LL=2.61000;} if(lastlow<=2.61000&&lastlow>=2.60000){LH=2.61000; LL=2.60000;} if(lastlow<=2.60000&&lastlow>=2.59000){LH=2.60000; LL=2.59000;} if(lastlow<=2.59000&&lastlow>=2.58000){LH=2.59000; LL=2.58000;} if(lastlow<=2.58000&&lastlow>=2.57000){LH=2.58000; LL=2.57000;} if(lastlow<=2.57000&&lastlow>=2.56000){LH=2.57000; LL=2.56000;} if(lastlow<=2.56000&&lastlow>=2.55000){LH=2.56000; LL=2.55000;} if(lastlow<=2.55000&&lastlow>=2.54000){LH=2.55000; LL=2.54000;} if(lastlow<=2.54000&&lastlow>=2.53000){LH=2.54000; LL=2.53000;} if(lastlow<=2.53000&&lastlow>=2.52000){LH=2.53000; LL=2.52000;} if(lastlow<=2.52000&&lastlow>=2.51000){LH=2.52000; LL=2.51000;} if(lastlow<=2.51000&&lastlow>=2.50000){LH=2.51000; LL=2.50000;} if(lastlow<=2.50000&&lastlow>=2.49000){LH=2.50000; LL=2.49000;} if(lastlow<=2.49000&&lastlow>=2.48000){LH=2.49000; LL=2.48000;} if(lastlow<=2.48000&&lastlow>=2.47000){LH=2.48000; LL=2.47000;} if(lastlow<=2.47000&&lastlow>=2.46000){LH=2.47000; LL=2.46000;} if(lastlow<=2.46000&&lastlow>=2.45000){LH=2.46000; LL=2.45000;} if(lastlow<=2.45000&&lastlow>=2.44000){LH=2.45000; LL=2.44000;} if(lastlow<=2.44000&&lastlow>=2.43000){LH=2.44000; LL=2.43000;} if(lastlow<=2.43000&&lastlow>=2.42000){LH=2.43000; LL=2.42000;} if(lastlow<=2.42000&&lastlow>=2.41000){LH=2.42000; LL=2.41000;} if(lastlow<=2.41000&&lastlow>=2.40000){LH=2.41000; LL=2.40000;} if(lastlow<=2.40000&&lastlow>=2.39000){LH=2.40000; LL=2.39000;} if(lastlow<=2.39000&&lastlow>=2.38000){LH=2.39000; LL=2.38000;} if(lastlow<=2.38000&&lastlow>=2.37000){LH=2.38000; LL=2.37000;} if(lastlow<=2.37000&&lastlow>=2.36000){LH=2.37000; LL=2.36000;} if(lastlow<=2.36000&&lastlow>=2.35000){LH=2.36000; LL=2.35000;} if(lastlow<=2.35000&&lastlow>=2.34000){LH=2.35000; LL=2.34000;} if(lastlow<=2.34000&&lastlow>=2.33000){LH=2.34000; LL=2.33000;} if(lastlow<=2.33000&&lastlow>=2.32000){LH=2.33000; LL=2.32000;} if(lastlow<=2.32000&&lastlow>=2.31000){LH=2.32000; LL=2.31000;} if(lastlow<=2.31000&&lastlow>=2.30000){LH=2.31000; LL=2.30000;} if(lastlow<=2.30000&&lastlow>=2.29000){LH=2.30000; LL=2.29000;} if(lastlow<=2.29000&&lastlow>=2.28000){LH=2.29000; LL=2.28000;} if(lastlow<=2.28000&&lastlow>=2.27000){LH=2.28000; LL=2.27000;} if(lastlow<=2.27000&&lastlow>=2.26000){LH=2.27000; LL=2.26000;} if(lastlow<=2.26000&&lastlow>=2.25000){LH=2.26000; LL=2.25000;} if(lastlow<=2.25000&&lastlow>=2.24000){LH=2.25000; LL=2.24000;} if(lastlow<=2.24000&&lastlow>=2.23000){LH=2.24000; LL=2.23000;} if(lastlow<=2.23000&&lastlow>=2.22000){LH=2.23000; LL=2.22000;} if(lastlow<=2.22000&&lastlow>=2.21000){LH=2.22000; LL=2.21000;} if(lastlow<=2.21000&&lastlow>=2.20000){LH=2.21000; LL=2.20000;} if(lastlow<=2.20000&&lastlow>=2.19000){LH=2.20000; LL=2.19000;} if(lastlow<=2.19000&&lastlow>=2.18000){LH=2.19000; LL=2.18000;} if(lastlow<=2.18000&&lastlow>=2.17000){LH=2.18000; LL=2.17000;} if(lastlow<=2.17000&&lastlow>=2.16000){LH=2.17000; LL=2.16000;} if(lastlow<=2.16000&&lastlow>=2.15000){LH=2.16000; LL=2.15000;} if(lastlow<=2.15000&&lastlow>=2.14000){LH=2.15000; LL=2.14000;} if(lastlow<=2.14000&&lastlow>=2.13000){LH=2.14000; LL=2.13000;} if(lastlow<=2.13000&&lastlow>=2.12000){LH=2.13000; LL=2.12000;} if(lastlow<=2.12000&&lastlow>=2.11000){LH=2.12000; LL=2.11000;} if(lastlow<=2.11000&&lastlow>=2.10000){LH=2.11000; LL=2.10000;} ///////////////////////////////////////////////////////////////// if(lastlow<=2.00000&&lastlow>=1.99000){LH=2.00000; LL=1.99000;} if(lastlow<=1.99000&&lastlow>=1.98000){LH=1.99000; LL=1.98000;} if(lastlow<=1.98000&&lastlow>=1.97000){LH=1.98000; LL=1.97000;} if(lastlow<=1.97000&&lastlow>=1.96000){LH=1.97000; LL=1.96000;} if(lastlow<=1.96000&&lastlow>=1.95000){LH=1.96000; LL=1.95000;} if(lastlow<=1.95000&&lastlow>=1.94000){LH=1.95000; LL=1.94000;} if(lastlow<=1.94000&&lastlow>=1.93000){LH=1.94000; LL=1.93000;} if(lastlow<=1.93000&&lastlow>=1.92000){LH=1.93000; LL=1.92000;} if(lastlow<=1.92000&&lastlow>=1.91000){LH=1.92000; LL=1.91000;} if(lastlow<=1.91000&&lastlow>=1.90000){LH=1.91000; LL=1.90000;} if(lastlow<=1.90000&&lastlow>=1.89000){LH=1.90000; LL=1.89000;} if(lastlow<=1.89000&&lastlow>=1.88000){LH=1.89000; LL=1.88000;} if(lastlow<=1.88000&&lastlow>=1.87000){LH=1.88000; LL=1.87000;} if(lastlow<=1.87000&&lastlow>=1.86000){LH=1.87000; LL=1.86000;} if(lastlow<=1.86000&&lastlow>=1.85000){LH=1.86000; LL=1.85000;} if(lastlow<=1.85000&&lastlow>=1.84000){LH=1.85000; LL=1.84000;} if(lastlow<=1.84000&&lastlow>=1.83000){LH=1.84000; LL=1.83000;} if(lastlow<=1.83000&&lastlow>=1.82000){LH=1.83000; LL=1.82000;} if(lastlow<=1.82000&&lastlow>=1.81000){LH=1.82000; LL=1.81000;} if(lastlow<=1.81000&&lastlow>=1.80000){LH=1.81000; LL=1.80000;} if(lastlow<=1.80000&&lastlow>=1.79000){LH=1.80000; LL=1.79000;} if(lastlow<=1.79000&&lastlow>=1.78000){LH=1.79000; LL=1.78000;} if(lastlow<=1.78000&&lastlow>=1.77000){LH=1.78000; LL=1.77000;} if(lastlow<=1.77000&&lastlow>=1.76000){LH=1.77000; LL=1.76000;} if(lastlow<=1.76000&&lastlow>=1.75000){LH=1.76000; LL=1.75000;} if(lastlow<=1.75000&&lastlow>=1.74000){LH=1.75000; LL=1.74000;} if(lastlow<=1.74000&&lastlow>=1.73000){LH=1.74000; LL=1.73000;} if(lastlow<=1.73000&&lastlow>=1.72000){LH=1.73000; LL=1.72000;} if(lastlow<=1.72000&&lastlow>=1.71000){LH=1.72000; LL=1.71000;} if(lastlow<=1.71000&&lastlow>=1.70000){LH=1.71000; LL=1.70000;} if(lastlow<=1.70000&&lastlow>=1.69000){LH=1.70000; LL=1.69000;} if(lastlow<=1.69000&&lastlow>=1.68000){LH=1.69000; LL=1.68000;} if(lastlow<=1.68000&&lastlow>=1.67000){LH=1.68000; LL=1.67000;} if(lastlow<=1.67000&&lastlow>=1.66000){LH=1.67000; LL=1.66000;} if(lastlow<=1.66000&&lastlow>=1.65000){LH=1.66000; LL=1.65000;} if(lastlow<=1.65000&&lastlow>=1.64000){LH=1.65000; LL=1.64000;} if(lastlow<=1.64000&&lastlow>=1.63000){LH=1.64000; LL=1.63000;} if(lastlow<=1.63000&&lastlow>=1.62000){LH=1.63000; LL=1.62000;} if(lastlow<=1.62000&&lastlow>=1.61000){LH=1.62000; LL=1.61000;} if(lastlow<=1.61000&&lastlow>=1.60000){LH=1.61000; LL=1.60000;} if(lastlow<=1.60000&&lastlow>=1.59000){LH=1.60000; LL=1.59000;} if(lastlow<=1.59000&&lastlow>=1.58000){LH=1.59000; LL=1.58000;} if(lastlow<=1.58000&&lastlow>=1.57000){LH=1.58000; LL=1.57000;} if(lastlow<=1.57000&&lastlow>=1.56000){LH=1.57000; LL=1.56000;} if(lastlow<=1.56000&&lastlow>=1.55000){LH=1.56000; LL=1.55000;} if(lastlow<=1.55000&&lastlow>=1.54000){LH=1.55000; LL=1.54000;} if(lastlow<=1.54000&&lastlow>=1.53000){LH=1.54000; LL=1.53000;} if(lastlow<=1.53000&&lastlow>=1.52000){LH=1.53000; LL=1.52000;} if(lastlow<=1.52000&&lastlow>=1.51000){LH=1.52000; LL=1.51000;} if(lastlow<=1.51000&&lastlow>=1.50000){LH=1.51000; LL=1.50000;} if(lastlow<=1.50000&&lastlow>=1.49000){LH=1.50000; LL=1.49000;} if(lastlow<=1.49000&&lastlow>=1.48000){LH=1.49000; LL=1.48000;} if(lastlow<=1.48000&&lastlow>=1.47000){LH=1.48000; LL=1.47000;} if(lastlow<=1.47000&&lastlow>=1.46000){LH=1.47000; LL=1.46000;} if(lastlow<=1.46000&&lastlow>=1.45000){LH=1.46000; LL=1.45000;} if(lastlow<=1.45000&&lastlow>=1.44000){LH=1.45000; LL=1.44000;} if(lastlow<=1.44000&&lastlow>=1.43000){LH=1.44000; LL=1.43000;} if(lastlow<=1.43000&&lastlow>=1.42000){LH=1.43000; LL=1.42000;} if(lastlow<=1.42000&&lastlow>=1.41000){LH=1.42000; LL=1.41000;} if(lastlow<=1.41000&&lastlow>=1.40000){LH=1.41000; LL=1.40000;} if(lastlow<=1.40000&&lastlow>=1.39000){LH=1.40000; LL=1.39000;} if(lastlow<=1.39000&&lastlow>=1.38000){LH=1.39000; LL=1.38000;} if(lastlow<=1.38000&&lastlow>=1.37000){LH=1.38000; LL=1.37000;} if(lastlow<=1.37000&&lastlow>=1.36000){LH=1.37000; LL=1.36000;} if(lastlow<=1.36000&&lastlow>=1.35000){LH=1.36000; LL=1.35000;} if(lastlow<=1.35000&&lastlow>=1.34000){LH=1.35000; LL=1.34000;} if(lastlow<=1.34000&&lastlow>=1.33000){LH=1.34000; LL=1.33000;} if(lastlow<=1.33000&&lastlow>=1.32000){LH=1.33000; LL=1.32000;} if(lastlow<=1.32000&&lastlow>=1.31000){LH=1.32000; LL=1.31000;} if(lastlow<=1.31000&&lastlow>=1.30000){LH=1.31000; LL=1.30000;} if(lastlow<=1.30000&&lastlow>=1.29000){LH=1.30000; LL=1.29000;} if(lastlow<=1.29000&&lastlow>=1.28000){LH=1.29000; LL=1.28000;} if(lastlow<=1.28000&&lastlow>=1.27000){LH=1.28000; LL=1.27000;} if(lastlow<=1.27000&&lastlow>=1.26000){LH=1.27000; LL=1.26000;} if(lastlow<=1.26000&&lastlow>=1.25000){LH=1.26000; LL=1.25000;} if(lastlow<=1.25000&&lastlow>=1.24000){LH=1.25000; LL=1.24000;} if(lastlow<=1.24000&&lastlow>=1.23000){LH=1.24000; LL=1.23000;} if(lastlow<=1.23000&&lastlow>=1.22000){LH=1.23000; LL=1.22000;} if(lastlow<=1.22000&&lastlow>=1.21000){LH=1.22000; LL=1.21000;} if(lastlow<=1.21000&&lastlow>=1.20000){LH=1.21000; LL=1.20000;} if(lastlow<=1.20000&&lastlow>=1.19000){LH=1.20000; LL=1.19000;} if(lastlow<=1.19000&&lastlow>=1.18000){LH=1.19000; LL=1.18000;} if(lastlow<=1.18000&&lastlow>=1.17000){LH=1.18000; LL=1.17000;} if(lastlow<=1.17000&&lastlow>=1.16000){LH=1.17000; LL=1.16000;} if(lastlow<=1.16000&&lastlow>=1.15000){LH=1.16000; LL=1.15000;} if(lastlow<=1.15000&&lastlow>=1.14000){LH=1.15000; LL=1.14000;} if(lastlow<=1.14000&&lastlow>=1.13000){LH=1.14000; LL=1.13000;} if(lastlow<=1.13000&&lastlow>=1.12000){LH=1.13000; LL=1.12000;} if(lastlow<=1.12000&&lastlow>=1.11000){LH=1.12000; LL=1.11000;} if(lastlow<=1.11000&&lastlow>=1.10000){LH=1.11000; LL=1.10000;} ///////////////////////////////////////////////////////////////// if(lastlow<=1.00000&&lastlow>=0.99000){LH=1.00000; LL=0.99000;} if(lastlow<=0.99000&&lastlow>=0.98000){LH=0.99000; LL=0.98000;} if(lastlow<=0.98000&&lastlow>=0.97000){LH=0.98000; LL=0.97000;} if(lastlow<=0.97000&&lastlow>=0.96000){LH=0.97000; LL=0.96000;} if(lastlow<=0.96000&&lastlow>=0.95000){LH=0.96000; LL=0.95000;} if(lastlow<=0.95000&&lastlow>=0.94000){LH=0.95000; LL=0.94000;} if(lastlow<=0.94000&&lastlow>=0.93000){LH=0.94000; LL=0.93000;} if(lastlow<=0.93000&&lastlow>=0.92000){LH=0.93000; LL=0.92000;} if(lastlow<=0.92000&&lastlow>=0.91000){LH=0.92000; LL=0.91000;} if(lastlow<=0.91000&&lastlow>=0.90000){LH=0.91000; LL=0.90000;} if(lastlow<=0.90000&&lastlow>=0.89000){LH=0.90000; LL=0.89000;} if(lastlow<=0.89000&&lastlow>=0.88000){LH=0.89000; LL=0.88000;} if(lastlow<=0.88000&&lastlow>=0.87000){LH=0.88000; LL=0.87000;} if(lastlow<=0.87000&&lastlow>=0.86000){LH=0.87000; LL=0.86000;} if(lastlow<=0.86000&&lastlow>=0.85000){LH=0.86000; LL=0.85000;} if(lastlow<=0.85000&&lastlow>=0.84000){LH=0.85000; LL=0.84000;} if(lastlow<=0.84000&&lastlow>=0.83000){LH=0.84000; LL=0.83000;} if(lastlow<=0.83000&&lastlow>=0.82000){LH=0.83000; LL=0.82000;} if(lastlow<=0.82000&&lastlow>=0.81000){LH=0.82000; LL=0.81000;} if(lastlow<=0.81000&&lastlow>=0.80000){LH=0.81000; LL=0.80000;} if(lastlow<=0.80000&&lastlow>=0.79000){LH=0.80000; LL=0.79000;} if(lastlow<=0.79000&&lastlow>=0.78000){LH=0.79000; LL=0.78000;} if(lastlow<=0.78000&&lastlow>=0.77000){LH=0.78000; LL=0.77000;} if(lastlow<=0.77000&&lastlow>=0.76000){LH=0.77000; LL=0.76000;} if(lastlow<=0.76000&&lastlow>=0.75000){LH=0.76000; LL=0.75000;} if(lastlow<=0.75000&&lastlow>=0.74000){LH=0.75000; LL=0.74000;} if(lastlow<=0.74000&&lastlow>=0.73000){LH=0.74000; LL=0.73000;} if(lastlow<=0.73000&&lastlow>=0.72000){LH=0.73000; LL=0.72000;} if(lastlow<=0.72000&&lastlow>=0.71000){LH=0.72000; LL=0.71000;} if(lastlow<=0.71000&&lastlow>=0.70000){LH=0.71000; LL=0.70000;} if(lastlow<=0.70000&&lastlow>=0.69000){LH=0.70000; LL=0.69000;} if(lastlow<=0.69000&&lastlow>=0.68000){LH=0.69000; LL=0.68000;} if(lastlow<=0.68000&&lastlow>=0.67000){LH=0.68000; LL=0.67000;} if(lastlow<=0.67000&&lastlow>=0.66000){LH=0.67000; LL=0.66000;} if(lastlow<=0.66000&&lastlow>=0.65000){LH=0.66000; LL=0.65000;} if(lastlow<=0.65000&&lastlow>=0.64000){LH=0.65000; LL=0.64000;} if(lastlow<=0.64000&&lastlow>=0.63000){LH=0.64000; LL=0.63000;} if(lastlow<=0.63000&&lastlow>=0.62000){LH=0.63000; LL=0.62000;} if(lastlow<=0.62000&&lastlow>=0.61000){LH=0.62000; LL=0.61000;} if(lastlow<=0.61000&&lastlow>=0.60000){LH=0.61000; LL=0.60000;} if(lastlow<=0.60000&&lastlow>=0.59000){LH=0.60000; LL=0.59000;} if(lastlow<=0.59000&&lastlow>=0.58000){LH=0.59000; LL=0.58000;} if(lastlow<=0.58000&&lastlow>=0.57000){LH=0.58000; LL=0.57000;} if(lastlow<=0.57000&&lastlow>=0.56000){LH=0.57000; LL=0.56000;} if(lastlow<=0.56000&&lastlow>=0.55000){LH=0.56000; LL=0.55000;} if(lastlow<=0.55000&&lastlow>=0.54000){LH=0.55000; LL=0.54000;} if(lastlow<=0.54000&&lastlow>=0.53000){LH=0.54000; LL=0.53000;} if(lastlow<=0.53000&&lastlow>=0.52000){LH=0.53000; LL=0.52000;} if(lastlow<=0.52000&&lastlow>=0.51000){LH=0.52000; LL=0.51000;} if(lastlow<=0.51000&&lastlow>=0.50000){LH=0.51000; LL=0.50000;} if(lastlow<=0.50000&&lastlow>=0.49000){LH=0.50000; LL=0.49000;} if(lastlow<=0.49000&&lastlow>=0.48000){LH=0.49000; LL=0.48000;} if(lastlow<=0.48000&&lastlow>=0.47000){LH=0.48000; LL=0.47000;} if(lastlow<=0.47000&&lastlow>=0.46000){LH=0.47000; LL=0.46000;} if(lastlow<=0.46000&&lastlow>=0.45000){LH=0.46000; LL=0.45000;} if(lastlow<=0.45000&&lastlow>=0.44000){LH=0.45000; LL=0.44000;} if(lastlow<=0.44000&&lastlow>=0.43000){LH=0.44000; LL=0.43000;} if(lastlow<=0.43000&&lastlow>=0.42000){LH=0.43000; LL=0.42000;} if(lastlow<=0.42000&&lastlow>=0.41000){LH=0.42000; LL=0.41000;} if(lastlow<=0.41000&&lastlow>=0.40000){LH=0.41000; LL=0.40000;} if(lastlow<=0.40000&&lastlow>=0.39000){LH=0.40000; LL=0.39000;} if(lastlow<=0.39000&&lastlow>=0.38000){LH=0.39000; LL=0.38000;} if(lastlow<=0.38000&&lastlow>=0.37000){LH=0.38000; LL=0.37000;} if(lastlow<=0.37000&&lastlow>=0.36000){LH=0.37000; LL=0.36000;} if(lastlow<=0.36000&&lastlow>=0.35000){LH=0.36000; LL=0.35000;} if(lastlow<=0.35000&&lastlow>=0.34000){LH=0.35000; LL=0.34000;} if(lastlow<=0.34000&&lastlow>=0.33000){LH=0.34000; LL=0.33000;} if(lastlow<=0.33000&&lastlow>=0.32000){LH=0.33000; LL=0.32000;} if(lastlow<=0.32000&&lastlow>=0.31000){LH=0.32000; LL=0.31000;} if(lastlow<=0.31000&&lastlow>=0.30000){LH=0.31000; LL=0.30000;} if(lastlow<=0.30000&&lastlow>=0.29000){LH=0.30000; LL=0.29000;} if(lastlow<=0.29000&&lastlow>=0.28000){LH=0.29000; LL=0.28000;} if(lastlow<=0.28000&&lastlow>=0.27000){LH=0.28000; LL=0.27000;} if(lastlow<=0.27000&&lastlow>=0.26000){LH=0.27000; LL=0.26000;} if(lastlow<=0.26000&&lastlow>=0.25000){LH=0.26000; LL=0.25000;} if(lastlow<=0.25000&&lastlow>=0.24000){LH=0.25000; LL=0.24000;} if(lastlow<=0.24000&&lastlow>=0.23000){LH=0.24000; LL=0.23000;} if(lastlow<=0.23000&&lastlow>=0.22000){LH=0.23000; LL=0.22000;} if(lastlow<=0.22000&&lastlow>=0.21000){LH=0.22000; LL=0.21000;} if(lastlow<=0.21000&&lastlow>=0.20000){LH=0.21000; LL=0.20000;} if(lastlow<=0.20000&&lastlow>=0.19000){LH=0.20000; LL=0.19000;} if(lastlow<=0.19000&&lastlow>=0.18000){LH=0.19000; LL=0.18000;} if(lastlow<=0.18000&&lastlow>=0.17000){LH=0.18000; LL=0.17000;} if(lastlow<=0.17000&&lastlow>=0.16000){LH=0.17000; LL=0.16000;} if(lastlow<=0.16000&&lastlow>=0.15000){LH=0.16000; LL=0.15000;} if(lastlow<=0.15000&&lastlow>=0.14000){LH=0.15000; LL=0.14000;} if(lastlow<=0.14000&&lastlow>=0.13000){LH=0.14000; LL=0.13000;} if(lastlow<=0.13000&&lastlow>=0.12000){LH=0.13000; LL=0.12000;} if(lastlow<=0.12000&&lastlow>=0.11000){LH=0.12000; LL=0.11000;} if(lastlow<=0.11000&&lastlow>=0.10000){LH=0.11000; LL=0.10000;} ///////////////////////////////////////////////////////////////////// SET_RectangleSUP("OBJSUPAREA", Time[lastlowpos], LL,Time[0] + Period()*60*0, LH, Maroon); return(0); } //================================================================================================= void SetLowZZ(int pShift, double pValue) { ZigzagBuffer[pShift]=pValue; BufChanelLow[pShift]=pValue; } //================================================================================================= void SetHighZZ(int pShift, double pValue) { ZigzagBuffer[pShift]=pValue; BufChanelHigh[pShift]=pValue; } //+------------------------------------------------------------------+ //| SET_Rectangle | //+------------------------------------------------------------------+ void SET_RectangleRES(string name, datetime Tm1, double Prc1, datetime Tm2, double Prc2, color clr){ if(ObjectFind(LabelName+name) == -1){ ObjectCreate(LabelName+name, OBJ_RECTANGLE,0, Tm1, Prc1, Tm2, Prc2); ObjectSet(LabelName+name, OBJPROP_COLOR, clr); ObjectSet(LabelName+name, OBJPROP_BACK, true); } ObjectSet(LabelName+name, OBJPROP_TIME2, Tm2); ObjectSet(LabelName+name, OBJPROP_PRICE2, Prc2); } //+------------------------------------------------------------------+ //| SET_Rectangle | //+------------------------------------------------------------------+ void SET_RectangleSUP(string name, datetime Tm1, double Prc1, datetime Tm2, double Prc2, color clr){ if(ObjectFind(LabelName+name) == -1){ ObjectCreate(LabelName+name, OBJ_RECTANGLE,0, Tm1, Prc1, Tm2, Prc2); ObjectSet(LabelName+name, OBJPROP_COLOR, clr); ObjectSet(LabelName+name, OBJPROP_BACK, true); } ObjectSet(LabelName+name, OBJPROP_TIME2, Tm2); ObjectSet(LabelName+name, OBJPROP_PRICE2, Prc2); }