Challenge Trendlines

 

Hello Experts :-)

I just this code to check if current price hits a support line and draw an arrow on the chart in such case: 

int start()
{
if(Bars<=3) return(0);
int ExtCountedBars=IndicatorCounted();
if (ExtCountedBars<0) return(-1);
int current=Bars-2;
if(ExtCountedBars>2) current=Bars-ExtCountedBars-1;
while(current>=0)
{
if
(
iLow(NULL, 0, current)<=ObjectGetValueByShift("AllPivots S1[0]", current)

The support line is displayed via another Indicator. The arrow is generally printed properly but just for the current H1 line.
If i look more back (lets say 3 hours back) then the Support indicator will correctly display the old H1-support line but the arrow will still be based on the current support line.

In my opinion there are 2 problems:
1) The lines have individual numbers (current H1 line has[0], previous has [1]  and so on)
2) different timeframes might mix things up.

Is there a way to combine current timeframes Low with the specific H1 support line that was valid at that time ?

 I am not sure if i expressed myself correct. English is not my first language...

 

Thanks in advance for any hints.

Stefan 

 

Anyone?

 
sjust2fast:

Anyone?

May be you should use more dimensional arrays like dim2Arr[array of timeframes][array of tf-avlues] ?
Reason: