Hi, ich versuche mich gerade an einem Loop, welcher den Hoch- bzw. Tiefkurs der Vorwoche fortlaufend im Chart darstellt. Leider gibts nur Spagetti oder totales Abdriften, kann mir mal jemand einhelfen?
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);
for(i=limit-1; i>=0; i--)
{
// 1sts Days of Week
if(TimeDayOfWeek(Time[i])<=2 && TimeDayOfWeek(Time[i+1])>=4)
{
last_week_low=iLow(Symbol(),PERIOD_W1,i+1);
last_week_high= iHigh(Symbol(),PERIOD_W1,i+1);
}
low_Buffer[i]=last_week_low;
high_Buffer[i]=last_week_high;
}
//----
return(0);
}
Hi, ich versuche mich gerade an einem Loop, welcher den Hoch- bzw. Tiefkurs der Vorwoche fortlaufend im Chart darstellt. Leider gibts nur Spagetti oder totales Abdriften, kann mir mal jemand einhelfen?
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); for(i=limit-1; i>=0; i--) { // 1sts Days of Week if(TimeDayOfWeek(Time[i])<=2 && TimeDayOfWeek(Time[i+1])>=4) { last_week_low=iLow(Symbol(),PERIOD_W1,i+1); last_week_high= iHigh(Symbol(),PERIOD_W1,i+1); } low_Buffer[i]=last_week_low; high_Buffer[i]=last_week_high; } //---- return(0); }