Lsma

 

What is an LSMA? It stands for Least Squares Moving Average and the indicator plots the endpoint of the linear regression line. By comparing the current value to the prior value a determination is made of a possible trend, ie the linear regression line is pointing up or down.

Use the close of the current candle after it is finished and the next candle is forming as the end point. That avoids the problem of a candle changing the value of the indicator in real time.

Files:
 

LSMA with CCI

I am posting a chart showing the use of Lsma to confirm entry defined by CCI..

using 3 Lsma 6 14 25.. enter when green for long, red for short and out when lsma changes to yellow...

Files:
 

LSMA is LR?

forexts:
What is an LSMA? It stands for Least Squares Moving Average and the indicator plots the endpoint of the linear regression line. By comparing the current value to the prior value a determination is made of a possible trend, ie the linear regression line is pointing up or down. Use the close of the current candle after it is finished and the next candle is forming as the end point. That avoids the problem of a candle changing the value of the indicator in real time.

Is LSMA = Linear Regression? I understand the concept of least squares when fitting an average line, but had not heard it referred as a moving average. I tried this code and got a Linear Regression line that seemed to make the same basic movements as my control (a LR line off of a charting system I pay for). But on the paid version, the peaks of the LR go higher (& lower), often above and below the bollinger bands, while on this version, that effect is much more subdued.

Any ideas why I am seeing this behaviour, or where else I might get an algorithm for LR for MetaQuotes4?

 

Lsma

I removed the LSMA from my chart... I am trading using the indicator(CCI) almost exclusively... that is working much better...

I found that the extra indicators were a bit confusing....

 

LSMA reason

Hi Blaiserboy:

Thanks for the info / post, but I doindeed need a good linear regression algorithm or mq4 program. Although I do use CCI, I prefer Linear Regression in combo with the bolliger bands for trading.

Also, it is a task I need to complete for others.

What struck me strange about the LSMA is that I had not read that LR is a MA calculation, although I do understand the concept of an algorithm to find a line that matches a 2 dimensional set of points best using the least squares method. I'd never seen indicator lines plotted in 3 colours

I am a long-term C/C++ programmer in Windows with Visual Studio, but using mq4 is new to me and, despite being very C-like, not having a good IDE to learn in is stunting my progress a bit.

So... does anyone else have any input on a different Linear Regression alorithm, or how I might tweak this one?

Thank you all,

-Derk

 

I am not a programmer..... well, I did study it at college many moons ago. but I certainly have no skill with it..... LOL

I suggest. that if you have no luck here. that you post your request to the metatrader group in Yahoo. there may be someone there who can assist

here is the URL

http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/

good luck with your venture..!!!!

 

Cci

Blaiserboy:

Thanks for the link. After all that I went and looked at the CCI / LSMA chart you posted. Interesting... when I use CCI it is not overlaid on the graph.

Would you mind giving me an explanation of what parameters you use and what you are looking for -it looks promising.

-Derk

 

I use CCI 14 I have stopped using the turbo CCI 6

I am trading ghost patterns and zlr's and tlb's... nothing complicated... but aggressive...

and doing this, I find that I need mainly the CCI 14 not a lot more as I am trading with trend and counter trend....

I use a tight stop....

none of this may be satisfactory to you...

for further info. have a look at Woodie's site. there is a pile of very valuable info in there.....

http://www.woodiescciclub.com/start.htm

there are as many methods as there are traders.... I have failed at many things until I got to know the indicator well enough and most of what I do is probably hard to define and also wrong in many people's eyes. I guess I progressed the most by practise trading for a gazillion hours...

 
Blaiserboy:
there are as many methods as there are traders.... I have failed at many things until I got to know the indicator well enough and most of what I do is probably hard to define and also wrong in many people's eyes. I guess I progressed the most by practise trading for a gazillion hours...

I know the feeling...

I'm also on the slow path of learning indicators one by one.

Thanks for all your responses.

 

How would one program an EA to take trades using LSMA? As far as i know it isn't a default MA built into MT4.

Thanx,

Graham

 

LSMA indicator

Hello Derk,

I will be starting a new thread shortly on LSMA and will be posting indicators and experts related to LSMA on the first few posts.

LSMA as a moving average is based on plotting the end point of the linear regression line. I have versions that I need to find that also use other forms of straight line fit using hyperbolic, exponention, power and parabolic fit. This was someting I worked on for an auto emisions test lab back in 1978 and wrote in BASIC+II for a PDP 11.

I did find that straigt line worked best.

DerkWehler:
Hi Blaiserboy:

Thanks for the info / post, but I doindeed need a good linear regression algorithm or mq4 program. Although I do use CCI, I prefer Linear Regression in combo with the bolliger bands for trading.

Also, it is a task I need to complete for others.

What struck me strange about the LSMA is that I had not read that LR is a MA calculation, although I do understand the concept of an algorithm to find a line that matches a 2 dimensional set of points best using the least squares method. I'd never seen indicator lines plotted in 3 colours

I am a long-term C/C++ programmer in Windows with Visual Studio, but using mq4 is new to me and, despite being very C-like, not having a good IDE to learn in is stunting my progress a bit.

So... does anyone else have any input on a different Linear Regression alorithm, or how I might tweak this one?

Thank you all,

-Derk
Reason: