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
LinRegArray Function
-
- Posts: 60
- Joined: 28 Dec 2007
- Has thanked: 9 times
- Been thanked: 1 time
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: LinRegArray Function
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.
-
- Posts: 60
- Joined: 28 Dec 2007
- Has thanked: 9 times
- Been thanked: 1 time
Re: LinRegArray Function
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
------------------------------------------------------------------------------------------------------
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