Page 1 of 1

LinRegArray Function

Posted: 17 Jun 2012
by wall richard
MC has a function capable of taking array data and preforming a linear regulation on the data. It's name is LinRegArray. Unfortunately MC does not list a matching indicator for this function. I have unsuccessfully tried to code an indicator. I cannot find any MC information on how to code this indicator.

Anyone familiar with an indicator for this function or know how to locate one?

Thanks,

Richard

Re: LinRegArray Function

Posted: 19 Jun 2012
by Henry MultiŠ”harts
This question has been already answered during the live chat session. Richard, you can post your study here if you would like to share it with the community.

Re: LinRegArray Function

Posted: 19 Jun 2012
by wall richard
Katrin furnished the solution.

------------------------------------------------------------------------------------------------------

Input: PriceValueArray(100), Size(10) , TgtPos(0), OLRSlope(0), OLRAngle(0), OLRIntercept(0), OLRValueRaw(0);

Var: X(0), var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4(0), var5(0) , var6(0);

Array: ARR[100](0);

For X = 20 downto 1 begin
Arr[X] = C[X-1];
End;

Value1 = LinRegArray(ARR, Size, TgtPos, var3,var4,var5,var6);

Plot1[0](var6,"");

--------------------------------------------------------------------------------------------------------------

The advantage is being able to manipulate data in an array then plot your results. You cannot manipulate data in a variable the same way. Example: In MyVariable[1] you cannot go back and change the value. In arrays you can change the value of any element anywhere at any time.

Richard