[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Calculating critical R squared value



PureBytes Links

Trading Reference Links

I have already posted Expectation analysis code in amibroker-ts 
group.  SAR is a built-in function in AB, but I actually use 
powerSAR which is a dll in AB.

rgds, Pal

--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
wrote:
> Pal, how much of this have you coded in AFL, and would you be 
willing to
> share it?
> 
> Dave
> 
> > I am of the view that one's position size would be best served 
if it
> > is a function of trade risk (MaxRisk in AB) and equity rather 
than
> > volatility.  After finding the optimum quality (quality = 
expectancy
> > * opportunities) of a system by disabling position sizing rules, 
re-
> > enabling the position sizing rules will result in better 
performance
> > than before, especially if the sizing is a function of trade risk
> > and equity.
> >
> > In my opinion, the market condition (trending/cyclic) does matter
> > when considering what type of stops to use and the type of stop 
(SAR
> > for e.g.,) may take into account the volatility.  Welles Wilder
> > Volatility Index System is such a system study described in the
> > book "New Concepts in Technical Trading Systems," Trend Research,
> > P.O. Box 128, McLeansville N.C. 27301.
> >
> > This study sets trailing stops based on a multiple of the
> > volatility. When a market or a stock gets less volatile, the 
stops
> > come in closer to protect profits; when volatility increases, the
> > stops gradually expand away from the price to avoid being hit by
> > random price spikes.
> >
> > This system tends to trade less frequently than some other's and 
can
> > make more per trade, with fewer commissions.  Other systems may 
be
> > more aggressive and make a little more in the end, but with more
> > trading.
> >
> > Wilder originated the idea of Average True Range (ATR) which 
Larry
> > Williams later incorporated into almost all of his systems.  The
> > Volatility Index measures the ATR and then uses a fraction of it 
to
> > add or subtract from the "most significant close in a trade" 
("SIC",
> > i.e.: the highest or lowest close since the position was 
taken.)  A
> > constant factor is then multiplied by the ATR to get the "ARC," 
or
> > Average Range times Constant. The stop-and-reverse (SAR) is 
placed 1
> > ARC below the SIC if the system is long, and 1 ARC above the SIC 
if
> > the system is short.
> >
> > The bottom line is that since the SAR is calculated from an 
extreme
> > close, rather than from just the previous day's close, the system
> > can't miss a trend - it can be whipsawed, but if the market 
starts
> > to drift on low volatility, the stops will come in tighter, and
> > reverse the trade if it goes the wrong way.  Since the close 
changes
> > every day, while the extreme points change only when new equity 
is
> > being made, this system, based on the trade extremes rather than 
the
> > daily closes, is very smooth and can stick with a trend for long
> > periods.  It has the advantage over other trend followers in 
that it
> > self regulates for volatility; this can reduce the lag associated
> > with moving averages and oscillators, without increasing the 
false
> > signals.
> >
> > This unique and valuable indicator combines well with other 
studies,
> > and allows you to filter your signals in accordance with the 
trend,
> > thus enhancing accuracy and profitability while reducing 
drawdown.
> > I've used this indicator for filtering both day and position 
trades.
> > It works well with 15 minute, 30 minute and 1 hour charts as 
well as
> > with daily charts.
> >
> > one shouldn't look at just the cross-overs for signals, this is 
too
> > simplistic. One should watch the distance between the stops and 
the
> > price action. When that distance becomes very wide, a snap-back 
will
> > often take place instead of the trend change you might otherwise
> > expect. One should watch especially for breakout signals to 
confirm
> > the true direction at these important junctures.
> >
> > When plotting Wilder's Volatility one'll need to input both a 
long
> > and short factor. Wilder's original study uses the same factor 
for
> > both long and short, but it is better to enter separate values. 
This
> > will be useful in a market that has an established trend. Make 
the
> > factor smaller in the direction of the trend. If the trend is up,
> > make the long factor a little smaller; this will bias the system 
to
> > be more sensitive in that direction. The reverse rules apply in a
> > down market.
> >
> > A smaller factor makes the stops closer on that side of the 
market.
> > Wilder suggests factors of 2.8 to 3.2 but there's no set rule and
> > one should experiment with different markets.  It can also be 
used
> > as a most excellent filter.
> >
> > Wilder suggests ATR period of 7 but you can experiment. Longer
> > periods make the indicator smoother but tend to negate the 
automatic
> > volatility adjustment feature.
> >
> > rgds, Pal



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/