| TradeStation Custom Programming Discuss projects, ideas, obstacles in programming with TradeStation. |
![]() | | Tweet | |
| | #1 | ||
![]() | Trendline Vs Plots PlotN(Expression[,"<PlotName>"[,ForeColor[,Default[,Width]]]]); Expression is the price value to be plotted, PlotName and ForeColor are self explanatory. Width is how thick you want the plot to be. Text and Trend Lines are created using the Text_XXXXX and TL_XXXXX Reserved Words. The "TL_New" reserved word adds a trendline. TL_New (Reserved Word) This reserved word adds a trendline with the specified starting and ending points to a price chart. It returns a numeric expression corresponding to the ID number of the trendline added to the chart. I want to start a trendline, and have it continue until the next signal.
__________________ Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens. | ||
| |
|
| | #2 | ||
![]() | Re: Trendline Vs Plots TL_SetEnd (Reserved Word) This sets the end of the trendline. Quote:
I'm trying to avoid having connecting lines between trend lines that are at different price levels.
__________________ Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens. | ||
| |
|
| | #3 | ||
![]() | Re: Trendline Vs Plots Quote:
you plot one bar at a time... when plotting a line, as in a moving average, you get a continuous curving line. when plotting a line based on a pivot value... you get a straight line. Trendline (TL_NEW) is a drawing object. you define the coordinates -- the starting point and the ending point, in terms of date, time and price, and you get a trendline. a trendline is always straight; it can be a vertical line, horizontal line, or a line that spans diagonally across the chart. a trendline can be made to extend beyond the starting and/or ending point. a trendline can be moved, deleted, attributes modified... well... trendlines can be fun, or headache... depends on which side of the fence you are on. more discussions here: http://www.traderslaboratory.com/for...ylanguage.html 59.45
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| | #4 | ||
![]() | Re: Trendline Vs Plots Quote:
Code: var: Peak(False),NoPriorPk(False);
var: ClsDwn(False),ClsUp(False);
var: ht(H);
ClsDwn=c<o;
ClsUp=c>o;
Peak=ClsUp[1] and ClsDwn;
NoPriorPk=Peak[1] = false;
if Peak and NoPriorPk then ht= H[1];
{-- restarts the trendline if a new peak signal fired ---}
var: HiTrget(-1);
if Peak then
Begin
HiTrget = tl_new(d, t, H, d, t, H);
end;
{--- extends the trendline from PEAK to current bar ---}
tl_setend(HiTrget, d, t, h);
// To test for a PEAK signal. Set format to POINTS.
{If Peak and NoPriorPk then
plot30(l,"Test",Black,5)
else NoPlot(30);}
__________________ Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens. | ||
| |
|
| | #5 | ||
![]() | Re: Trendline Vs Plots Quote:
With tradestation, you can only use minute chart or higher resolutions. ie no tick chart or any non-time based charts. With MultiCharts, you can draw on any chart format.
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| | #6 | ||
![]() | Re: Trendline Vs Plots Code: var: Peak(False),NoPriorPk(False);
var: ClsDwn(False),ClsUp(False);
var: ht(H);
ClsDwn=c<o;
ClsUp=c>o;
Peak=ClsUp[1] and ClsDwn;
NoPriorPk=Peak[1] = false;
if Peak and NoPriorPk then ht= H[1];
{-- restarts the trendline if a new peak signal fired ---}
var: HiTrget(-1);
if Peak then
Begin
HiTrget = tl_new(d, t, Ht, d, t, Ht); // <--- note correction on Ht
end;
{--- extends the trendline from PEAK to current bar ---}
tl_setend(HiTrget, d, t, ht); // <--- note correction on Ht
// To test for a PEAK signal. Set format to POINTS.
{If Peak and NoPriorPk then
plot30(l,"Test",Black,5)
else NoPlot(30);}
__________________ Only an idiot would reply to a stupid post | ||
| |
|
| The Following User Says Thank You to Tams For This Useful Post: | ||
Tradewinds (07-05-2011) | ||
| | #7 | ||
![]() | Re: Trendline Vs Plots
__________________ Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens. | ||
| |
|
| | #8 | ||
![]() | Re: Trendline Vs Plots Code: Variable: ID(-1); If C[1]>O[1] AND Close<O Then Begin ID = TL_New(Date[1], Time[1], H[1], Date, Time, H[1]); Value1 = TL_SetExtRight(ID, True); End; ID = TL_New(Date[1], Time[1], H[1], Date, Time, H[1]); So this is a beginning. Now I need to be able to stop one trend line when the next one starts. This code uses the same logic, but just adds a little bit of detail: Code: var: Peak1(False); Peak1 = C[1]>O[1] AND Close<O; Variable: ID(-1); If Peak1 Then Begin ID = TL_New(Date[1], Time[1], H[1], Date, Time, H[1]); Value1 = TL_SetExtRight(ID, True); End;
__________________ Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens. | ||
| |
|
![]() |
| Tags |
| trendline |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Instantaneous TrendLine | Tams | Trading Indicators | 43 | 09-06-2011 11:21 PM |
| Hideing Plots from Info Window | chrisleonard | Coding Forum | 9 | 03-02-2011 06:18 AM |
| RSI Divergence TrendLine | aaa | Trading Indicators | 11 | 02-25-2011 02:36 PM |
| Trendline Indicator | andypap | Coding Forum | 1 | 01-04-2010 07:27 PM |
| Chart Style Symbol Type Plots in Showme | cjstrader5 | The Candlestick Corner | 7 | 11-19-2009 11:33 PM |