Exporting a Trendline

dima777

Member
Messages
85
Likes
1
Hi!
I wanted to ask if it is possibel to export the trendline values in a text file? or to make an indicator which plots its value?
thanks
Dima
 
Yes you can export the values of a trendline to a text file. The trendline itself being visible means that it is being plotted already ?? Which version of TradeStation are we referencing here ?
 
thats good news!....i am using Version: 8.1 SP1 (Build 3006)...can you pls explain how do i export them? i tried using the data window but it exports only the price...((( even if it shows the trendline values....
 
btw...i am generally interested in exporting any analysis techniques - be it an indicator or a trendline.....looking forward to hear what you think of this
 
To export a trendline value to a file you could do something like this:

print( file( "C:\MyFile.txt" ), date, ",", time, ",", TL_GetEndVal( TL_ID ) ) ;

The trendlines that are on the chart will all have ID numbers. If you created them using EasyLanguage or if somebody else did in EL code then you will see something like this

TL_ID = TL_New( ... )

The part to the left of the = will be the variable that you would insert into the parentheses in the first example.
 
thanks....but will that export only the endvalue of the trendline? i need to export the trendline as a data series..thx!
 
It will write the file on each new bar and this will in turn develop the time series trendlines
 
i now have an open chart with a trendline on it (#1)...can you please guide through the process of atually exporting it..do i paste this into the powereditor:
print( file( "C:\MyFile.txt" ), date, ",", time, ",", TL_GetEndVal( 1 ) ) ;
and run?
thanks!!!
 
If you have a trendline that you manually placed onto the chart then you are only going to get one value for it. For this to be beneficial to you you would want to use something like this on a chart where you are drawing the trendlines yourself. In this fashion you would be able to create a changing value for the end point of the trendline and then export that into Excel and then plot the same trendline in a chart or do calculations as if this were in TradeStation.
 
thank you for your description but i do not fully understand....do you mean that I should draw multiple trendlines by hand to be able to export them as numeric series? can you please help me to export my current single trendline? i hope i can move on from there on my own..
thanks!
 
You should write the EasyLanguage code to draw the trendlines. In this fashion on each new bar on the chart the Trendline can be evaluated and the points on the TL can be grabbed and then exported to a file if desired. In this fashion you can see exactly where the TLs were at on each step of the charting. You can then build a continuous charting of how the TLs moved around based on new data incoming to the charting. Here is an example. A trendline can actually be horizontal. a good example of this would be a floor trader pivot series. These lines change from day to day. If you exported all of the values for the lines to a file then you could rebuild the series over history in another application like excel. In this fashion you could use them to do things such as backtest in Excel.
 
thanks!!! can you please walk me through the process of exporting at least the first trendline which is drawn by the automatic trendlines indicator? do i simply add the code you provided earlier to the source code of tis indicator?
thanks a lot for your attention!
 
Give me some time and I will take a look see at what I can't do there for you. It would also help if I knew the end goal of doing the export.
 
In looking closer at the code for the AutoTL, I am not sure that it would lend itself very well to doing what I am talking about. I will have to find more time to evaluate it closer and do some testing.
 
I haven't had the time yet to go over the whole thing closer as I am deep into a couple of projects that are on a timeline.
 
Here is a complete EasyLanguage indicator, and a good usable one, that has an example at the end for how you can write things to a file. You can then use that file to be loaded into other applications such as Excel for further study. The same concepts apply to getting other items into a file. This example is a comma delimited file structure. If you were to build the file and use the csv extension then it would automatically open with Excel. There are two mnemonic inputs at the bottom of the input section that run the file writing. You have the choice to print to file only the plotted section of the indicator forward or you can print the file with all the data on the chart up through current. You do not want to write the files while updating every tick, but rather as an end of bar thing. The indicator is sent by default to be end of bar. This type of thing is actually best ran using a file appending structure, but this method is easier to build.

Enjoy.
 

Attachments

  • gbLRC.ELD
    18 KB · Views: 297
thanks...that looks great! i attached the indicator to the charts and it doesnt show anyhtning...do not why..((( I will need some time to understand what this indicator is trying to acomplish as It is very complex...thanks!
 
Top