Can't get trendlines to plot - EasyLanguage Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming

Can't get trendlines to plot
Started:August 19th, 2012 (06:19 PM) by PippiLong Views / Replies:1,166 / 1
Last Reply:August 19th, 2012 (06:19 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Can't get trendlines to plot

Old August 19th, 2012, 06:19 PM   #1 (permalink)
Trading Apprentice
Dallas, TX
Futures Experience: Intermediate
Platform: Tradestation
Favorite Futures: Futures
Posts: 7 since Jul 2012
Thanks: 1 given, 0 received

Can't get trendlines to plot

This was written for a Renko chart. I don't think will work on other types of charts. Any help you can give would be greatly appreciated.

Try as I might I can't figure out why my trendlines won't plot. I think it is something really obvious but ....

In the code below if I add the second trendline plot statement block or anything below the first one entitled

//Draw Trendlines for Pivot Highs

Then none plot. If you comment out Everything below this plot area this trendline plots fine. Also if you change the IF statement in the plot area below entitled

//Draw trendlines for Tops

from if TOP<>Top to 1 > 0 then both the trendline plot above but the second one plots a new trendline for every new bar. I was trying just to have one new trendline plotted each time the pivoth or top value changed but keep extending to the right until a new value is created.

Maybe there is a better way also.

Input: 	TextOffset(.25),

vars: X(0), PivotL(0), PivotH(0), HHigh(0), LLow(0), Top(0), Bottom(0), 
	  PHBarNumber(0), FirstLHBarNumber (0), PLBarNumber(0), DrawCreek(0), DrawIce(0), HHPBarNumber(0),HLPBarNUmber(0), TXT_UT(""),
	  JOC(0), JOCValue(0), FTI(0), FTIValue(0), Spring(0), UpThrust(0), SpringPrice(0), UpThrustPrice(0);

//UpTrends and Tops

If C<C[1] and Upticks[1] > 0 Then Begin //Is a Pivot High
	If C[1] > PivotH Then // Higher High Pivot
		HHigh = 1;
	 	DrawIce = 0;
	 	DrawCreek = 0;
	 	HHPBarNumber = BarNumber;
	If C[1] = PivotH and HHigh[1] = 1 Then //This is Double Top in an Uptrend Draw Ice at prior pivot high's low
	 	HHigh = 1;
	 	DrawIce = 0;
	 	HHPBarNumber = BarNumber[3]; 
	 If C[1] = PivotH and HHigh[1] = 0 Then //This is Double Top in a DownTrend
	 	HHigh = 0;
	 	DrawIce = 0;
	 	HHPBarNumber = BarNumber[3];
	If C[1] < PivotH And HHigh[1] = 1 Then Begin   //Top - Is Lower than previous pivot high & Last Pivot High was higher than previous pivot high/First LL
			HHigh = 0;
			Top = PivotH[1];  // This is uptrend top 
			PHBarNumber = PHBarNumber[1];
			DrawIce = 1;
			FTI = 1;
			FTIValue = PivotL;
			//Text For First LH
				 Value1 = Text_New(Date[1], Time[1], High[1] + Range * Textoffset , "1stLH");
				 Text_SetColor(Value1, Black);
				 Text_setstyle(Value1, 2, 1); 
			//Text For On The Spring Board Dn 
				If Upthrust = 1 Then Begin 
					Value2 = Text_New(Date[1], Time[1], High[1] + Range * Textoffset , "On SpringBoard");
				 	Text_SetColor(Value2, Black);
				 	Text_setstyle(Value2, 2, 0);
				 	UPthrust = 0;
		PivotH = Close[1]; //Set Last Pivot High Price
		PHBarNumber = BarNumber[1];		 	
	//Draw Trendlne for pivot Highs 
	If PivotH <> PivotH[1] Then Begin
			Value3 = TL_New(Date[1], Time[1], PivotH, Date, Time, PivotH);
				Tl_setcolor(Value3, Blue);
				Tl_Setstyle(Value3, Tool_Dotted);
				//Tl_setsize(Value3, 1);
	Else Begin 
		If PivotH = PivotH[1] Then 
			Value4 = TL_SetEnd(Value3, Date, Time, PivotH);
	//Draw Trendline For Tops 
	If top <> Top[1]  Then Begin 
		Value5 = TL_New(Date[1], Time[1], Top, Date, Time, Top);
		Value6 = Tl_setbegin(Value5, Date[BarNumber[1] - PHBarNumber[1] +1], Time[BarNumber[1] - PHBarNumber[1] +1], Top);
			Tl_setcolor(Value5, DarkGreen);
			Tl_setsize(Value5, 1);
		Else Begin If Top = Top Then 
			Value7 = TL_SetEnd(Value5, Date, Time, Top);

Reply With Quote

Old August 19th, 2012, 06:19 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming > Can't get trendlines to plot

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trading Fractals, Multiple Trendlines and Momentum tdaman NinjaTrader 15 February 15th, 2014 10:03 PM
Trendlines not matching from Higher Timeframe to lower Timeframe? bluemele NinjaTrader 26 October 8th, 2012 02:35 PM
Strength Of Trendlines pipsaholic Currency Futures 8 December 28th, 2011 11:45 AM
Duplicating NT7 charts while retaining trendlines and notes? crimmins NinjaTrader 6 January 7th, 2011 11:34 AM
Could you help me with this plot??? andaluz NinjaTrader Programming 2 May 30th, 2010 07:54 PM

All times are GMT -4. The time now is 05:00 AM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-24 in 0.08 seconds with 20 queries on phoenix via your IP