| TradeStation Custom Programming Discuss projects, ideas, obstacles in programming with TradeStation. |
![]() | | Tweet | |
| | #9 | ||
![]() | Re: Trendline Vs Plots Quote:
note: // <-- add this line Code: var: Peak1(False);
Peak1 = C[1]>O[1] AND Close<O;
Variable: ID(-1);
If Peak1 Then
Begin
TL_SetExtRight( ID[1] , FALSE); // <-- add this line
ID = TL_New(Date[1], Time[1], H[1], Date, Time, H[1]);
Value1 = TL_SetExtRight(ID, True);
End;
__________________ 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) | ||
| | #10 | ||
![]() | Re: Trendline Vs Plots Variable: OldKeyID(-1), ID(-1); So the OldKeyID AND the ID are both being initialized at a value of -1. I'm guessing what happens, is that each new trend line is assigned a successive number. This still doesn't do what I want, I want all the old trend lines to remain on the chart. Maybe I can use the OldKeyID to end the last line instead of delete it. Code: var: Peak1(False); Peak1 = C[1]>O[1] AND Close<O; Variable: OldKeyID(-1), ID(-1); If Peak1 Then Begin OldKeyID = ID; ID = TL_New(Date[1], Time[1], H[1], Date, Time, H[1]); Value1 = TL_SetExtRight(ID, True); If OldKeyID <> -1 Then Value1 = TL_Delete(OldKeyID); 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. | ||
| |
|
| | #11 | ||
![]() | Re: Trendline Vs Plots Code: var: Peak1(False); Variable: OldKeyID(-1), ID(-1); Peak1 = C[1]>O[1] AND Close<O; If Peak1 Then Begin OldKeyID = ID; ID = TL_New(Date[1], Time[1], H[1], Date, Time, H[1]); Value1 = TL_SetExtRight(ID, True); If OldKeyID <> -1 Then Value1 = TL_SetExtRight(OldKeyID, False); 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. | ||
| |
|
| | #12 | ||
![]() | Re: Trendline Vs Plots I think I've done it!!! I will now take over the world !!! The code retrieves the new Start Time from the new trendline, and uses that as the End time for the old trend line. Then the code retrieves the Begin Value from the Old trend line and uses it as the end value for the old trend line. So the old trendline begins and ends at the same price - Horizontal line. But before the End is set for the old trendline, the extension to the right is shut down for the old trend line, but ONLY the Old trend line. So only the current trend line is being extended to the right. This causes the current trend line to be extended in "real time" as the chart is updating. As soon as a new Peak signal fires, the Extension to the Right shuts down and the ending point is defined for the last trendline. Code: var: Peak1(False);
Variable: OldKeyID(-1), ID(-1);
var: NewStartTime(t),OldStartPrice(h);
Peak1 = C[1]>O[1] AND Close<O;
If Peak1 Then Begin
OldKeyID = ID;
ID = TL_New(Date[1], Time[1], H[1], Date, Time, H[1]);
Value1 = TL_SetExtRight(ID, True);
If OldKeyID <> -1 Then
Begin
NewStartTime = TL_GetBeginTime(ID);
OldStartPrice = TL_GetBeginVal(OldKeyID);
Value1 = TL_SetExtRight(OldKeyID, False);
Value2 = TL_SetEnd(OldKeyID, Date, NewStartTime, OldStartPrice);
End;
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. | ||
| |
|
| | #13 | ||
![]() | Re: Trendline Vs Plots http://www.traderslaboratory.com/for...uto-plots.html
__________________ 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. | ||
| |
|
| The Following User Says Thank You to Tradewinds For This Useful Post: | ||
Tams (07-09-2011) | ||
![]() |
| 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 |