Converting Ninjascripts to MC.NET  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
CrazyNasdaq
Posts: 301
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 88 times
Been thanked: 85 times

Converting Ninjascripts to MC.NET

Postby CrazyNasdaq » 01 Aug 2012

Hi, I'm new to netframework programming an to C# so this is a new interesting journey for me.
I've a question about this.
Are NT scripts compatible and avaliable on MC.NET
If it's true, much work already done on NT can be migrated to MC.NET.
Regards

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2944 times

Re: Ninjascripts on MC.NET

Postby Henry MultiСharts » 01 Aug 2012

Hello CrazyNasdaq,

NT scripts are not compatible with MultiCharts .Net.
You can use the same logic but the reserved words are different.

TonyB
Posts: 26
Joined: 24 Mar 2012
Has thanked: 10 times
Been thanked: 5 times

Re: MC.Net vs regular MC comparison list

Postby TonyB » 04 Aug 2012

With MC EL / PL, one of the cool virtues of it has been the ability to leverage the many years of coding generated from TS gurus.

With respect to MC .NET, is there something comparable? As an example, will users of MC .NET be able to use code from let's say NT just as easily?

For those of us who are not programmers, and might not be willing or able to dedicate the time to such a learning curve, it would be very helpful to know that such access is available...

User avatar
TJ
Posts: 7353
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 993 times
Been thanked: 2099 times

Re: Converting Ninjascripts to MC.NET

Postby TJ » 04 Aug 2012

For the inquisitive minds,

here are the codes of
SMA from NT, and the
Moving Average 3 Lines from MC.net.


The experts can give a rundown on each.
Attachments
Mov_Avg_3_lines_NET.txt
(4.18 KiB) Downloaded 612 times
SMA_Ninja.txt
(6.29 KiB) Downloaded 588 times

TonyB
Posts: 26
Joined: 24 Mar 2012
Has thanked: 10 times
Been thanked: 5 times

Re: Converting Ninjascripts to MC.NET

Postby TonyB » 04 Aug 2012

TJ, thank you for moving my post to this more appropriate discussion. My apologies. My question was somewhat more general I suppose, inquiring if there was some likely, natural conversion such as TS has been for MC...

One that I know many would like to see is Market / Volume Profile. If indeed Ninjasripts can be easily ported-over to MC.NET, that would be awesome. Might the GOM Market Profile indicator be something we can expect?

Mostly curious if MC .NET has an analogous platform that it can leverage that TS has been for the original MC...

User avatar
4trading
Posts: 50
Joined: 29 Jun 2010
Location: Texas
Has thanked: 26 times
Been thanked: 3 times

Re: Converting Ninjascripts to MC.NET

Postby 4trading » 04 Aug 2012

For the inquisitive minds,

here are the codes of
SMA from NT, and the
Moving Average 3 Lines from MC.net.

The experts can give a rundown on each.
Fewer lines of code to accomplish the same thing strikes me as better and more efficient. But I'm not an expert programmer. So MC .NET wins out here vs. NT IMHO.

riverTrader
Posts: 64
Joined: 15 Aug 2011
Has thanked: 3 times
Been thanked: 50 times

Re: Converting Ninjascripts to MC.NET  [SOLVED]

Postby riverTrader » 04 Aug 2012

How to reply. I doubt you'll ever have an automated conversion; the libraries and conventions are enough different it would make it quite difficult if not impossible.

The easiest thing to do in my experience is to create a new indicator project (eg copy movAvg_1line) -- pick a built-in indicator most like the one you are trying to convert.

Paste in the NS code at the top; select it all and then comment it out.
now, go through each line in the script, and delete any line that is not applicable (most); what you are left with is a block of text at the top that is not implemented in the new indicator

Code: Select all

//Add(new Plot(Color.Orange, "SMA"));
//Overlay = true;
// double last = Value[1] * Math.Min(CurrentBar, Period);
// if (CurrentBar >= Period)
// Value.Set((last + Input[0] - Input[Period]) / Math.Min(CurrentBar, Period));
// else
// Value.Set((last + Input[0]) / (Math.Min(CurrentBar, Period) + 1));
basically, that you want to plot in orange, and instructions on how to construct the moving average. Now, look below in your scratch mc.net indicator and see what you need to do to implement. Generally it is going to be really easy to see what you need to do, although some of the syntax/reserved words will be different.

After you get going if it takes you any longer than a few minutes to convert each ninjaScript I would be surprised.

User avatar
TIKITRADER
Posts: 84
Joined: 17 Jun 2009
Location: USA
Has thanked: 55 times
Been thanked: 13 times

Re: Converting Ninjascripts to MC.NET

Postby TIKITRADER » 04 Aug 2012

Thanks rivertrader for all of your informative posts regarding mc.net

TonyB
Posts: 26
Joined: 24 Mar 2012
Has thanked: 10 times
Been thanked: 5 times

Re: Converting Ninjascripts to MC.NET

Postby TonyB » 04 Aug 2012

riverTrader, yes, thank you. I am encouraged by your post. I hope that in the few weeks we can see some popular NT indicators, like the aforementioned GOM Mkt Profile, come to life in MC.NET....


Return to “MultiCharts .NET”