NexusFi: Find Your Edge


Home Menu

 





Code is referencing yesterday's range but not today's


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one olobay with 6 posts (1 thanks)
    2. looks_two ABCTG with 2 posts (2 thanks)
    3. looks_3 Hulk with 2 posts (2 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
      Best Posters
    1. looks_one ABCTG with 1 thanks per post
    2. looks_two Hulk with 1 thanks per post
    3. looks_3 JGSmith with 1 thanks per post
    4. looks_4 olobay with 0.2 thanks per post
    1. trending_up 3,192 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 10 posts
    2. attach_file 3 attachments




 
Search this Thread

Code is referencing yesterday's range but not today's

  #1 (permalink)
 olobay 
Montreal
 
Experience: Intermediate
Platform: MultiCharts
Broker: DeepDiscountTrading.com
Trading: CL
Posts: 364 since Jul 2011

Hi,

I have 2 problems with the code below.

1. The code is referencing yesterday's opening range and not today's. What do I need to change to get it to reference today's opening range between the StartCalcTime and EndCalcTime?

2. Once problem 1 is solved, I would like to have the opening range trendline extend to the input value of the TLEndTime. Right now I just have a vertical line shooting straight up for the opening range trendlines.

Thanks.

 
Code
Inputs:
	StartCalcTime		(0900),
	EndCalcTime		(0905),
	TLStartTime		(0900),
	TLEndTime		(1430),
	PlaceTextRight	(true),
	PlotatDateChange	(true),
	PlotToDateEnd		(true),
	IgnoreWeekends	(true),
	TLSize			(1),
	TLStyle		(1),
	DayHiColor		(white),
	DayLoColor		(white),
	FibR1Color		(red),
	FibR2Color		(red),
	FibR3Color		(red),	
	FibR4Color		(red),	
	FibS1Color		(green),
	FibS2Color		(green),
	FibS3Color		(green),
	FibS4Color		(green);;
		
Variables:
	Monday2Friday		(false),
	FibR1			(0),
	FibR2			(0),
	FibR3			(0),
	FibR4			(0),
	FibS1			(0),
	FibS2			(0),
	FibS3			(0),
	FibS4			(0),
	DayHiTL		(0),
	DayLoTL		(0),
	FibR1TL		(0),
	FibR2TL		(0),
	FibR3TL		(0),
	FibR4TL		(0),
	FibS1TL		(0),
	FibS2TL		(0),
	FibS3TL		(0),
	FibS4TL		(0),
	DayHi			(-999999),
	DayLo			(+999999),
	HaveTLs		(false),
	StartTime		(0),
	EndTime		(0),
	DayHiTxt		(0),
	DayLoTxt		(0),	
	FibR1Txt		(0),
	FibR2Txt		(0),
	FibR3Txt		(0),
	FibR4Txt		(0),
	FibS1Txt		(0),
	FibS2Txt		(0),
	FibS3Txt		(0),
	FibS4Txt		(0),
	SessClose		(0),
	TextStyleHoriz	(1), 	//0: To the right of the bar specified for the text object
 					//1: To the left of the bar specified for the text object
 					//2: Centered on the bar specified for the text object
	TextStyleVert		(2);	//0: Beneath the price specified for the text object
					//1: Above the price specified for the text object
					//2: Centered on the specified price location of the text object
	
If IgnoreWeekends then begin
	If DayOfWeek(Date) >= Monday and DayOfWeek(Date) <= Friday then 
		Monday2Friday = true
	else 
		Monday2Friday = false;

end
else begin
	Monday2Friday = true;
end;
	
		
If Monday2Friday then begin

	If Date <> Date[1] then begin
		If PlaceTextRight then 
			TextStyleVert = 1;
			
		If PlotatDateChange then
			StartTime = Time
		else
			StartTime = StartCalcTime;
		
		EndTime = Time[1];		
		
		FibR1 = DayLo + ((DayHi - DayLo) * 2.33);
		FibR2 = DayLo + ((DayHi - DayLo) * 3.82);
		FibR3 = DayLo + ((DayHi - DayLo) * 5);
		FibR4 = DayLo + ((DayHi - DayLo) * 6.1);
		FibS1 = DayHi - ((DayHi - DayLo) * 2.33);
		FibS2 = DayHi - ((DayHi - DayLo) * 3.82);
		FibS3 = DayHi - ((DayHi - DayLo) * 5);
		FibS4 = DayHi - ((DayHi - DayLo) * 6.1);

		DayHi = -999999;
		DayLo = +999999;
		HaveTLs = false;

	end; //If Date <> Date[1] then begin...	

	If Time > StartCalcTime and Time <= EndCalcTime then begin
		If High >= DayHi then DayHi = High;
		If Low <= DayLo then DayLo = Low;
		If BarStatus(1) = 2 then
		SessClose = Close;
	end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...
	
	If HaveTLs = false then begin
		HaveTLs = true;
		
		DayHiTL = TL_New(Date, StartCalcTime, DayHi, Date, EndCalcTime, DayHi);
			TL_SetColor(DayHiTL, DayHiColor);
			TL_SetSize(DayHiTL, TLSize);	
			TL_SetStyle(DayHiTL, TLStyle);
			
		DayLoTL = TL_New(Date, StartCalcTime, DayHi, Date, EndCalcTime, DayHi);
			TL_SetColor(DayLoTL, DayLoColor);
			TL_SetSize(DayLoTL, TLSize);	
			TL_SetStyle(DayLoTL, TLStyle);
		
		FibR1TL = TL_New(Date, TLStartTime	, FibR1, Date, TLEndTime	, FibR1);
			TL_SetColor(FibR1TL, FibR1Color);
			TL_SetSize(FibR1TL, TLSize);	
			TL_SetStyle(FibR1TL, TLStyle);			
		
		FibR2TL = TL_New(Date, TLStartTime	, FibR2, Date, TLEndTime	, FibR2);
			TL_SetColor(FibR2TL, FibR2Color);
			TL_SetSize(FibR2TL, TLSize);	
			TL_SetStyle(FibR2TL, TLStyle);
					
		FibR3TL = TL_New(Date, TlStartTime, FibR3, Date, TLEndTime, FibR3);
			TL_SetColor(FibR3TL, FibR3Color);
			TL_SetSize(FibR3TL, TLSize);	
			TL_SetStyle(FibR3TL, TLStyle);
			
		FibR4TL = TL_New(Date, TLStartTime, FibR4, Date, TLEndTime, FibR4);
			TL_SetColor(FibR4TL , FibR4Color);
			TL_SetSize(FibR4TL , TLSize);	
			TL_SetStyle(FibR4TL , TLStyle);
					
		FibS1TL = TL_New(Date, TLStartTime, FibS1, Date, TLEndTime, FibS1);
			TL_SetColor(FibS1TL, FibS1Color);
			TL_SetSize(FibS1TL, TLSize);	
			TL_SetStyle(FibS1TL, TLStyle);
					
		FibS2TL = TL_New(Date, TLStartTime, FibS2, Date, TLEndTime, FibS2);
			TL_SetColor(FibS2TL, FibS2Color);
			TL_SetSize(FibS2TL, TLSize);
			TL_SetStyle(FibS2TL, TLStyle);
					
		FibS3TL = TL_New(Date, TLStartTime, FibS3, Date, TLEndTime, FibS3);
			TL_SetColor(FibS3TL, FibS3Color);
			TL_SetSize(FibS3TL, TLSize);
			TL_SetStyle(FibS3TL, TLStyle);
			
		FibS4TL = TL_New(Date, TLStartTime, FibS4, Date, TLEndTime, FibS4);
			TL_SetColor(FibS4TL, FibS4Color);
			TL_SetSize(FibS4TL, TLSize);
			TL_SetStyle(FibS4TL, TLStyle);
								
		DayHiTxt = Text_New(Date, TLStartTime, DayHi, "100%");
			Text_SetStyle(DayHiTxt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(DayHiTxt, DayHiColor);

		DayLoTxt = Text_New(Date, TLStartTime, DayLo, "0%");
			Text_SetStyle(DayLoTxt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(DayLoTxt, DayLoColor);
		
		FibR1Txt = Text_New(Date, TLStartTime, FibR1, "233%");
			Text_SetStyle(FibR1Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR1Txt, FibR1Color);
					
		FibR2Txt = Text_New(Date, TLStartTime, FibR2, "382%");
			Text_SetStyle(FibR2Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR2Txt, FibR2Color);
			
		FibR3Txt = Text_New(Date, TLStartTime, FibR3, "500%");
			Text_SetStyle(FibR3Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR3Txt, FibR3Color);
			
		FibR4Txt = Text_New(Date, TLStartTime, FibR4, "610%");
			Text_SetStyle(FibR4Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR4Txt, FibR4Color);
			
		FibS1Txt = Text_New(Date, TLStartTime, FibS1, "233%");
			Text_SetStyle(FibS1Txt, TextStyleHoriz, TextStyleVert);
			Text_SetColor(FibS1Txt, FibS1Color);
						
		FibS2Txt = Text_New(Date, TLStartTime, FibS2, "382%");
			Text_SetStyle(FibS2Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS2Txt, FibS2Color);
			
		FibS3Txt = Text_New(Date, TLStartTime, FibS3, "500%");
			Text_SetStyle(FibS3Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS3Txt, FibS3Color);
			
		FibS4Txt = Text_New(Date, TLStartTime, FibS4, "610%");
			Text_SetStyle(FibS4Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS4Txt, FibS4Color);
										
	end //If HaveTLs = false then begin...
	else begin
			If PlotToDateEnd then 
				EndTime = EndTime
			else
				EndTime = EndCalcTime;
			
			TL_SetEnd(DayHiTL, Date, TLEndTime, DayHi);
			TL_SetEnd(DayLoTL, Date, TLEndTime, DayLo);
			TL_SetEnd(FibR1TL, Date, TLEndTime, FibR1);
			TL_SetEnd(FibR2TL, Date, TLEndTime, FibR2);
			TL_SetEnd(FibR3TL, Date, TLEndTime, FibR3);
			TL_SetEnd(FibR4TL, Date, TLEndTime, FibR4);
			TL_SetEnd(FibS1TL, Date, TLEndTime, FibS1);
			TL_SetEnd(FibS2TL, Date, TLEndTime, FibS2);
			TL_SetEnd(FibS3TL, Date, TLEndTime, FibS3);
			TL_SetEnd(FibS4TL, Date, TLEndTime, FibS4);
			
			If PlaceTextRight then begin
				Text_SetLocation(DayHiTxt, Date, TLEndTime, DayHi);
				Text_SetLocation(DayLoTxt, Date, TLEndTime, DayLo);
				Text_SetLocation(FibR1Txt, Date, TLEndTime, FibR1);
				Text_SetLocation(FibR2Txt, Date, TLEndTime, FibR2);
				Text_SetLocation(FibR3Txt, Date, TLEndTime, FibR3);
				Text_SetLocation(FibR4Txt, Date, TLEndTime, FibR4);
				Text_SetLocation(FibS1Txt, Date, TLEndTime, FibS1);
				Text_SetLocation(FibS2Txt, Date, TLEndTime, FibS2);
				Text_SetLocation(FibS3Txt, Date, TLEndTime, FibS3);
				Text_SetLocation(FibS4Txt, Date, TLEndTime, FibS4);
		
			end; //If PlaceTextRight then begin...
	end; //If HaveTLs then begin...

end; //If Monday2Friday then begin...

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
JGSmith's Avatar
 JGSmith 
Lübeck, Germany
 
Experience: Intermediate
Platform: NinjaTrader, MT4
Broker: FXCM, Interactive Brokers, Oanda
Trading: Forex
Posts: 151 since Aug 2013
Thanks Given: 61
Thanks Received: 55


I am just starting out in coding and not in EL, but here are two things that come to my mins when I look at it.

1. Right now you have "if Date <> Date[1]" do you need "if Date[0] <> Date[1]" ? Don't really know EL so don't know if you need that.

2. I can't see from the chart, is the last candle after the end of your range? On my NT time based range indicator, it won't calculate the current day's range until after the last bar of the range is closed.

Hopefully one of those helps. If not, here's to you finding a quick answer!

Reply With Quote
Thanked by:
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

The code tracks the High and Low during your time bracket and uses this for calculations on a new day. That's why it's using the previous day's values. What you want can be achieved by computing your levels at the end of the time bracket. You could do something like this:

[Code]
if Date <> Date[1] then
HaveLevels = false;
....
If Time > StartCalcTime and Time <= EndCalcTime then begin
If High >= DayHi then DayHi = High;
If Low <= DayLo then DayLo = Low;
If BarStatus(1) = 2 then
SessClose = Close;
end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...

if Time > EndCalcTime and HaveLevels = false then
begin
HaveLevels = true;
//calcualte your levels in here
end;

This is the code part where you have to make changes:
 
Code
	If Date <> Date[1] then begin
		If PlaceTextRight then 
			TextStyleVert = 1;
			
		If PlotatDateChange then
			StartTime = Time
		else
			StartTime = StartCalcTime;
		
		EndTime = Time[1];		
		
		FibR1 = DayLo + ((DayHi - DayLo) * 2.33);
		FibR2 = DayLo + ((DayHi - DayLo) * 3.82);
		FibR3 = DayLo + ((DayHi - DayLo) * 5);
		FibR4 = DayLo + ((DayHi - DayLo) * 6.1);
		FibS1 = DayHi - ((DayHi - DayLo) * 2.33);
		FibS2 = DayHi - ((DayHi - DayLo) * 3.82);
		FibS3 = DayHi - ((DayHi - DayLo) * 5);
		FibS4 = DayHi - ((DayHi - DayLo) * 6.1);

		DayHi = -999999;
		DayLo = +999999;
		HaveTLs = false;

	end; //If Date <> Date[1] then begin...	

	If Time > StartCalcTime and Time <= EndCalcTime then begin
		If High >= DayHi then DayHi = High;
		If Low <= DayLo then DayLo = Low;
		If BarStatus(1) = 2 then
		SessClose = Close;
	end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...
Regards,
ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
 olobay 
Montreal
 
Experience: Intermediate
Platform: MultiCharts
Broker: DeepDiscountTrading.com
Trading: CL
Posts: 364 since Jul 2011

Thanks for the help @ABCTG. I'ts getting there but not quite. I'm having 2 issues now.

1. The DayHiTL and DayLoTL lines are not plotting.

2. The text is not plotting to the right.

 
Code
Inputs:
	StartCalcTime		(0900),
	EndCalcTime		(0905),
	TLStartTime		(0900),
	TLEndTime		(1430),
	PlaceTextRight	(true),
	IgnoreWeekends	(true),
	TLSize			(1),
	TLStyle		(1),
	DayHiColor		(white),
	DayLoColor		(white),
	FibR1Color		(red),
	FibR2Color		(red),
	FibR3Color		(red),	
	FibR4Color		(red),	
	FibS1Color		(green),
	FibS2Color		(green),
	FibS3Color		(green),
	FibS4Color		(green);;
		
Variables:
	Monday2Friday		(false),
	FibR1			(0),
	FibR2			(0),
	FibR3			(0),
	FibR4			(0),
	FibS1			(0),
	FibS2			(0),
	FibS3			(0),
	FibS4			(0),
	DayHiTL		(0),
	DayLoTL		(0),
	FibR1TL		(0),
	FibR2TL		(0),
	FibR3TL		(0),
	FibR4TL		(0),
	FibS1TL		(0),
	FibS2TL		(0),
	FibS3TL		(0),
	FibS4TL		(0),
	DayHi			(-999999),
	DayLo			(+999999),
	HaveTLs		(false),
	HaveLevels		(false),
	StartTime		(0),
	EndTime		(0),
	DayHiTxt		(0),
	DayLoTxt		(0),	
	FibR1Txt		(0),
	FibR2Txt		(0),
	FibR3Txt		(0),
	FibR4Txt		(0),
	FibS1Txt		(0),
	FibS2Txt		(0),
	FibS3Txt		(0),
	FibS4Txt		(0),
	SessClose		(0),
	TextStyleHoriz	(0), 	//0: To the right of the bar specified for the text object
 					//1: To the left of the bar specified for the text object
 					//2: Centered on the bar specified for the text object
	TextStyleVert		(1);	//0: Beneath the price specified for the text object
					//1: Above the price specified for the text object
					//2: Centered on the specified price location of the text object
	
If IgnoreWeekends then begin
	If DayOfWeek(Date) >= Monday and DayOfWeek(Date) <= Friday then 
		Monday2Friday = true
	else 
		Monday2Friday = false;

end
else begin
	Monday2Friday = true;
end;
	
		
If Monday2Friday then begin

	If Date <> Date[1] then
		HaveLevels = false;
		
		If PlaceTextRight then 
			TextStyleVert = 1;
			
			end; //If Date <> Date[1] then begin...	

	If Time > StartCalcTime and Time <= EndCalcTime then begin
		If High >= DayHi then DayHi = High;
		If Low <= DayLo then DayLo = Low;
		If BarStatus(1) = 2 then
		SessClose = Close;
	end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...
	
	if Time > EndCalcTime and HaveLevels = false then
begin 
HaveLevels = true;

	
	If HaveTLs = false then begin
		HaveTLs = true;
		
		FibR1 = DayLo + ((DayHi - DayLo) * 2.33);
		FibR2 = DayLo + ((DayHi - DayLo) * 3.82);
		FibR3 = DayLo + ((DayHi - DayLo) * 5);
		FibR4 = DayLo + ((DayHi - DayLo) * 6.1);
		FibS1 = DayHi - ((DayHi - DayLo) * 2.33);
		FibS2 = DayHi - ((DayHi - DayLo) * 3.82);
		FibS3 = DayHi - ((DayHi - DayLo) * 5);
		FibS4 = DayHi - ((DayHi - DayLo) * 6.1);

		DayHi = -999999;
		DayLo = +999999;
		HaveTLs = false;
		
		DayHiTL = TL_New(Date, TLStartTime, DayHi, Date, TLEndTime, DayHi);
			TL_SetColor(DayHiTL, DayHiColor);
			TL_SetSize(DayHiTL, TLSize);	
			TL_SetStyle(DayHiTL, TLStyle);
			
		DayLoTL = TL_New(Date, TLStartTime, DayLo, Date, TLEndTime, DayLo);
			TL_SetColor(DayLoTL, DayLoColor);
			TL_SetSize(DayLoTL, TLSize);	
			TL_SetStyle(DayLoTL, TLStyle);
		
		FibR1TL = TL_New(Date, TLStartTime	, FibR1, Date, TLEndTime, FibR1);
			TL_SetColor(FibR1TL, FibR1Color);
			TL_SetSize(FibR1TL, TLSize);	
			TL_SetStyle(FibR1TL, TLStyle);			
		
		FibR2TL = TL_New(Date, TLStartTime	, FibR2, Date, TLEndTime, FibR2);
			TL_SetColor(FibR2TL, FibR2Color);
			TL_SetSize(FibR2TL, TLSize);	
			TL_SetStyle(FibR2TL, TLStyle);
					
		FibR3TL = TL_New(Date, TlStartTime, FibR3, Date, TLEndTime, FibR3);
			TL_SetColor(FibR3TL, FibR3Color);
			TL_SetSize(FibR3TL, TLSize);	
			TL_SetStyle(FibR3TL, TLStyle);
			
		FibR4TL = TL_New(Date, TLStartTime, FibR4, Date, TLEndTime, FibR4);
			TL_SetColor(FibR4TL , FibR4Color);
			TL_SetSize(FibR4TL , TLSize);	
			TL_SetStyle(FibR4TL , TLStyle);
					
		FibS1TL = TL_New(Date, TLStartTime, FibS1, Date, TLEndTime, FibS1);
			TL_SetColor(FibS1TL, FibS1Color);
			TL_SetSize(FibS1TL, TLSize);	
			TL_SetStyle(FibS1TL, TLStyle);
					
		FibS2TL = TL_New(Date, TLStartTime, FibS2, Date, TLEndTime, FibS2);
			TL_SetColor(FibS2TL, FibS2Color);
			TL_SetSize(FibS2TL, TLSize);
			TL_SetStyle(FibS2TL, TLStyle);
					
		FibS3TL = TL_New(Date, TLStartTime, FibS3, Date, TLEndTime, FibS3);
			TL_SetColor(FibS3TL, FibS3Color);
			TL_SetSize(FibS3TL, TLSize);
			TL_SetStyle(FibS3TL, TLStyle);
			
		FibS4TL = TL_New(Date, TLStartTime, FibS4, Date, TLEndTime, FibS4);
			TL_SetColor(FibS4TL, FibS4Color);
			TL_SetSize(FibS4TL, TLSize);
			TL_SetStyle(FibS4TL, TLStyle);
								
		DayHiTxt = Text_New(Date, TLStartTime, DayHi, "100%");
			Text_SetStyle(DayHiTxt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(DayHiTxt, DayHiColor);

		DayLoTxt = Text_New(Date, TLStartTime, DayLo, "0%");
			Text_SetStyle(DayLoTxt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(DayLoTxt, DayLoColor);
		
		FibR1Txt = Text_New(Date, TLStartTime, FibR1, "233%");
			Text_SetStyle(FibR1Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR1Txt, FibR1Color);
					
		FibR2Txt = Text_New(Date, TLStartTime, FibR2, "382%");
			Text_SetStyle(FibR2Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR2Txt, FibR2Color);
			
		FibR3Txt = Text_New(Date, TLStartTime, FibR3, "500%");
			Text_SetStyle(FibR3Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR3Txt, FibR3Color);
			
		FibR4Txt = Text_New(Date, TLStartTime, FibR4, "610%");
			Text_SetStyle(FibR4Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR4Txt, FibR4Color);
			
		FibS1Txt = Text_New(Date, TLStartTime, FibS1, "233%");
			Text_SetStyle(FibS1Txt, TextStyleHoriz, TextStyleVert);
			Text_SetColor(FibS1Txt, FibS1Color);
						
		FibS2Txt = Text_New(Date, TLStartTime, FibS2, "382%");
			Text_SetStyle(FibS2Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS2Txt, FibS2Color);
			
		FibS3Txt = Text_New(Date, TLStartTime, FibS3, "500%");
			Text_SetStyle(FibS3Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS3Txt, FibS3Color);
			
		FibS4Txt = Text_New(Date, TLStartTime, FibS4, "610%");
			Text_SetStyle(FibS4Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS4Txt, FibS4Color);
										
	end //If HaveTLs = false then begin...
	else begin
			
			TL_SetEnd(DayHiTL, Date, TLEndTime, DayHi);
			TL_SetEnd(DayLoTL, Date, TLEndTime, DayLo);
			TL_SetEnd(FibR1TL, Date, TLEndTime, FibR1);
			TL_SetEnd(FibR2TL, Date, TLEndTime, FibR2);
			TL_SetEnd(FibR3TL, Date, TLEndTime, FibR3);
			TL_SetEnd(FibR4TL, Date, TLEndTime, FibR4);
			TL_SetEnd(FibS1TL, Date, TLEndTime, FibS1);
			TL_SetEnd(FibS2TL, Date, TLEndTime, FibS2);
			TL_SetEnd(FibS3TL, Date, TLEndTime, FibS3);
			TL_SetEnd(FibS4TL, Date, TLEndTime, FibS4);
			
			If PlaceTextRight then begin
				Text_SetLocation(DayHiTxt, Date, TLEndTime, DayHi);
				Text_SetLocation(DayLoTxt, Date, TLEndTime, DayLo);
				Text_SetLocation(FibR1Txt, Date, TLEndTime, FibR1);
				Text_SetLocation(FibR2Txt, Date, TLEndTime, FibR2);
				Text_SetLocation(FibR3Txt, Date, TLEndTime, FibR3);
				Text_SetLocation(FibR4Txt, Date, TLEndTime, FibR4);
				Text_SetLocation(FibS1Txt, Date, TLEndTime, FibS1);
				Text_SetLocation(FibS2Txt, Date, TLEndTime, FibS2);
				Text_SetLocation(FibS3Txt, Date, TLEndTime, FibS3);
				Text_SetLocation(FibS4Txt, Date, TLEndTime, FibS4);
		
			end; //If PlaceTextRight then begin...
	end; //If HaveTLs then begin...

end; //If Monday2Friday then begin...

Started this thread Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

olobay,

I am sure the trendlines are plotting, but right before you plot them you reset the values
for DayHi and DayLo (DayHi = -999999 and DayLo = +999999). The trendlines are likely just out of sight. At the same point in the code you also reset the HaveTLs flag back to false. This blocks the part where the text would update to the most recent bar.

Regards,
ABCTG



olobay View Post
Thanks for the help @ABCTG. I'ts getting there but not quite. I'm having 2 issues now.

1. The DayHiTL and DayLoTL lines are not plotting.

2. The text is not plotting to the right.


Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 olobay 
Montreal
 
Experience: Intermediate
Platform: MultiCharts
Broker: DeepDiscountTrading.com
Trading: CL
Posts: 364 since Jul 2011

I really appreciate the help @ABCTG and I am learning about coding EasyLanguage. I have removed the DayHi, DayLo and HaveTL lines and it's almost there. The only thing now is that it only plots for the first day of chart and the end time of the opening range is not set correctly. I think I need to put in a line of code to tell it to stop at the end of every day but I'm afraid I don't know what. I tried this EndTime = Time[1]; but it didn't do anything, unless I put it in the wrong spot.

 
Code
Inputs:
	StartCalcTime		(0900),
	EndCalcTime		(0905),
	TLStartTime		(0900),
	TLEndTime		(1430),
	PlaceTextRight	(true),
	IgnoreWeekends	(true),
	TLSize			(1),
	TLStyle		(1),
	DayHiColor		(white),
	DayLoColor		(white),
	FibR1Color		(red),
	FibR2Color		(red),
	FibR3Color		(red),	
	FibR4Color		(red),	
	FibS1Color		(green),
	FibS2Color		(green),
	FibS3Color		(green),
	FibS4Color		(green);;
		
Variables:
	Monday2Friday		(false),
	FibR1			(0),
	FibR2			(0),
	FibR3			(0),
	FibR4			(0),
	FibS1			(0),
	FibS2			(0),
	FibS3			(0),
	FibS4			(0),
	DayHiTL		(0),
	DayLoTL		(0),
	FibR1TL		(0),
	FibR2TL		(0),
	FibR3TL		(0),
	FibR4TL		(0),
	FibS1TL		(0),
	FibS2TL		(0),
	FibS3TL		(0),
	FibS4TL		(0),
	DayHi			(-999999),
	DayLo			(+999999),
	HaveTLs		(false),
	HaveLevels		(false),
	StartTime		(0),
	EndTime		(0),
	DayHiTxt		(0),
	DayLoTxt		(0),	
	FibR1Txt		(0),
	FibR2Txt		(0),
	FibR3Txt		(0),
	FibR4Txt		(0),
	FibS1Txt		(0),
	FibS2Txt		(0),
	FibS3Txt		(0),
	FibS4Txt		(0),
	SessClose		(0),
	TextStyleHoriz	(0), 	//0: To the right of the bar specified for the text object
 					//1: To the left of the bar specified for the text object
 					//2: Centered on the bar specified for the text object
	TextStyleVert		(1);	//0: Beneath the price specified for the text object
					//1: Above the price specified for the text object
					//2: Centered on the specified price location of the text object
	
If IgnoreWeekends then begin
	If DayOfWeek(Date) >= Monday and DayOfWeek(Date) <= Friday then 
		Monday2Friday = true
	else 
		Monday2Friday = false;

end
else begin
	Monday2Friday = true;
end;
	
		
If Monday2Friday then begin

	If Date <> Date[1] then
		HaveLevels = false;
		
		If PlaceTextRight then 
			TextStyleVert = 1;
			
			end; //If Date <> Date[1] then begin...	

	If Time > StartCalcTime and Time <= EndCalcTime then begin
		If High >= DayHi then DayHi = High;
		If Low <= DayLo then DayLo = Low;
		If BarStatus(1) = 2 then
		SessClose = Close;
	end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...
	
	if Time > EndCalcTime and HaveLevels = false then
begin 
HaveLevels = true;

	
	If HaveTLs = false then begin
		HaveTLs = true;
				
		FibR1 = DayLo + ((DayHi - DayLo) * 2.33);
		FibR2 = DayLo + ((DayHi - DayLo) * 3.82);
		FibR3 = DayLo + ((DayHi - DayLo) * 5);
		FibR4 = DayLo + ((DayHi - DayLo) * 6.1);
		FibS1 = DayHi - ((DayHi - DayLo) * 2.33);
		FibS2 = DayHi - ((DayHi - DayLo) * 3.82);
		FibS3 = DayHi - ((DayHi - DayLo) * 5);
		FibS4 = DayHi - ((DayHi - DayLo) * 6.1);

		//HaveTLs = false;
		
		DayHiTL = TL_New(Date, TLStartTime, DayHi, Date, TLEndTime, DayHi);
			TL_SetColor(DayHiTL, DayHiColor);
			TL_SetSize(DayHiTL, TLSize);	
			TL_SetStyle(DayHiTL, TLStyle);
			
		DayLoTL = TL_New(Date, TLStartTime, DayLo, Date, TLEndTime, DayLo);
			TL_SetColor(DayLoTL, DayLoColor);
			TL_SetSize(DayLoTL, TLSize);	
			TL_SetStyle(DayLoTL, TLStyle);
		
		FibR1TL = TL_New(Date, TLStartTime	, FibR1, Date, TLEndTime, FibR1);
			TL_SetColor(FibR1TL, FibR1Color);
			TL_SetSize(FibR1TL, TLSize);	
			TL_SetStyle(FibR1TL, TLStyle);			
		
		FibR2TL = TL_New(Date, TLStartTime	, FibR2, Date, TLEndTime, FibR2);
			TL_SetColor(FibR2TL, FibR2Color);
			TL_SetSize(FibR2TL, TLSize);	
			TL_SetStyle(FibR2TL, TLStyle);
					
		FibR3TL = TL_New(Date, TlStartTime, FibR3, Date, TLEndTime, FibR3);
			TL_SetColor(FibR3TL, FibR3Color);
			TL_SetSize(FibR3TL, TLSize);	
			TL_SetStyle(FibR3TL, TLStyle);
			
		FibR4TL = TL_New(Date, TLStartTime, FibR4, Date, TLEndTime, FibR4);
			TL_SetColor(FibR4TL , FibR4Color);
			TL_SetSize(FibR4TL , TLSize);	
			TL_SetStyle(FibR4TL , TLStyle);
					
		FibS1TL = TL_New(Date, TLStartTime, FibS1, Date, TLEndTime, FibS1);
			TL_SetColor(FibS1TL, FibS1Color);
			TL_SetSize(FibS1TL, TLSize);	
			TL_SetStyle(FibS1TL, TLStyle);
					
		FibS2TL = TL_New(Date, TLStartTime, FibS2, Date, TLEndTime, FibS2);
			TL_SetColor(FibS2TL, FibS2Color);
			TL_SetSize(FibS2TL, TLSize);
			TL_SetStyle(FibS2TL, TLStyle);
					
		FibS3TL = TL_New(Date, TLStartTime, FibS3, Date, TLEndTime, FibS3);
			TL_SetColor(FibS3TL, FibS3Color);
			TL_SetSize(FibS3TL, TLSize);
			TL_SetStyle(FibS3TL, TLStyle);
			
		FibS4TL = TL_New(Date, TLStartTime, FibS4, Date, TLEndTime, FibS4);
			TL_SetColor(FibS4TL, FibS4Color);
			TL_SetSize(FibS4TL, TLSize);
			TL_SetStyle(FibS4TL, TLStyle);
								
		DayHiTxt = Text_New(Date, TLStartTime, DayHi, "100%");
			Text_SetStyle(DayHiTxt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(DayHiTxt, DayHiColor);

		DayLoTxt = Text_New(Date, TLStartTime, DayLo, "0%");
			Text_SetStyle(DayLoTxt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(DayLoTxt, DayLoColor);
		
		FibR1Txt = Text_New(Date, TLStartTime, FibR1, "233%");
			Text_SetStyle(FibR1Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR1Txt, FibR1Color);
					
		FibR2Txt = Text_New(Date, TLStartTime, FibR2, "382%");
			Text_SetStyle(FibR2Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR2Txt, FibR2Color);
			
		FibR3Txt = Text_New(Date, TLStartTime, FibR3, "500%");
			Text_SetStyle(FibR3Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR3Txt, FibR3Color);
			
		FibR4Txt = Text_New(Date, TLStartTime, FibR4, "610%");
			Text_SetStyle(FibR4Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibR4Txt, FibR4Color);
			
		FibS1Txt = Text_New(Date, TLStartTime, FibS1, "233%");
			Text_SetStyle(FibS1Txt, TextStyleHoriz, TextStyleVert);
			Text_SetColor(FibS1Txt, FibS1Color);
						
		FibS2Txt = Text_New(Date, TLStartTime, FibS2, "382%");
			Text_SetStyle(FibS2Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS2Txt, FibS2Color);
			
		FibS3Txt = Text_New(Date, TLStartTime, FibS3, "500%");
			Text_SetStyle(FibS3Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS3Txt, FibS3Color);
			
		FibS4Txt = Text_New(Date, TLStartTime, FibS4, "610%");
			Text_SetStyle(FibS4Txt, TextStyleHoriz, TextStyleVert);	
			Text_SetColor(FibS4Txt, FibS4Color);
										
	end //If HaveTLs = false then begin...
	else begin
			
			TL_SetEnd(DayHiTL, Date, TLEndTime, DayHi);
			TL_SetEnd(DayLoTL, Date, TLEndTime, DayLo);
			TL_SetEnd(FibR1TL, Date, TLEndTime, FibR1);
			TL_SetEnd(FibR2TL, Date, TLEndTime, FibR2);
			TL_SetEnd(FibR3TL, Date, TLEndTime, FibR3);
			TL_SetEnd(FibR4TL, Date, TLEndTime, FibR4);
			TL_SetEnd(FibS1TL, Date, TLEndTime, FibS1);
			TL_SetEnd(FibS2TL, Date, TLEndTime, FibS2);
			TL_SetEnd(FibS3TL, Date, TLEndTime, FibS3);
			TL_SetEnd(FibS4TL, Date, TLEndTime, FibS4);
			
			If PlaceTextRight then begin
				Text_SetLocation(DayHiTxt, Date, TLEndTime, DayHi);
				Text_SetLocation(DayLoTxt, Date, TLEndTime, DayLo);
				Text_SetLocation(FibR1Txt, Date, TLEndTime, FibR1);
				Text_SetLocation(FibR2Txt, Date, TLEndTime, FibR2);
				Text_SetLocation(FibR3Txt, Date, TLEndTime, FibR3);
				Text_SetLocation(FibR4Txt, Date, TLEndTime, FibR4);
				Text_SetLocation(FibS1Txt, Date, TLEndTime, FibS1);
				Text_SetLocation(FibS2Txt, Date, TLEndTime, FibS2);
				Text_SetLocation(FibS3Txt, Date, TLEndTime, FibS3);
				Text_SetLocation(FibS4Txt, Date, TLEndTime, FibS4);
		
			end; //If PlaceTextRight then begin...
	end; //If HaveTLs then begin...

end; //If Monday2Friday then begin...

Started this thread Reply With Quote
  #8 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901

See if this works. You are right, you need to reset the DayHi and DayLo variables before your next StartCalcTime arrives so this should reset them to the high/low of the first bar after StartCalcTime.

 
Code
	If Time > StartCalcTime and Time <= EndCalcTime then begin
                // Reset DayHi and DayLo to the first bar of the day high and low
                If Time[1] = StartCalcTime then begin
                    DayHi = High;
                    DayLo = Low;
                end // If Time[1] = StartCalcTime then begin
                else begin
		If High >= DayHi then DayHi = High;
		If Low <= DayLo then DayLo = Low;
		If BarStatus(1) = 2 then
		SessClose = Close;
                end; // else begin
	end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #9 (permalink)
 olobay 
Montreal
 
Experience: Intermediate
Platform: MultiCharts
Broker: DeepDiscountTrading.com
Trading: CL
Posts: 364 since Jul 2011

Thanks but the only thing that changed was that it made the opening range low (0% line) slope upwards instead of downwards. I think I need to add an end time statement somewhere.


Hulk View Post
See if this works. You are right, you need to reset the DayHi and DayLo variables before your next StartCalcTime arrives so this should reset them to the high/low of the first bar after StartCalcTime.

 
Code
	If Time > StartCalcTime and Time <= EndCalcTime then begin
                // Reset DayHi and DayLo to the first bar of the day high and low
                If Time[1] = StartCalcTime then begin
                    DayHi = High;
                    DayLo = Low;
                end // If Time[1] = StartCalcTime then begin
                else begin
		If High >= DayHi then DayHi = High;
		If Low <= DayLo then DayLo = Low;
		If BarStatus(1) = 2 then
		SessClose = Close;
                end; // else begin
	end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...


Started this thread Reply With Quote
  #10 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901



olobay View Post
Thanks but the only thing that changed was that it made the opening range low (0% line) slope upwards instead of downwards. I think I need to add an end time statement somewhere.

Here you go. Added the reset towards the very end. It will reset DayHi and DayLo when we get to the TLEndTime. Also added a couple of more checks. Copy and paste this and it should work.

 
Code
Inputs:
	StartCalcTime		(0900),
	EndCalcTime		(0905),
	TLStartTime		(0900),
	TLEndTime		(1430),
	PlaceTextRight	(true),
	IgnoreWeekends	(true),
	TLSize			(1),
	TLStyle		(1),
	DayHiColor		(white),
	DayLoColor		(white),
	FibR1Color		(red),
	FibR2Color		(red),
	FibR3Color		(red),	
	FibR4Color		(red),	
	FibS1Color		(green),
	FibS2Color		(green),
	FibS3Color		(green),
	FibS4Color		(green);;
		
Variables:
	DayBegan            (false),
	Monday2Friday		(false),
	FibR1			(0),
	FibR2			(0),
	FibR3			(0),
	FibR4			(0),
	FibS1			(0),
	FibS2			(0),
	FibS3			(0),
	FibS4			(0),
	DayHiTL		(0),
	DayLoTL		(0),
	FibR1TL		(0),
	FibR2TL		(0),
	FibR3TL		(0),
	FibR4TL		(0),
	FibS1TL		(0),
	FibS2TL		(0),
	FibS3TL		(0),
	FibS4TL		(0),
	DayHi			(-999999),
	DayLo			(+999999),
	HaveTLs		(false),
	HaveLevels		(false),
	StartTime		(0),
	EndTime		(0),
	DayHiTxt		(0),
	DayLoTxt		(0),	
	FibR1Txt		(0),
	FibR2Txt		(0),
	FibR3Txt		(0),
	FibR4Txt		(0),
	FibS1Txt		(0),
	FibS2Txt		(0),
	FibS3Txt		(0),
	FibS4Txt		(0),
	SessClose		(0),
	TextStyleHoriz	(0), 	//0: To the right of the bar specified for the text object
 					//1: To the left of the bar specified for the text object
 					//2: Centered on the bar specified for the text object
	TextStyleVert		(1);	//0: Beneath the price specified for the text object
					//1: Above the price specified for the text object
					//2: Centered on the specified price location of the text object

If (Time > StartCalcTime and Time[1] <= StartCalcTime) then
	DayBegan = True;
	
If (DayBegan) then begin	
		
	If IgnoreWeekends then begin
		If DayOfWeek(Date) >= Monday and DayOfWeek(Date) <= Friday then 
			Monday2Friday = true
		else 
			Monday2Friday = false;
	
	end
	else begin
		Monday2Friday = true;
	end;
		
			
	If Monday2Friday then begin
	
		If Date <> Date[1] then
			HaveLevels = false;
			HaveTLs = false;
			
			If PlaceTextRight then 
				TextStyleVert = 1;
				
		end; //If Date <> Date[1] then begin...	
	
		If Time > StartCalcTime and Time <= EndCalcTime then begin
			If High >= DayHi then DayHi = High;
			If Low <= DayLo then DayLo = Low;
		end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...
		
		if Time > EndCalcTime and HaveLevels = false then
		begin 
			HaveLevels = true;
	
		
		If HaveTLs = false then begin
			HaveTLs = true;
					
			FibR1 = DayLo + ((DayHi - DayLo) * 2.33);
			FibR2 = DayLo + ((DayHi - DayLo) * 3.82);
			FibR3 = DayLo + ((DayHi - DayLo) * 5);
			FibR4 = DayLo + ((DayHi - DayLo) * 6.1);
			FibS1 = DayHi - ((DayHi - DayLo) * 2.33);
			FibS2 = DayHi - ((DayHi - DayLo) * 3.82);
			FibS3 = DayHi - ((DayHi - DayLo) * 5);
			FibS4 = DayHi - ((DayHi - DayLo) * 6.1);
	
			DayHiTL = TL_New(Date, TLStartTime, DayHi, Date, TLEndTime, DayHi);
				TL_SetColor(DayHiTL, DayHiColor);
				TL_SetSize(DayHiTL, TLSize);	
				TL_SetStyle(DayHiTL, TLStyle);
				
			DayLoTL = TL_New(Date, TLStartTime, DayLo, Date, TLEndTime, DayLo);
				TL_SetColor(DayLoTL, DayLoColor);
				TL_SetSize(DayLoTL, TLSize);	
				TL_SetStyle(DayLoTL, TLStyle);
			
			FibR1TL = TL_New(Date, TLStartTime	, FibR1, Date, TLEndTime, FibR1);
				TL_SetColor(FibR1TL, FibR1Color);
				TL_SetSize(FibR1TL, TLSize);	
				TL_SetStyle(FibR1TL, TLStyle);			
			
			FibR2TL = TL_New(Date, TLStartTime	, FibR2, Date, TLEndTime, FibR2);
				TL_SetColor(FibR2TL, FibR2Color);
				TL_SetSize(FibR2TL, TLSize);	
				TL_SetStyle(FibR2TL, TLStyle);
						
			FibR3TL = TL_New(Date, TlStartTime, FibR3, Date, TLEndTime, FibR3);
				TL_SetColor(FibR3TL, FibR3Color);
				TL_SetSize(FibR3TL, TLSize);	
				TL_SetStyle(FibR3TL, TLStyle);
				
			FibR4TL = TL_New(Date, TLStartTime, FibR4, Date, TLEndTime, FibR4);
				TL_SetColor(FibR4TL , FibR4Color);
				TL_SetSize(FibR4TL , TLSize);	
				TL_SetStyle(FibR4TL , TLStyle);
						
			FibS1TL = TL_New(Date, TLStartTime, FibS1, Date, TLEndTime, FibS1);
				TL_SetColor(FibS1TL, FibS1Color);
				TL_SetSize(FibS1TL, TLSize);	
				TL_SetStyle(FibS1TL, TLStyle);
						
			FibS2TL = TL_New(Date, TLStartTime, FibS2, Date, TLEndTime, FibS2);
				TL_SetColor(FibS2TL, FibS2Color);
				TL_SetSize(FibS2TL, TLSize);
				TL_SetStyle(FibS2TL, TLStyle);
						
			FibS3TL = TL_New(Date, TLStartTime, FibS3, Date, TLEndTime, FibS3);
				TL_SetColor(FibS3TL, FibS3Color);
				TL_SetSize(FibS3TL, TLSize);
				TL_SetStyle(FibS3TL, TLStyle);
				
			FibS4TL = TL_New(Date, TLStartTime, FibS4, Date, TLEndTime, FibS4);
				TL_SetColor(FibS4TL, FibS4Color);
				TL_SetSize(FibS4TL, TLSize);
				TL_SetStyle(FibS4TL, TLStyle);
									
			DayHiTxt = Text_New(Date, TLStartTime, DayHi, "100%");
				Text_SetStyle(DayHiTxt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(DayHiTxt, DayHiColor);
	
			DayLoTxt = Text_New(Date, TLStartTime, DayLo, "0%");
				Text_SetStyle(DayLoTxt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(DayLoTxt, DayLoColor);
			
			FibR1Txt = Text_New(Date, TLStartTime, FibR1, "233%");
				Text_SetStyle(FibR1Txt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(FibR1Txt, FibR1Color);
						
			FibR2Txt = Text_New(Date, TLStartTime, FibR2, "382%");
				Text_SetStyle(FibR2Txt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(FibR2Txt, FibR2Color);
				
			FibR3Txt = Text_New(Date, TLStartTime, FibR3, "500%");
				Text_SetStyle(FibR3Txt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(FibR3Txt, FibR3Color);
				
			FibR4Txt = Text_New(Date, TLStartTime, FibR4, "610%");
				Text_SetStyle(FibR4Txt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(FibR4Txt, FibR4Color);
				
			FibS1Txt = Text_New(Date, TLStartTime, FibS1, "233%");
				Text_SetStyle(FibS1Txt, TextStyleHoriz, TextStyleVert);
				Text_SetColor(FibS1Txt, FibS1Color);
							
			FibS2Txt = Text_New(Date, TLStartTime, FibS2, "382%");
				Text_SetStyle(FibS2Txt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(FibS2Txt, FibS2Color);
				
			FibS3Txt = Text_New(Date, TLStartTime, FibS3, "500%");
				Text_SetStyle(FibS3Txt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(FibS3Txt, FibS3Color);
				
			FibS4Txt = Text_New(Date, TLStartTime, FibS4, "610%");
				Text_SetStyle(FibS4Txt, TextStyleHoriz, TextStyleVert);	
				Text_SetColor(FibS4Txt, FibS4Color);
											
		end //If HaveTLs = false then begin...
		else begin
				
				TL_SetEnd(DayHiTL, Date, TLEndTime, DayHi);
				TL_SetEnd(DayLoTL, Date, TLEndTime, DayLo);
				TL_SetEnd(FibR1TL, Date, TLEndTime, FibR1);
				TL_SetEnd(FibR2TL, Date, TLEndTime, FibR2);
				TL_SetEnd(FibR3TL, Date, TLEndTime, FibR3);
				TL_SetEnd(FibR4TL, Date, TLEndTime, FibR4);
				TL_SetEnd(FibS1TL, Date, TLEndTime, FibS1);
				TL_SetEnd(FibS2TL, Date, TLEndTime, FibS2);
				TL_SetEnd(FibS3TL, Date, TLEndTime, FibS3);
				TL_SetEnd(FibS4TL, Date, TLEndTime, FibS4);
				
				If PlaceTextRight then begin
					Text_SetLocation(DayHiTxt, Date, TLEndTime, DayHi);
					Text_SetLocation(DayLoTxt, Date, TLEndTime, DayLo);
					Text_SetLocation(FibR1Txt, Date, TLEndTime, FibR1);
					Text_SetLocation(FibR2Txt, Date, TLEndTime, FibR2);
					Text_SetLocation(FibR3Txt, Date, TLEndTime, FibR3);
					Text_SetLocation(FibR4Txt, Date, TLEndTime, FibR4);
					Text_SetLocation(FibS1Txt, Date, TLEndTime, FibS1);
					Text_SetLocation(FibS2Txt, Date, TLEndTime, FibS2);
					Text_SetLocation(FibS3Txt, Date, TLEndTime, FibS3);
					Text_SetLocation(FibS4Txt, Date, TLEndTime, FibS4);
			
				end; //If PlaceTextRight then begin...
		end; //If HaveTLs then begin...
	
	end; //If Monday2Friday then begin...

	If (Time > TLEndTime and Time[1] <= TLEndTime) then begin
		DayHi = -999999;
		DayLo = 999999;
	end; //If (Time > TLEndTime and Time[1] <= TLEndTime) then begin
end; // if DayBegan then

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on June 18, 2014


© 2024 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 - Privacy Policy - Downloads - Top
no new posts