You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I need some help with the TD Pivot indicator.
I want the indicator to show the weekly pivot lines on the daily chart. As you can see on the attached picture, the indicator builds the pivot lines of seven days instead of five days.
What to do to make the indicator build the pivot and show the pivot of five consecutive days instead of seven?
The code is:
low = low[i+1];
continue;
}
int candlesPerWeek = PERIOD_W1/Period(),
week = MathFloor(i/candlesPerWeek)+1;
double H = iHigh(NULL,PERIOD_W1,week),
L = iLow(NULL,PERIOD_W1,week),
O = iOpen(NULL,PERIOD_W1,week),
C = iClose(NULL,PERIOD_W1,week),
X;
if (C < O) X = H + 2*L + C;
else if (C > O) X = 2*H + L + C;
else if (C ==O) X = H + L + 2*C;
high = 0.5*X - L;
low = 0.5*X - H;
}
//----
return(0);
}
//+------------------------------------------------------------------+