Porting over EasyLanguage TS Indicators  [SOLVED]

Questions about MultiCharts and user contributed studies.
ukcurrencier
Posts: 6
Joined: 09 May 2016
Has thanked: 7 times

Porting over EasyLanguage TS Indicators

Postby ukcurrencier » 09 May 2016

[Tag] TS OOEL


Good Afternoon,

Just got hold of MC (MultiCharts64 Version 9.1 Release (Build 12587)) on a lifetime licence. Ex-user of TS. I need some help in porting over an indicator I used (Currency Strength) on that platform. Its around 300 lines of code (most of this is due to the repeating of lines for 28 currency pairs).

I have read MC the FAQ but could not find any posts / guidelines to porting over indicators, I am looking for what obvious things (and approach) that need changing. As an example, the first line in the code is:

Code: Select all

Using tsdata.marketdata;
This clearly is TS specific. So little things like this.

I am hoping that the high compatibility between the two languages of EL and PL should take most of the issues. I am from an IT background so could figure most stuff out, just need a few beginning guidelines from people who may have done some porting over in the past and things to look out for.

Best Regards,
E

User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Re: Porting over EasyLanguage TS Indicators

Postby syswizard » 09 May 2016

I'll soon be porting about 10,000 lines of EL code from the old TS2000i platform....
I'll report the results of that when I get to it.

I think you will not find many statements that are not compatible.
Still, I agree with you....there should be a FAQ on this.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Porting over EasyLanguage TS Indicators

Postby TJ » 09 May 2016

Good Afternoon,
::

Code: Select all

Using tsdata.marketdata;
This clearly is TS specific. So little things like this.

I am hoping that the high compatibility between the two languages of EL and PL should take most of the issues. I am from an IT background so could figure most stuff out, just need a few beginning guidelines from people who may have done some porting over in the past and things to look out for.

Best Regards,
E
This is not EasyLanguage.

This is the new OOP extension of TS v9.


The old TS2000i codes should be easily ported with few adjustments.

ukcurrencier
Posts: 6
Joined: 09 May 2016
Has thanked: 7 times

Re: Porting over EasyLanguage TS Indicators

Postby ukcurrencier » 09 May 2016

Thank you syswizard and TJ for the reply, having searched through the forum some more - I think the key sticking points are the existence of methods in the TS code which is not supported in MC, for example:

Code: Select all

method void AnalysisTechnique_Initialized( elsystem.Object sender, elsystem.InitializedEventArgs args )
begin

sAUDCAD.COMP.Interval.ChartType = tsdata.marketdata.DataChartType.bars;
sAUDCAD.COMP.Interval.IntervalType = BarTypeLookUp();
sAUDCAD.COMP.Interval.IntervalSpan = Barinterval;
sAUDCAD.COMP.Range.Type = tsdata.marketdata.DataRangeType.bars;
sAUDCAD.COMP.Range.Bars = BarsToLoad;
sAUDCAD.COMP.Load = true;
and

Code: Select all

Method int BarTypeLookUp()
begin
If DataIntervalType.minutes = 1 then
Return Bartype
else
Switch (BarType) Begin
Case 0: Return 0;
Case 1: Return 2;
Case 2: Return 3;
Case 3: Return 4;
Case 4: Return 5;
Case 14: Return 1;
Default: Return -1;
end;
end;

Method double AvgMoPct(PriceSeriesProvider MoPrice)
Variables: double x(0), double MoPct(0);
Begin
MoPct = 0;
If MoPrice.Count > MoLength + 3 then begin
AvgMoP = 0;
For x = 0 to 2 begin
MoPct += ( MoPrice.close[x] - MoPrice.close[(MoLength) + x] )
/ MoPrice.close[(MoLength) + x];
end;
AvgMoP = MoPct * .33334;
end;
Return AvgMoP;
end;

method void Timer1_Elapsed( elsystem.Object sender, elsystem.TimerElapsedEventArgs args )
begin
Main();
end;

// Main
method void Main()
begin

value1 = Close[BarsToLoad];

If sAUDCAD.COMP.Count > MoLength + 3 then
AUDCAD.COMP = AvgMoPct(sAUDCAD.COMP);
The indicator uses smoothed momentum to produce a currency score for each of 8 currencies, what the indicator is trying to achieve I do not think is out of the realms of Powerlanguage. This allows me to make trading decsions based on relative currency strengths.

Is there anyone on this board who can help - happy to pay for your time.

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Porting over EasyLanguage TS Indicators  [SOLVED]

Postby ABC » 10 May 2016

ukcurrencier,

while you can walk around the methods, your code seems to use PriceSeries providers to load data in the background without having the need to add these as datastreams on the chart.
This is something not supported by regular Multicharts, so you would have to load each of the datastreams to a chart and reference it in the code (as Data1, Data2 etc.).

Regards,

ABC

User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Re: Porting over EasyLanguage TS Indicators

Postby syswizard » 10 May 2016


This is not EasyLanguage.

This is the new OOP extension of TS v9.

The old TS2000i codes should be easily ported with few adjustments.
I see that now. I wonder if MC has any ideas to move to support methods in the future ?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Porting over EasyLanguage TS Indicators

Postby TJ » 10 May 2016


This is not EasyLanguage.

This is the new OOP extension of TS v9.

The old TS2000i codes should be easily ported with few adjustments.
I see that now. I wonder if MC has any ideas to move to support methods in the future ?
MultiCharts took the .net route and made it a separate program.

User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Re: Porting over EasyLanguage TS Indicators

Postby syswizard » 13 May 2016

MultiCharts took the .net route and made it a separate program.
Ah....so the standard MC is compatible only up till the latest 8.x release of TS.
Good to know.
Thanks TJ !

ukcurrencier
Posts: 6
Joined: 09 May 2016
Has thanked: 7 times

Re: Porting over EasyLanguage TS Indicators

Postby ukcurrencier » 13 Jun 2016

This has been completed. I engaged the services of user ABC to write me some code.

I can highly recommend his services, delivered on time and at a competitive cost, and also is very patient with followup questions !


Return to “MultiCharts”