check out the linregslope indicator, for instance:

x = Cum(1);
lastx = LastValue( x ); Daysback = 10; aa = LastValue( LinRegIntercept( Close, 
Daysback) );
bb = LastValue( LinRegSlope( Close, Daysback ) );

y = Aa + bb * ( x - (Lastx - DaysBack) ); Plot( Close, "Close", colorBlack, 
styleCandle );
Plot( IIf( x >= (lastx - Daysback), y, -1e10 ), "LinReg", colorRed );

  ----- Original Message ----- 
  From: convertah 
  To: [email protected] 
  Sent: Wednesday, August 13, 2008 6:55 PM
  Subject: [amibroker] Trendline Indicator


  Kind Greetings,

  I have been trying to code an indicator that will render a trendline that 
will be used as a support-resistance reference line. 

  The trendline would be drawn through yesterdays 9:30AM candle (open+close)/2 
and yesterdays 4:00PM candle (open+close)/2 and extend into today.

  I'm new to AFL and after l studied the users guide on AFL function references 
I realized I'm not sure where to even start. If someone could give me a little 
starting push it would be greatly appreciated.

  Thank you,
  All the best

  Geary


   

Reply via email to