Indicator Placing Trendlines & Arrows Using Indicator Counted

Back to topics list To post a new topic, please log in or register
avatar
211
Subgenius 2016.08.09 13: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.




Attached files:
  hltl-raysv9.mq4  (4.14 KB)
avatar
13006
WHRoeder 2016.08.09 14: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?
avatar
211
Subgenius 2016.08.09 15: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

avatar
13006
WHRoeder 2016.08.09 15: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.

avatar
211
Subgenius 2016.08.09 21: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 ??

avatar
211
Subgenius 2016.08.10 03: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?
Attached files:
  hltl-raysv9_1.mq4  (3.14 KB)
Back to topics list  

To add comments, please log in or register