i do this by taking the slope of the current point and the point from N seconds ago. I use the esper library which has a slope function :eek:
Perfect but how do you overcome the inconsistency of unbalanced chart bars. (If using time or tick charts.)
Look for the post from Tums How to draw tapes... See if this helps http://www.elitetrader.com/vb/showthread.php?s=&postid=2193328&highlight=draw#post2193328
This is only a hard task if there isn't a precise definition of what constitutes a trend. With such a definition, it's easy peasie.
Time Bar Chart - A Bar chart where each bar carries a unique volume weight because each specific market/symbol completes a random number of transactions per minute and there are a random number of shares or contracts traded per transaction. Unbalanced Bar Chart Tick Bar Chart - A Bar chart where each bar is made up of a fixed number of transactions per bar and still carries a unique volume weight because each specific market/symbol completes a random number of contracts per transaction. (GLOBEX's decision in 2007 to arbitrarily group transactions virtually destroyed the ability to balance this chart type) Unbalanced Bar Chart Volume Bar Chart - A Bar chart where each bar is made up of a nearly fixed number of shares or contracts traded per bar but still carries a unique volume weight because unless the volume is capped on each bar there is the potential for contracts or shares can roll over to the next bar based on larger transactions being applied to the chart. Unbalanced Bar Chart Constant or Capped Volume Bar Chart - A Bar chart where each bar is made up of a fixed unvarying number of shares or contracts traded per bar. Balanced Bar Chart
Two 8EMAs slope envelope.One of the high, other of the low.There you got a trendline and a tape - two in one.
The OP stated they wanted to basically compute a trendline of the form (y - y0) = m (x-x0). They stated wanted to use this to determine box ranges and triangles. Two 8 EMA's slope envelope alone will not allow the OP to compute their goal.