NexusFi: Find Your Edge


Home Menu

 





Seasonality charts


Discussion in ThinkOrSwim

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




 
Search this Thread

Seasonality charts

  #1 (permalink)
 meyer99 
Charlotte NC
 
Experience: Advanced
Platform: Charts:TOS, execution:TOS
Broker: TOS
Trading: SPX, RUT. TQQQ, Stocks, /YM
Posts: 234 since Jul 2009
Thanks Given: 99
Thanks Received: 122

This code will plot different years of price action in the same screen using EOD data. This is an approximation. f you find a way to make the data more accurate please post.


plot LastYear = close[252];
plot TwoYearsAgo = close [2 * 252];
plot ThreeYearsAgo = close [3 * 252];
plot FourYearsAgo = close [4 *252];
plot FiveYearsAgo = close [5 * 252];
plot CombinedAvg = (LastYear + TwoYearsAgo +ThreeYearsAgo + fourYearsAgo + fiveYearsAgo) / 5;
CombinedAvg.SetDefaultColor(color.LIME);

def today = GetLastDay() == GetDay();

AddChartBubble(today, LastYear, "LY", Color.white);
AddChartBubble(today, TwoYearsAgo, "2Ya", Color.white);
AddChartBubble(today, ThreeYearsAgo, "3Ya", Color.white);
AddChartBubble(today, FourYearsAgo, "4Ya", Color.white);
AddChartBubble(today, FiveYearsAgo, "5Ya", Color.white);



To make it easier to read I run same idea with a 5 day SMA instead of EOD prices. I hope it helps.



input AvgLength = 5;
plot ThisYear = Average(close, AvgLength);
ThisYear.SetDefaultColor(Color.WHITE);
plot LastYear = Average(close[252], AvgLength);
LastYear.SetDefaultColor(Color.CYAN);
plot TwoYearsAgo = Average(close[2 * 252], AvgLength);
TwoYearsAgo.SetDefaultColor(Color.PINK);
plot ThreeYearsAgo = Average(close[3 * 252], AvgLength);
ThreeYearsAgo.SetDefaultColor(Color.LIGHT_GRAY);
plot FourYearsAgo = Average(close[4 * 252], AvgLength);
FourYearsAgo.SetDefaultColor(Color.YELLOW);
plot FiveYearsAgo = Average(close[5 * 252], AvgLength);
TwoYearsAgo.SetDefaultColor(Color.RED);

plot CombinedAvg = ( LastYear + TwoYearsAgo +ThreeYearsAgo + fourYearsAgo + fiveYearsAgo) / 5;
CombinedAvg.SetDefaultColor(color.LIME);

def today = GetLastDay() == GetDay();

AddChartBubble(today, CombinedAvg, "Avg", Color.LIME);
AddChartBubble(today, LastYear, "LY", Color.white);
AddChartBubble(today, TwoYearsAgo, "2Ya", Color.white);
AddChartBubble(today, ThreeYearsAgo, "3Ya", Color.white);
AddChartBubble(today, FourYearsAgo, "4Ya", Color.white);
AddChartBubble(today, FiveYearsAgo, "5Ya", Color.white);

Attached Thumbnails
Click image for larger version

Name:	Seasonality TOS.JPG
Views:	235
Size:	132.2 KB
ID:	154109  
Started this thread Reply With Quote




Last Updated on August 25, 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