@power

Questions about MultiCharts and user contributed studies.
waldem
Posts: 108
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

@power

Postby waldem » 03 Sep 2015

hallo all, someone could tell me the explanation of @power function?
i cannot find any wiki..
thank you

User avatar
TJ
Posts: 7227
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2056 times

Re: @power

Postby TJ » 03 Sep 2015

hallo all, someone could tell me the explanation of @power function?
i cannot find any wiki..
thank you
Where do you find this @power function?

waldem
Posts: 108
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

Re: @power

Postby waldem » 04 Sep 2015

hi TJ, I found it in Kaufman AMA:

Code: Select all

[LegacyColorValue = TRUE];

inputs:period(10),price(c);
vars: noise(0),signal(0),difference(0),efratio(0),
smooth(1),fastend(.666),slowend(.0645),AMA(0);

{CALCULATE EFFICIENCY RATIO}
difference = @AbsValue(price - price[1]);
if(currentbar <= period) then AMA = price;
if(currentbar > period)then begin
signal = @AbsValue(price - price[period]);
noise = @Summation(difference,period);
efratio = signal/maxlist (noise,0.1);
smooth = @Power(efratio*(fastend - slowend) + slowend,2);
{ADAPTIVE MOVING AVERAGE}
ama=ama[1]+smooth*(price-ama[1]);
plot1(ama,"ama");
end;
you can see @AbsValue, @Summation, @Power...

as far i understood seems math expression that raise the number to the exponent:
http://www-01.ibm.com/support/knowledge ... POWER.html

Interesting is that MC have some command inside without any explanation in wiki page :).
i think i solved anyway.

User avatar
ABC
Posts: 634
Joined: 16 Dec 2006
Has thanked: 120 times
Been thanked: 358 times
Contact:

Re: @power

Postby ABC » 04 Sep 2015

waldem,

they are documented when you leave the "@" away - except the Summation, which is a function and therefore not included in the help. I am not sure why the reserved words are also working with an "@" in front, as this is not legacy EasyLanguage. So it's probably some idiosyncrasy of the PL Editor.

Regards,
ABC

User avatar
TJ
Posts: 7227
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2056 times

Re: @power

Postby TJ » 04 Sep 2015

hi TJ, I found it in Kaufman AMA:

you can see @AbsValue, @Summation, @Power...

as far i understood seems math expression that raise the number to the exponent:
http://www-01.ibm.com/support/knowledge ... POWER.html

Interesting is that MC have some command inside without any explanation in wiki page :).
i think i solved anyway.
This must be a very old code.

The @ prefix is a skip word.

This is a legacy tradition: Many years ago programmers attach the @ prefix in front of functions to distinguish them from keywords and variables.
(note: the old TS editor was not color coded, reading script was not as easy as today. Adding the @ prefix helps with the reading of the codes. It does not serve any other purposes.)


You can safely remove the @.


Return to “MultiCharts”