Indicator Placing Trendlines & Arrows Using Indicator Counted

 

i can't get counted bars to work properly. it keeps reusing the last two trend lines.

 if(LookBack==0){ iCNTr=Bars-1; }else{ iCNTr=LookBack; }
 iCb=IndicatorCounted();
 if(iCb<0){ return(-1); }
 if(iCb>0){ iCb--; }
 iCNTr=iCNTr-iCb;
 while(iCNTr>=0)
 {
 //-
 }

thx again to whroeder for help with placing trend lines.


            
 
  1. lookbacks correctly.
  2. while(iCNTr>=0){
      //- trend line up? sell
      if( Close[iCNTr]>Open[iCNTr] && Close[iCNTr-1]>Open[iCNTr-1] && Low[iCNTr]<Low[iCNTr-1] ) 
    
    Why are you looking at future prices and what do you think happens when iCNTr is zero?
 
WHRoeder:
  1. lookbacks correctly.
  2. Why are you looking at future prices and what do you think happens when iCNTr is zero?

the last bar @ bar 0 should't be updated anyway.  sorry but IndicatorCounted , makes no sense to me - or maybe it doesn't work with objects

 
Subgenius: sorry but IndicatorCounted , makes no sense to me - or maybe it doesn't work with objects
IndicatorCounted has nothing to do with objects. Absolutely nothing.
 
WHRoeder:
Subgenius: sorry but IndicatorCounted , makes no sense to me - or maybe it doesn't work with objects
IndicatorCounted has nothing to do with objects. Absolutely nothing.

 its reusing 1 & 0 and sometimes 2 for trend line bars when counting backwards..

could that have anything to do with what your saying?

you said my loopback count was correct.. what gives ??

 
Subgenius:

okay so its reusing 1 & 0 and sometimes 2 for trend line bars when counting backwards..

could that have anything to do with what your saying?

you said my loopback count was correct.. what gives ??

how can i get indicator counted bars in this indicator?