Show Today Only - EasyLanguage Programming | futures trading

Go Back

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

Show Today Only
Started:June 20th, 2014 (11:34 PM) by olobay Views / Replies:378 / 3
Last Reply:June 21st, 2014 (10:25 AM) 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

Show Today Only

Old June 20th, 2014, 11:34 PM   #1 (permalink)
Elite Member
Futures Experience: Intermediate
Platform: MultiCharts
Broker/Data: IB Canada/IQFeed
Favorite Futures: TF, CL
olobay's Avatar
Posts: 241 since Jul 2011
Thanks: 267 given, 314 received

Show Today Only

With the generous help of @Hulk and @ABCTG, I managed to get my indicator coded like I wanted to. I would like to add a statement that when true, would only show the levels for today, the current day. I know I need to add something like If Today_Only = true, then show today else show everyday. What do I need to modify in the code to get that to work? Thanks.

	StartCalcTime		(0900),
	EndCalcTime		(0905),
	TLStartTime		(0900),
	TLEndTime		(1430),
	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);
	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);
If IgnoreWeekends then begin
		If DayOfWeek(Date) >= Monday and DayOfWeek(Date) <= Friday then 
			Monday2Friday = true
			Monday2Friday = false;
	else begin
		Monday2Friday = true;
	If Monday2Friday then begin
		If Date <> Date[1] then
			HaveLevels = false;
			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;
		end;//If Time > StartCalcTime and Time <= EndCalcTime then begin...
		if Time > EndCalcTime and HaveLevels = false then
			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.18);
			FibS1 = DayHi - ((DayHi - DayLo) * 2.33);
			FibS2 = DayHi - ((DayHi - DayLo) * 3.82);
			FibS3 = DayHi - ((DayHi - DayLo) * 5);
			FibS4 = DayHi - ((DayHi - DayLo) * 6.18);
			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,TLEndTime, DayHi, "100%");
				Text_SetStyle(DayHiTxt, 1, 1);
				Text_SetColor(DayHiTxt, DayHiColor);
			DayLoTxt = Text_New(Date, TLEndTime, DayLo, "0%");
				Text_SetStyle(DayLoTxt, 1, 1);	
				Text_SetColor(DayLoTxt, DayLoColor);
			FibR1Txt = Text_New(Date, TLEndTime, FibR1, "233%");
				Text_SetStyle(FibR1Txt, 1, 1);
				Text_SetColor(FibR1Txt, FibR1Color);
			FibR2Txt = Text_New(Date, TLEndTime, FibR2, "382%");
				Text_SetStyle(FibR2Txt, 1, 1);
				Text_SetColor(FibR2Txt, FibR2Color);
			FibR3Txt = Text_New(Date, TLEndTime, FibR3, "500%");
				Text_SetStyle(FibR3Txt,1, 1);
				Text_SetColor(FibR3Txt, FibR3Color);
			FibR4Txt = Text_New(Date, TLEndTime, FibR4, "618%");
				Text_SetStyle(FibR4Txt, 1, 1);
				Text_SetColor(FibR4Txt, FibR4Color);
			FibS1Txt = Text_New(Date, TLEndTime, FibS1, "233%");
				Text_SetStyle(FibS1Txt, 1, 1);				Text_SetColor(FibS1Txt, FibS1Color);
			FibS2Txt = Text_New(Date, TLEndTime, FibS2, "382%");
				Text_SetStyle(FibS2Txt, 1, 1);
				Text_SetColor(FibS2Txt, FibS2Color);
			FibS3Txt = Text_New(Date, TLEndTime, FibS3, "500%");
				Text_SetStyle(FibS3Txt, 1, 1);
				Text_SetColor(FibS3Txt, FibS3Color);
			FibS4Txt = Text_New(Date, TLEndTime, FibS4, "618%");
				Text_SetStyle(FibS4Txt, 1, 1);
				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);
		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

Reply With Quote

Old June 20th, 2014, 11:34 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.


Old June 21st, 2014, 12:04 AM   #3 (permalink)
Elite Member
Texas, USA
Futures Experience: Intermediate
Platform: X_TRADER Pro, Custom
Broker/Data: Nanex, IQFeed
Favorite Futures: Futures, Spreads
Hulk's Avatar
Posts: 199 since May 2014
Thanks: 478 given, 420 received

Something like this:

Under inputs add the following 2 inputs:

Then use these inputs as follows:

If (ShowHistorical OR D >= Currentdate - HistoryCutoff) then
... // all of your code goes here
basically, if you set ShowHistory to true, your indicator code will execute on all days and if you set it to false, it will only execute for the number of days specified by the HistoryCutoff input.

Reply With Quote
The following user says Thank You to Hulk for this post:

Old June 21st, 2014, 10:25 AM   #4 (permalink)
Elite Member
Futures Experience: Intermediate
Platform: MultiCharts
Broker/Data: IB Canada/IQFeed
Favorite Futures: TF, CL
olobay's Avatar
Posts: 241 since Jul 2011
Thanks: 267 given, 314 received

Thanks for the help @Hulk. It's exactly what I needed.

Reply With Quote
The following user says Thank You to olobay for this post:

Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > TradeStation > EasyLanguage Programming > Show Today Only

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
Strategies will not show.... JPx2 NinjaTrader 2 October 1st, 2013 05:41 PM
Attachments not show in browsers renvik Feedback and Announcements 3 July 23rd, 2013 10:50 PM
[Other]       Show Your Desktop! MXASJ Platforms and Indicators 5 July 17th, 2012 07:42 PM
show bid/ask indicator Jones NinjaTrader 1 May 21st, 2012 03:08 PM
Davos Tries to Show It Really Cares About the 'Other 99%' Quick Summary News and Current Events 0 January 27th, 2012 06:00 PM

All times are GMT -4. The time now is 12:17 PM.

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-22 in 0.08 seconds with 19 queries on phoenix via your IP