Download MetaTrader 5

Indicator Placing Trendlines & Arrows Using Indicator Counted

To add comments, please log in or register
Brian Lillard
697
Brian Lillard  

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.

whroeder1
15350
whroeder1  
  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?
Brian Lillard
697
Brian Lillard  
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
15350
whroeder1  
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.
Brian Lillard
697
Brian Lillard  
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 ??

Brian Lillard
697
Brian Lillard  
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?
To add comments, please log in or register