Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
folks, i'm having trouble with trend lines in easy language and i decided to post in this new thread.
i'm trying to create an indicator that would draw something like a gann fan on the high of the first bar after a % increase ( length 60, pctup .5% ) was observed. i would use the same logic the ts % increase paint bar uses, all the rays in the gann fan should continue extending to the right, and in the first bar that this % increase condition stops being true the gann fan should be stop extending right or be deleted.
i have taken a look at all the sample code for trend lines i have been able to find and the closest thing i could find has been this indicator below. however, i haven't been able to make any progress at all in putting this indicator together, i'm not a programmer and this has been really frustrating. i haven't been able to modify the code below so that it would identify the first bar when a % increase of .5 was observed (and also stored its date, time and price coordinates) and then it drew trend lines (a gann fan of 8x1,4x1,...,1x8 lines) that fanned out from the high of that particular bar.
i understand that creating trend lines from easylanguage requires a start and end point for each, but if i have just the start point and want to extend several lines from that point at different gann angles (¿or angles, or slopes?) i haven't been able to think of any possible methods so that i could get ts to do this. ¿does anyone know how does the code for gann fans drawing objects work or where could i find it?
what i have in mind would look like this:
this is the paint bar by itself showing that the % increase is being observed.
and as soon as the condition starts being true, i would want the 9 trend lines to be drawn from the high of that bar and to extend right until the % increase condition stopped being true.
if anyone can help me put this indicator together or has any suggestions i would greatly appreciate it. thanks.
Can you help answer these questions from other members on NexusFi?
take a look in the Tradestation forum, there are threads with indicators drawing Gann Fans (use the Advanced Search option as it allows you to search for exact phrases like Gann Fan). This might give you some ideas.
i have been putting in more time trying to get easylanguage trend lines to work but i have made practically no progress so far. i have some very concrete questions and if anyone with easylanguage knowledge could chip in with the answers that would be great.
first of all, ¿is there any way to get the ts development environment to comment on any errors that are keeping a particular instrument from verifying? every other coding interface i have come across earlier does give a brief description of what went wrong, where and why but with ts there are no explanations as to why any piece of code won't verify.
now, back to the subject of trend lines, as far as i understand, every trend line needs 4 coordinates: starting date and time, starting price level, ending date and time, and ending price level.
i want my trend line to be drawn at the high of the first bar for which a % increase ( length 60, pctup .2% ) is true. i think something similar to this fragment of code below could identify when this condition ( startingpointfan ) becomes true:
now the question would be, ¿how could i get easylanguage to obtain and store the date, time and price values for the bar where this event last took place? ¿what if i wanted the ts engine to obtain these same values for the bar when price last crossed over an sma or other similar conditions?
the sample code that ts linked to (i included it in my second post) uses a specialized function PivotHighVSBar that returns the location for an event. i also discovered that a similar function exists for the bars where the highest or lowest values were observed, but if i want to obtain and store the data for other kind of events i have no idea whether ts can accomplish this kind of tasks.
the second question would be, once i have managed to get the set of coordinates for the starting point, ¿how could i extend a trend line from that particular point?
from what i have researched, the ending price level could be determined with the following equation, where y2 is the ending price level, y1 is the starting price level, L could be standardized to 1 and a would be the angle we wanted.
y2 = y1 + (L * sin(a))
it is the ending date and time coordinate i'm having the most trouble with. ¿how could i add get the ts engine to go to the next bar on the chart? keep in mind that this code would require tweaks - adjustments for different kinds of bars (daily, weekly, monthly, versus minute - range - momentum - etc). i'm thinking that x2 could be determined very simply by adding 1 to x1.
x2 = x1 + 1
i have tried this very formulation on my indicator but it won't verify:
very well, if anyone has any suggestions or code samples they will be greatly appreciated. thanks, regards.