Making moving from MC to MC.net easier

Questions about MultiCharts and user contributed studies.
bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Making moving from MC to MC.net easier

Postby bowlesj3 » 22 Jul 2017

Hi, I have gotten curious about MC.net mainly because I know VBA (visual basic for applications) much better than I know PowerLanguage and secondly because MC.net has a debugger. So here are two questions.

Q1: Does the MC.net use the backward reference to tables as the MC power language does. To me this backwards reference of tables is a stroke of genius in thinking for traders and I have gotten use to it even after many years of thinking of forward reference as a regular programmer.

Q2: Is there a documentation guide for converting regular MC power language scripts over to MC.net scripts. Maybe I should be open minded and ask the reverse question :-)

If MC.net does use a backwards reference to tables I guess it would make sense to download MC.net for a month (time permitting) to compare original MC built in scripts to MC.net scripts as a learning tool.

John

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Making moving from MC to MC.net easier

Postby JoshM » 23 Jul 2017

Q1: Does the MC.net use the backward reference to tables as the MC power language does. To me this backwards reference of tables is a stroke of genius in thinking for traders and I have gotten use to it even after many years of thinking of forward reference as a regular programmer.
I don't know what a 'backward reference table' is and how it compares to a 'forward reference'. But the PowerLanguage .NET Editor does have a 'Help Contents' tab with basic information about the code elements like a reference would have:
2017-07-23_06-59-34.png
(28.61 KiB) Downloaded 480 times
Q2: Is there a documentation guide for converting regular MC power language scripts over to MC.net scripts. Maybe I should be open minded and ask the reverse question :-)
To my knowledge there isn't such a guide.

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: Making moving from MC to MC.net easier

Postby bowlesj3 » 23 Jul 2017

Thanks JoshM. Your picture helps me get an idea of what .net is all about. It is a programming concept for sure. I realize this since I saw a lot of this when I learned to program websites 2 years ago.

Backwards reference is my terminology actually. It means that the subscript (or index if you will) points from the end of the table to the back of the table rather than from the beginning of the table to the end of the table. In other words [X] means X number of bars back, It makes perfect sense for traders since we are on the current bar at all times (the real time bar). Did you notice I said WE :-) For we traders everything should relate to this real time bar (the last bar on the chart). So I can simplify the question to this "Does MC.net have a close[2] function that means get the close 2 bars back from the current real time bar?".

By the way, I suspect that Close[2] is a function that has an algorithm built in that converts the backward reference in the traders mind to a forward reference to a rolling table in the programming world. The table rolls around the MaxBarsBack size. It is a theory. The MC programmers would know if I am correct. I would really love to hear one say "Hey John, you nailed it" :-)
Last edited by bowlesj3 on 23 Jul 2017, edited 1 time in total.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Making moving from MC to MC.net easier

Postby JoshM » 23 Jul 2017

Backwards reference is my terminology actually. It means that the subscript (or index if you will) points from the end of the table to the back of the table rather than from the beginning of the table to the end of the table. In other words [X] means X number of bars back, It makes perfect sense for traders since we are on the current bar at all times (the real time bar). Did you notice I said WE :-) For we traders everything should relate to this real time bar. So I can simplify the question to this "Does MC.net have a close[2] function that means get the close 2 bars back from the current real time bar?".
Oh I see. Yes MultiCharts .NET does have backwards reference. For instance, `Bars.Close[2]` returns the closing price from 2 bars ago, `Bars.High[10]` the price from 10 bars ago, and `BarsOfData(2).Low[5]` would give the low price 5 bars ago for the second data series.
The table rolls around the MaxBarsBack size.
How MultiCharts and MultiCharts .NET work with MaxBarsBack size -- and any other MultiCharts feature for that matter -- is exactly the same. So there's nothing new to learn there luckily. :)

If you already know Visual Basic, then you "only" have to learn how MultiCharts .NET maps to MultiCharts. Like that `Bars.Close[1]` gives the closing price of the previous bar, instead of just `Close[1]` as we use in PowerLanguage.

(I put the "only" in quotes because there's of course a learning curve that can be difficult at times, and I don't want to downplay that. But if you already know the programming language and the MultiCharts platform, you have a big advantage over people completely new to MultiCharts .NET.)

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: Making moving from MC to MC.net easier

Postby bowlesj3 » 23 Jul 2017

Hi JoshM.

Thanks so much for explaining that. It sounds like it might not be too hard to convert my old MC code to MC.net code. I guess there is no actual guide for converting code. It is simple and you just created it :-) Having said that it would be cool to have a utility that took a shot at it. I am getting lazy in my old age :-) A grumpy old man grumping about debugging with those print statements...lol.

Regarding learning curve I am crazy enough to have learned various amounts of 17 programming languages :-) so I might just be crazy enough to learn another one :-)

John


Return to “MultiCharts”