OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


Only Forum Moderators, Administrators, and the owner of this message may delete it.

 
Jim Dean

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Linear Regression Channel - Example Code
Posted : 1/14/2010 11:44 PM
Post #14897 - In reply to #14896

Comments about the charts I just posted:

FIRST, PLEASE READ THE STEPS 1-5 and a-c and the *'d notes ... that's the nutshell. The parameters are shown in the open properties-box on the left.

NOTE that the sequence of the header-line indicator-ID's is NOT the same as the order that the LinReg's are painted. A little "puzzle" for you to figure out :~))

The yellow underlines at the top show the settings for the line length (first), and the number of barsago (ie back from right edge) that the line ENDS at. The FINAL indicator-ID on the far right uses the line length, ignores the barsago, and uses the DATE inputs to define the VERY FIRST "A" LinReg zone.

The cyan underlines at the top show the Std Dev bandwidth multiplier settings for each case. These were adjusted by eyeball to "contain the action" (at least, as I see it).

OK ... maybe a few random comments are in order re each instance ...
A
This is a nice example of an untradeable consolidation zone. Price breaks out of the zone to the downside then shoots up ... a "head fake" ... but note that it did not violate the support levels from the bars at the far left of the chart. Note that the StdDev input is wider here than for any other segment ... typical for consolidations.
B
Here's a nice run up. Very tight StdDev multiplier allows the bands to give you an excellent exit signal ... presumably intraday, when price crosses the band (maybe a partial exit), with full exit once price closes across the band. You could choose to exit, or if you've a mind to, just reverse the position.
C
A shorter run, but still gives nice tight bands with clear and good exit, if you chose to reverse out of the prior run. Or, if you use the C-retrace as a "breather" ... draw the lines anyway to find a good entry for the next move ...
D
Nice entry out of C, and again a fast, tight band with a great intraday exit point (top of the big red bar).
E
Well ... I drew the lines after the gap ... but NOTE that you got a very early indication of the beginning of this drop, from the clean exit out of D ... you could have easily captured the gap. I find that it's sometimes best to ignore big gaps for band-drawing and build the band that searches for an exit after the gap. But ... try it both ways. Either way, it gives you a decent exit.
F
I could have drawn a consolidation zone in between the end of E and the beginning of F, but the chart would have been too messy. That zone probably would have given a so-so entry for F ... but the clean exit from F would have prevented any loss even if you got in late.
G
The final channel on the far right is STILL IN ACTION ... note that the darker-color extension lines (blue and orange) do not appear, since the most recent bar fits nicely in the band. We'll see how long it lasts.

SUMMARY:
This chart was picked AT RANDOM, btw. You can use this tool on virtually any chart, to ID ups, downs, and flats. This is a key concept that I work with regularly.

Deleting message 14897 : RE: Linear Regression Channel - Example Code


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.