NexusFi: Find Your Edge


Home Menu

 





Seasonality Indicator


Discussion in MultiCharts

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




 
Search this Thread

Seasonality Indicator

  #1 (permalink)
 CharlieTrader 
London
 
Experience: Advanced
Platform: MultiCharts
Trading: Global Futures
Posts: 6 since Apr 2016
Thanks Given: 2
Thanks Received: 0

Hello guys,

i am struggling to make this seasonality indicator from TradeStation work in MC. The code is a step beyond my average at best coding abilities.

I am getting an error message which is pointing towards the "SData(Null)" in the second line of the code. Any help would be great fully received. The indicator basically looks at the last 5 years of historical data on a weekly basis and plots the expected seasonal trend over the coming weeks and months.



Inputs: YearsToConsider(5);
vars: elsystem.collections.Vector SData(null), int Elements(0), int X(0),
OKToStart(FALSE), int CurYear(0), int CurPeriod(0), int YearCount(0),
double TempVal(0), double TempPerf(0), FirstYear(0), CumPerf(0);

method void AnalysisTechnique_Initialized( elsystem.Object sender, elsystem.InitializedEventArgs args )
begin
SData = New elsystem.collections.Vector ;
If Bartype = 3 then Elements = 52;
If Bartype = 4 then Elements = 12;

For X = 1 to Elements begin
SData.insert(0,0.0);
end;
FirstYear = year(currentdate) - (YearsToConsider);
end;

CurYear = year(date);
If CurYear >= FirstYear AND Bartype >= 3 AND LastBarOnChart = FALSE then begin

If CurYear <> CurYear[1] then begin
OKToStart = True;
CurPeriod = 0;
YearCount += 1;
CumPerf = 0;
end;

If OKToStart = True then begin
If Elements = 52 and CurPeriod > 51 then CurPeriod = 51;

TempVal = SData[CurPeriod] astype double;
TempPerf = (Close - Close[1]) / Close[1];
SData[CurPeriod] = TempVal + TempPerf;

If YearCount = YearsToConsider then begin
CumPerf = CumPerf + SData[CurPeriod] astype double / (YearCount - 1);
Plot1[-Elements](CumPerf, "Seasonal");
end;
end;

If Year(Date) <> Year(date[1]) then begin
Value1 = TL_New(Date, time, High, Date, TIme , Low);
TL_setextleft(Value1, TRUE);
TL_setextright(Value1, TRUE);
end;
CurPeriod += 1;
end;

Attached Files
Elite Membership required to download: TSL.SEASONAL STUDIES.ELD
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

CharlieTrader,

the code uses OOEL parts that are not available in Multicharts. You'd have to replace the vector with an array (or an Easylanguage Collection list if you prefer) and remove the method. The latter can just be replaced with a "once begin... end;" statement. The code for the vector replacement will depend on your decision to use an array or a list.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 Fibonacci 
Munich/Bavaria
 
Experience: Advanced
Platform: TS
Trading: none
Posts: 6 since Jun 2010
Thanks Given: 2
Thanks Received: 0


Hi,
is there any open script solution for free or to buy for MC?
Thanks

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

Fibonacci,

the code posted in #1 is open and free, it just needs slight modifications (as described in post #2) to make it work in MC.
If you are looking for recommendations, it might help if you describe what you want the study to do exactly.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #5 (permalink)
 Fibonacci 
Munich/Bavaria
 
Experience: Advanced
Platform: TS
Trading: none
Posts: 6 since Jun 2010
Thanks Given: 2
Thanks Received: 0

ABCTG,

thanks for your fast reply.

First of all I want to use it with MC, I use TS as well and I know that it works,
but the modifications required are also beyond my programing skills.

Regards,
Fibonacci

Reply With Quote




Last Updated on December 25, 2016


© 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