Weiß jemand wie man die nachgezogenen Linien weg bekommt, die sich auf dem Index 2 und nach Wochenschluss darstellen?
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Blue
#property indicator_color4 Gray
double a_wo[];
double a_wl[];
double a_wh[];
double a_calc[];
int init()
{
SetIndexBuffer(0,a_wo);
SetIndexBuffer(1,a_wl);
SetIndexBuffer(2,a_wh);
SetIndexBuffer(3,a_calc);
SetIndexStyle(0,DRAW_LINE,0,2);
SetIndexStyle(1,DRAW_LINE,0,2);
SetIndexStyle(2,DRAW_LINE,0,2);
SetIndexStyle(3,DRAW_LINE,0,2);
SetIndexLabel(0,"");
SetIndexLabel(1,"");
SetIndexLabel(2,"");
SetIndexLabel(3,"");
return(0);
}
int deinit()
{
ObjectDelete("");
ObjectDelete("");
ObjectDelete("");
return(0);
}
int start()
{
int i,counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
if(Period()>PERIOD_H4) return(-1);
double last_week_low,last_week_high;
for(i=limit-1; i>=0; i--)
{
// 1sts Days of Week
if(TimeDayOfWeek(Time[i])<=2 && TimeDayOfWeek(Time[i+1])>=4)
{
//we are at the first bar of the week, means nearest bar in W1 is this weeks bar
int shift= iBarShift(Symbol(),PERIOD_W1,Time[i],false);
double wo = iOpen(Symbol(), PERIOD_W1, shift+1);
double wh = iHigh(Symbol(), PERIOD_W1, shift+1);
double wl = iLow(Symbol(), PERIOD_W1, shift+1);
double calc = iOpen(Symbol(), PERIOD_W1, shift+1)-(iOpen(Symbol(), PERIOD_W1, shift+1)-iLow(Symbol(), PERIOD_W1, shift+1));
}
a_wo[i]=wo;
a_wl[i]=wl;
a_wh[i]=wh;
a_calc[i]=(wh+wl)/2;
Comment(calc);
}
//----
return(0);
}
Weiß jemand wie man die nachgezogenen Linien weg bekommt, die sich auf dem Index 2 und nach Wochenschluss darstellen?
#property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 Red #property indicator_color2 Green #property indicator_color3 Blue #property indicator_color4 Gray double a_wo[]; double a_wl[]; double a_wh[]; double a_calc[]; int init() { SetIndexBuffer(0,a_wo); SetIndexBuffer(1,a_wl); SetIndexBuffer(2,a_wh); SetIndexBuffer(3,a_calc); SetIndexStyle(0,DRAW_LINE,0,2); SetIndexStyle(1,DRAW_LINE,0,2); SetIndexStyle(2,DRAW_LINE,0,2); SetIndexStyle(3,DRAW_LINE,0,2); SetIndexLabel(0,""); SetIndexLabel(1,""); SetIndexLabel(2,""); SetIndexLabel(3,""); return(0); } int deinit() { ObjectDelete(""); ObjectDelete(""); ObjectDelete(""); return(0); } int start() { int i,counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; if(Period()>PERIOD_H4) return(-1); double last_week_low,last_week_high; for(i=limit-1; i>=0; i--) { // 1sts Days of Week if(TimeDayOfWeek(Time[i])<=2 && TimeDayOfWeek(Time[i+1])>=4) { //we are at the first bar of the week, means nearest bar in W1 is this weeks bar int shift= iBarShift(Symbol(),PERIOD_W1,Time[i],false); double wo = iOpen(Symbol(), PERIOD_W1, shift+1); double wh = iHigh(Symbol(), PERIOD_W1, shift+1); double wl = iLow(Symbol(), PERIOD_W1, shift+1); double calc = iOpen(Symbol(), PERIOD_W1, shift+1)-(iOpen(Symbol(), PERIOD_W1, shift+1)-iLow(Symbol(), PERIOD_W1, shift+1)); } a_wo[i]=wo; a_wl[i]=wl; a_wh[i]=wh; a_calc[i]=(wh+wl)/2; Comment(calc); } //---- return(0); }