Yes, you are right the proper name should probably be called linear regression value or like you said linear regression, it is called by some people me included Lsma (Least square moving average), what is the correct name I have no idea. As far as removing the repainting not sure %100 if the original was repainting saw something in the code that looked like it might be but know the version, I posted isn't repainting. Anyone can place this version alongside a regular adx and see the smoothing, but in the future will try and include more information when posting. Below a simplified formula for lsma or linear regression value, this was revealed awhile back think it was on the mt5 forum.moey_dw wrote: Sun Sep 25, 2022 8:55 pm thank u transparenttrader i was going to ask this too...... seriously wish more info was provided or NOTED here sometimes cos here i was thinking "LR" was linear regression or something
thanks mrtools for making it non-repainting & pls if in future its possible to explain what these advanced indicators do or any info would be so good for my sanity![]()
Code: Select all
lsma[i] = 3.0*iMA(_Symbol,_Period,LSMAPeriod,0,MODE_LWMA,LSMAPrice,i)-2.0*iMA(_Symbol,_Period,LSMAPeriod,0,MODE_SMA,LSMAPrice,i);
Could have used this in the above adx using iMAOnArray but it would have required an extra loop in the code and 3 more buffers. Mladen created a function that makes this whole thing easier, faster and uses less buffers, which I used in the above indicator code. Apologize for not providing more information, and hopefully this explanation helps.