Download MetaTrader 5
To add comments, please log in or register
Interested in MetaTrader 5 features? Learn more about them!
Subgenius
572
Subgenius 2016.08.09 11:49 

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.

Files:
whroeder1
13597
whroeder1 2016.08.09 12:52  
  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?
Subgenius
572
Subgenius 2016.08.09 13:16  
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

whroeder1
13597
whroeder1 2016.08.09 13:52  
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.
Subgenius
572
Subgenius 2016.08.09 19:10  
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
572
Subgenius 2016.08.10 01:22  
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?
Files:
/
To add comments, please log in or register