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
Beta Indicator [SOLVED]
Re: Beta Indicator [SOLVED]
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 ) ;
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Beta Indicator
In MultiCharts (PowerLanguage edition) you cannot load a data series programmatically like what you're trying to do here.Someone know how put a instument like a second variable
Code: Select all
(...)
Ind("$IBOV(Close)"),{<<<< how can I do correct this parts ?}
(...)
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.