Page 1 of 1

Methods, Subroutines ?????

Posted: Aug 18 2011
by skan
Hello
How can I code subroutines on Multicharts?
I need to reuse part of my code several times.

Somebody advised me to you use something like:

Code: Select all

Method double Subroutine1(double dou) begin
if t=1200 then Buy this bar;
Return dou*2;
end;
value1=Subroutine1(c);
setexitonclose;
But I could find any documentation on "method".

Can I use sell and buy orders within the subroutine?, How do I invoke it?

Re: Methods, Subroutines ?????

Posted: Aug 18 2011
by arjfca
Hello Skan

You could code your routine in a function. It will have the same result as a sub-routine. As example, you could open any function in your editor and see how it is designed.

Martin

Re: Methods, Subroutines ?????

Posted: Aug 19 2011
by rondot samuel ws
Hi,

I think you can pout order only in strategy, not in function.

So, in the example given initialy with a "Buy oder", function is not possible

In my opinion, there is no solution for making a "subroutine" with order inside.

Order are possible only in Strategy

Laurent
Hello Skan

You could code your routine in a function. It will have the same result as a sub-routine. As example, you could open any function in your editor and see how it is designed.

Martin

Re: Methods, Subroutines ?????

Posted: Aug 19 2011
by skan
That's why I was advised to use "method"
Where can I find info on this command?

Re: Methods, Subroutines ?????  [SOLVED]

Posted: Aug 20 2011
by rondot samuel ws
You right.

Seems to be really new. never heard before.

Powerlanguage editor : (MC 7.0 last relase)
type method, hit F1 :

Method
Supported by PowerLanguage.
A detailed description and usage examples will be presented in the documentation accompanying the next release of MultiCharts.

Hope MC support will answer you...




That's why I was advised to use "method"
Where can I find info on this command?