NexusFi: Find Your Edge


Home Menu

 





Seasonality Indicator


Discussion in MultiCharts

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




 
Search this Thread
  #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?
April 2026 Jobs Report: +115k vs +65k Expected
Traders Hideout
Warsh Rate Hike at 40%, Iran June 15 Expires Tonight at …
Prediction Markets & Event Contracts
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
Warsh Opens Today, Hormuz June 19 -- WTI Below $80, Fran …
Prediction Markets & Event Contracts
Hormuz Surges From 14% to 26.5% Intraday as Irans Answer …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
16 thanks
Darmok and Jalad at Tanagra
3 thanks
CME Expands 24/7 Trading to WTI Crude Oil and Gold -- We …
1 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

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 X 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,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

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 X 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


© 2026 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 - Downloads - Top
no new posts