NexusFi: Find Your Edge


Home Menu

 





Can't get trendlines to plot


Discussion in EasyLanguage Programming

Updated
    1. trending_up 3,240 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
PippiLong
Dallas, TX
 
Posts: 7 since Jul 2012
Thanks Given: 1
Thanks Received: 0

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.




 
Code
Input: 	TextOffset(.25),
		UpLVol(1000),
		DnLVol(1000);

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;
				 End;	 
				 
	  End;	
		
		PivotH = Close[1]; //Set Last Pivot High Price
		PHBarNumber = BarNumber[1];		 	
End;
		
	//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);
	End
	Else Begin 
		If PivotH = PivotH[1] Then 
			Value4 = TL_SetEnd(Value3, Date, Time, PivotH);
	End;
			
	
	//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);
	End
		Else Begin If Top = Top Then 
			Value7 = TL_SetEnd(Value5, Date, Time, Top);
	End;


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks




Last Updated on August 19, 2012


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts