trend line support - page 2

 
WHRoeder:
bOOb54bee4: now your telling me its not possuble  correct?
bOOb54bee4: my inclination tells me if i did period * period + time[0]  i would still need a negative bar to send it to, buy your saying its not possible to do that.
  1. No I didn't. I said the exact opposite.
  2. What is the argument after "window index" of ObjectCreate?
  3. What does it have to do with a bar index?


as you can see from this progression of the LineJump variable from 1 to 5:

1: this is good


2: this is good


3: this is fails to establish the price 2 & bar which is before bar 0. a trend line has been lost.


4: this is good but a trend line has been lost.


5: this is fails to establish the price 2 & bar which is before bar 0. two trend lines have been lost.





int start()
 {
 
 int LookBackNew; 
 
 if(LookBack==0){ LookBackNew=Bars-1; }else{ LookBackNew=LookBack; }
 
 for(int i=LookBackNew; i>0; i--) // ..count backwards..
  {
  
  if(ObjectFind("Lines"+IntegerToString(i))!=-1){ObjectDelete("Lines"+IntegerToString(i));}
  
  //- trend line up?
  
  if( Close[i]>Open[i] && Close[i-1]>Open[i-1] && 
                 Low[i]<Low[i-1] ) 
   { 
    ObjectCreate("Lines"+IntegerToString(i),OBJ_TREND,0,
    /* origin in time with specific price */            Time[i],           Low[i],
    /* destination in time with specific price */       Time[i-LineJump],  Low[i-1]-( (LineJump-1) * ( Low[i]-Low[i-1] ) ) );
    ObjectSet("Lines"+IntegerToString(i),OBJPROP_RAY,LineRays);z
    ObjectSet("Lines"+IntegerToString(i),OBJPROP_COLOR,LinesUp);
    ObjectSet("Lines"+IntegerToString(i),OBJPROP_BACK,LineBack);
    ObjectSet("Lines"+IntegerToString(i),OBJPROP_WIDTH,LineWidth);
    
   }
  
  //- trend line down?
  
  if( Open[i]>Close[i] && Open[i-1]>Close[i-1] && 
                High[i]>High[i-1] ) 
   { 
    ObjectCreate("Lines"+IntegerToString(i),OBJ_TREND,0,
    /* origin in time with specific price */            Time[i],           High[i],
    /* destination in time with specific price */       Time[i-LineJump],  High[i-1]-( ( LineJump-1 ) * ( High[i]-High[i-1] ) ) );
    ObjectSet("Lines"+IntegerToString(i),OBJPROP_RAY,LineRays);
    ObjectSet("Lines"+IntegerToString(i),OBJPROP_COLOR,LinesDown);
    ObjectSet("Lines"+IntegerToString(i),OBJPROP_BACK,LineBack);
    ObjectSet("Lines"+IntegerToString(i),OBJPROP_WIDTH,LineWidth);
    
   }
  }
  
 return(0);
 }
//+------------------------------------------------------------------+

the ones in red would be the lines which drop before bar 0.

 
WHRoeder:
Previously answered. There is no Time[negative] what part of . "You have to pass an actual time Time[i] + _Period*LineJump" was unclear?

okay, please confirm that you're saying its possible to specify the datetime bar with

added date time to it(somehow) and add time to it and this will get a trend line drop before bar 0 ( in the negative bars )

 
WHRoeder:
bOOb54bee4: now your telling me its not possuble  correct?
bOOb54bee4: my inclination tells me if i did period * period + time[0]  i would still need a negative bar to send it to, buy your saying its not possible to do that.
  1. No I didn't. I said the exact opposite.
  2. What is the argument after "window index" of ObjectCreate?
  3. What does it have to do with a bar index?

heureka


blessings

Reason: