Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/27/2006(UTC) Posts: 135
|
Hello all great guys in foorum. I have some questions regarding regression line. Metastock allows drawing of regression line on chart manual. However is it possible to do a scanning using regression line? For instance scan for stocks which the (1) last 50 bars regression line is rising and (2) determine the angle of regression line relative to a zero line.
Tks.
Frexi
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/27/2006(UTC) Posts: 135
|
Hi Jose, tks for your super code. It works. I have some questions:
1) I can't locate the part of the code that identify the slope which can be use to scan for rising or falling stocks. Since slope is indicative of steepest of line, it can to be use as a reference of the line angle. Can it be converted to angle using the tan function?
2) Can I directly use the LRT function (For plotting regression line) for scanning purpose. For instance reference it using fml in the scan code for measuring spread of data? Can the following be used to measure the spread of data around the linear regression line >> Sum(Power(C - Fml("LRT"),2), 63)
Tks!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
Flexi wrote:1) I can't locate the part of the code that identify the slope which can be use to scan for rising or falling stocks. Since slope is indicative of steepest of line, it can to be use as a reference of the line angle. Can it be converted to angle using the tan function?
Visual slope of any indicator is relative to the compression of the chart. On a highly compressed chart (say, 2 years' data on display) you will get steep plot angles, but the same chart displaying only a few bars will make the plot look a lot more shallow.
The only plot angle absolutes are 0° & 90°, and even those extreme angle boundaries are not possible. Anything else in between is arbitrary.
Anyway, you can use the LinReg Slope indicator for converting Linear Regression Slope values into 0°~90° pseudo-angle measurements.
Quote:2) Can I directly use the LRT function (For plotting regression line) for scanning purpose. For instance reference it using fml in the scan code for measuring spread of data? Can the following be used to measure the spread of data around the linear regression line >> Sum(Power(C - Fml("LRT"),2), 63)
I don't understand the question, but you can reference the
LinReg Trendline plot with Fml("Linear Regression Trendline & Channels"), and manipulate its value with any MetaStock formula code.
jose '-
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/27/2006(UTC) Posts: 135
|
Jose I totally agree with u that the slope is visually changing in difference zooming. In this case without using angle property, how can the LinReg Trendline code be adapted in scanning for stock with LinReg Trendline uprising?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
You will need to choose an arbitrary value as a reference point for your explorations.
Use the LinReg Slope indicator for this purpose.
jose '-)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/27/2006(UTC) Posts: 135
|
Hi Jose, I had try different ways to adapt the code and manage somehow to get it done. Tks!!!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/27/2006(UTC) Posts: 135
|
Hello Jose, I have being trying to use your trendline code to scan for stocks which are :
Obvious trading sideway pattern for a 30 days with sufficient swing amplitude (Highest high - lowest low in the sideway range)
The method is to look for relatively flat line. However the result of the scan are mixed. As you know a flat regression does not necessarily mean that price is going sideway. For instance if a stock makes a sharp V shape over the 30 days with the first day and 30th day price around the same level, the regression can actually be flat.
Do u have any ideas with regard to fine tuning the scan results so that the results shows stocks which very obvious trading sideway or utilizing any other methods for sideway scan beside regression line? Thanks.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
Sorry Flexi - I don't use trendlines with my trading (I just code them).
jose '-)
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 5/27/2006(UTC) Posts: 135
|
Hi Jose, tks for replying. Do u have any code for idenifying price which are moving sideways. What is the better method of finding price moving sideways? Tks.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
The best method to identify price moving sideways, involves a clear chart, a clear head, and our eyes. ;)
jose '-)
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.