Welcome to the Traders Laboratory Forums.
Brokers and Data Feeds Discuss brokers and data feeds here - forex, futures, stock, options

Reply
Old 12-08-2007, 02:02 PM   #1

Join Date: Dec 2006
Location: Washington DC
Posts: 32
Ignore this user

Thanks: 19
Thanked 2 Times in 1 Post

"Rebase" function in Tradestation

I came across the following chart on a blog (it was Teresa Lo's site). I've been trying to do this in Investor RT for a few weeks now and can only get it to a ratio chart with my primary frame of reference as a line chart.

I really like how it appears that tradestation can reference the benchmark as a zero line, but I can't seem to fins anyplace else that references the "rebase" on the chart. Is that merely what the author has named the function, and if so what is the function I would be able to research in tradestation to learn more about this.

Also, if anyone knows IRT and can point out how I would be able to accomplish this on that platform I would also be grateful.

Thanks
-Derek
Attached Thumbnails
"Rebase" function in Tradestation-01-sectors.gif  
dupaski is offline  
Reply With Quote
Old 12-08-2007, 04:32 PM   #2

Join Date: Feb 2007
Location: US
Posts: 314
Ignore this user

Thanks: 86
Thanked 206 Times in 89 Posts

Re: "Rebase" function in Tradestation

Quote:
Originally Posted by dupaski »
what is the function I would be able to research in tradestation to learn more about this
Don't know anything about IRT but Rebase is not a built in function or indicator in TS. If your read T Lo, :
Quote:
The thesis is simple. Identify sectors that begin to outperform the benchmark, get on board and rotate out when the greatest fool is securely on board. Identify sectors that have been totally beaten down and buy after all the weak longs have puked.

Start with a rebased chart. In this example, the S&P 500 Index is our benchmark. We plot the nine Sector SPDRs (utilities are missing for now, because my code is out at Sean’s to fix) and look at the performance since the beginning of this year.
TS allows you to insert multiple symbols as datastreams into subgraphs in a chart (as data1, data2 ....) and you can calculate a new stream output for each data in the bottom subgraph using a baseline number from eg 1/1/07 in this case. It looks like that is what Rebase is: a simple indicator calculating a ratio starting in the new year of each data to the first trading day of the year, for each sector listed.

If you are using IRT, you just have to find out if IRT supports inserting multiple symbols into a chart and calculate the data and output that into a subgraph or a new chart.

There is no reason to do this all in one chart, it just makes it easier to see the whole picture in comparing the nine sectors listed.
thrunner is offline  
Reply With Quote
Old 12-08-2007, 11:44 PM   #3

Join Date: Dec 2006
Location: Washington DC
Posts: 32
Ignore this user

Thanks: 19
Thanked 2 Times in 1 Post

Re: "Rebase" function in Tradestation

Thank you for the response.

So the chart attached above is showing how each sector did in relation to the price of the S&P on 1/1/07?

The article seemed to indicate that crossing the 0 line showed outperformance of the S&P and I just assumed it was year to date, (i.e. a change in a sectors price was in relation to the change in the S&P day over day). In that scenario, if the index rose 1% and one of the SPDRs rose 1% over the same period it would register as a 0%.

IRT will allow for the plotting of multiple instruments on the same scale as a percentage change so I may be able to do this with that combo. It almost seems that this would be easier to do in excel.


-Derek
dupaski is offline  
Reply With Quote
Old 12-08-2007, 11:55 PM   #4

Join Date: Feb 2007
Location: US
Posts: 314
Ignore this user

Thanks: 86
Thanked 206 Times in 89 Posts

Re: "Rebase" function in Tradestation

Quote:
Originally Posted by dupaski »
IRT will allow for the plotting of multiple instruments on the same scale as a percentage change so I may be able to do this with that combo
Good luck with your efforts in IRT. Here is an example of TS code that will do this:
Code:
//A look at sector rotation, plot the nine Sector SPDRs vs base line, start at 1st of the year, changeable.
INPUTS: 
 MyDate(1070103),
 DataNum(9); // match this with number of Datastreams;  also chart limit array set at 24
 
Var:
 Num (0);
Array:
 CloseData[24] (0);
 
For Num = 1 to DataNum
begin
  If date = MyDate then CloseData[num] = Close of data(num);  // assign the start date close value
end;

If date >= MyDate then
begin	
	plot1 (Close of Data(1)/ CloseData[1] - 1, "Clo1" , Blue );
	plot2 (Close of Data(2)/ CloseData[2] - 1, "Clo2" , Cyan );
	plot3 (Close of Data(3)/ CloseData[3] - 1, "Clo3" , Red  );
	plot4 (Close of Data(4)/ CloseData[4] - 1, "Clo4" , Green );
	plot5 (Close of Data(5)/ CloseData[5] - 1, "Clo6" , DarkBlue);
	plot6 (Close of Data(6)/ CloseData[6] - 1, "Clo6" , Magenta );
	plot7 (Close of Data(7)/ CloseData[7] - 1, "Clo7" , DarkGray);
	plot8 (Close of Data(8)/ CloseData[8] - 1, "Clo8" , DarkRed );
	plot9 (Close of Data(9)/ CloseData[9] - 1, "Clo9" , DarkBrown);
end;
Sample output, top 6 symbols cut off and not shown.
Attached Thumbnails
"Rebase" function in Tradestation-ninesector-spdrs-2007-12-08_234609.png   "Rebase" function in Tradestation-ninesector-lookup2007-12-08_234640.png  
thrunner is offline  
Reply With Quote
Old 12-09-2007, 12:45 AM   #5

Join Date: Dec 2006
Location: Washington DC
Posts: 32
Ignore this user

Thanks: 19
Thanked 2 Times in 1 Post

Re: "Rebase" function in Tradestation

Thank you for your help, it was appreciated.
dupaski is offline  
Reply With Quote
Old 09-19-2008, 12:25 PM   #6

Join Date: Sep 2007
Location: Houston - Tx
Posts: 7
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: "Rebase" function in Tradestation

This is an awesome idea. I am wondering what changes do I have to make to utilize this intraday with like 2min or 5min charts and where all the sectors start together at the beginning of the day and spread from there intraday? Any help out there? Thanks
janlani is offline  
Reply With Quote
Old 09-19-2008, 01:24 PM   #7
zdo

Join Date: Nov 2007
Location: boonies
Posts: 1,349
Ignore this user

Thanks: 317
Thanked 355 Times in 256 Posts
Blog Entries: 104

Re: "Rebase" function in Tradestation

janlani,

using thrunner's code you could probably do something like
in
inputs
change
myDate(nDate) to MyTime(0930),

and change
If date = MyDate then... to
if time = MyTime

and change
If date >= MyDate then to
if time > MyTime {and barstatus(1) = 2 {if you only need it to update at end of bar}} then...

and it should take off at the opening from 'rebase'

hth

zdo
zdo is offline  
Reply With Quote
The Following User Says Thank You to zdo For This Useful Post:
janlani (09-19-2008)
Old 09-19-2008, 02:13 PM   #8

Join Date: Sep 2007
Location: Houston - Tx
Posts: 7
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: "Rebase" function in Tradestation

Awesome,
Thanks a lot zdo. I will mess with it and see what I can come up with.
janlani is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
The "Flip" Trade (support and resistance changing roles) walterw Technical Analysis 218 11-22-2011 07:01 AM
"Market Delta" Footprint for TradeStation ant Trading Indicators 117 10-08-2011 05:14 AM
"Back in 1986 Pete Steidlmayer wrote about needing to wait for the first 4.5 hrs..." Dogpile Market Profile 4 10-30-2010 04:41 PM
"Force Index Indicator" for Tradestation Soultrader Trading Indicators 11 06-01-2008 09:22 PM
"Remapping the Mind: Cognitive Therapy for Traders" Soultrader Trading Psychology 7 05-06-2008 12:50 PM

All times are GMT -4. The time now is 08:39 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.