[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: Trend line syntax



PureBytes Links

Trading Reference Links

Alex & Gabriel,

Saturday, November 22, 2003, 1:55:29 AM, you wrote:
AM> Gabriel,

AM> No code to offer, only advice.

>>Does anyone know the correct way to create an indicator that draws trend
>>lines into the future. I use lt_new to create the trend line and that
>>works fine, but tl_setextright only works sporadically. Sometimes when a
>>new trend line is created, the old one is no longer extended. 

AM> I believe the old trendline doesn't get extended if the bars that
AM> defined it scroll off the display.  One way to get around this is
AM> to keep track of all the trendline IDs, and on each new bar, read
AM> the TL value at that bar and then set a new trendline endpoint
AM> (TL_SetEnd I think) at that value.  That way the value defining a
AM> trendline will always be on the display.

>>I wanted to quantify trend lines, but maybe it is better to calculate
>>the slope and keep track of the values through arrays. Any advice will
>>be appreciated.

     Have had success with capturing required values in arrays and
     using one TL_New for all but the last line(or set of) with
     TL_SetExtRight=False, and another TL_New for the last line with
     TL_SetExtRight=True. Use a while loop to limit the plotting to
     the last values in the array or all those before it.

     Alex, I can scroll the bar holding the righthand values off the
     screen; it still plots?


AM> You can do that, but if you calculate your own trendlines, make sure
AM> you do it on log(price) instead of price.  Usually tradestation
AM> displays price charts in log scale (as it should), which means that
AM> the trendlines, slopes, and extensions are actually being calculated
AM> on log prices.  Any new price read off the trendline is actually the
AM> ExpValue of the internal trendline value.

    Find this confusing Alex. If  "you calculate your own trendlines"
    (with values stored in arrays ?) then why use log ? Raw price
    (which presumably the array values have been produced from) is in
    itself not log. ie when charting the plots will be appropriate to
    scaling. The TL_new 's descrided above plot appropriate to scaling.
    Can you explain anymore? I've lost the picture somewhere.

-- 
Best regards,
 jon                            mailto:jonmac@xxxxxxxxxxx