Beta Indicator  [SOLVED]

Questions about MultiCharts and user contributed studies.
strelow

Beta Indicator

Postby strelow » 08 Oct 2015

Hello Guys .

I´d like to use beta indicator in MC but didnt find any indicator already in the library .
Someone know where I can find a code file in easy language using this indicator ?

Thanks.

http://www.wikihow.com/Calculate-Beta

strelow

Re: Beta Indicator  [SOLVED]

Postby strelow » 11 Oct 2015

Someone know how put a instument like a second variable

Code: Select all

inputs:

DependentVal(Close),{Instrument in Study}
IndependentVal(close),{Index}
Len(133),

UpColor( green ),
DnColor( Red ),
AtenColor (yellow);

vars:
Dependent(0),
Independent(0),
Ind("$IBOV(Close)"),{<<<< how can I do correct this parts ?}
Beta(0);


Dependent=((DependentVal-DependentVal[1])/DependentVal[1]);

{Independent=((IndependentVal[0]-IndependentVal[1])/IndependentVal[1]);{Index}}

Independent=((Ind[0]-Ind[1])/Ind[1]);{Index}

Beta=(Covar(Independent,Dependent,Len))/VarianceP(Independent,Len);

Plot1(Beta ,"Beta");
Plot2(Dependent ,"Dependent");
Plot3(Independent ,"Independent");


if Beta < 1 then
SetPlotColor( 35, UpColor )
else SetPlotColor( 5, DnColor ) ;

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

Re: Beta Indicator

Postby JoshM » 18 Oct 2015

Someone know how put a instument like a second variable

Code: Select all

(...)
Ind("$IBOV(Close)"),{<<<< how can I do correct this parts ?}
(...)
In MultiCharts (PowerLanguage edition) you cannot load a data series programmatically like what you're trying to do here.

What you can do, is adding a data series to the chart with CommandLine() and the `.isy` Command Line command. Then you can reference data2 (or which every data series that new symbol becomes) in your code.


Return to “MultiCharts”