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

[amibroker] Re: Collaborative success on NORMSDIST(), here's the completed code.



PureBytes Links

Trading Reference Links

Treliff, the Wright Model A is a little more sensitive than B, and has
more false-positive recession forecasts.  There might be some
application of the "A" signals in forecasting stock market corrections,
in conjunction with other confirming indicators.

FWIW, one other thing I did to "liberate me from Fed- and interest-rate
talk" was create a Shadow CPI Index.   It's too hard to eliminate the
hedonic adjustments (the "Boskin Fix", etc.).  However, it is possible
to remove the Owner's Equivalent Rent portion (notorious for its
inaccuracy, and it's the biggest single CPI input) and substitute a
number based on actual housing prices.  That will get you a more
accurate read on inflation and interest rate direction than...nearly
everybody, including the Fed board members.:)

It's a trick or two to set it up, though, and requires the monthly
update of a dozen or so individual pieces of detailed CPI data, so it's
not a casual project.

Anyway, thanks again for all the help.:)



Luck,

Sebastian



  --- In amibroker@xxxxxxxxxxxxxxx, "treliff" <treliff@xxx> wrote:
>
> Sebastian, I happened to pick up your earlier msg. Appreciate the
> Wright explanation. If this indicator can liberate me from Fed- and
> interest rate-talk for good I'd be eternally obliged :) I'll download
> some data and check it out, it's interesting.
>
> The Wright concept reminds me somewhat of a piece called Sign of the
> Bear that received the 2001 Dow award. But more TA oriented if I
> remember. Just in case here's the link:
>
> https://www.mta.org/EWEB/docs/2001DowAwarda.pdf
>
> I did "polish" the code a bit, this may clarify the use of custom HAS
> function.
>
> // code start
>
> // First define HAS function
>
> function t(x)
> { return 1 / (1+0.2316419*x); }
>
> function HASpre(x)
> { return 1 - (exp(-0.5*x^2)/sqrt(2*3.141592654))*(0.31938153*t(x)-
> 0.356563782*t(x)^2+1.781477937*t(x)^3-1.821255978*t(x)^4+1.330274429*t
> (x)^5); }
>
> function HAS(x)
> { return IIf(x<-6, 0, IIf(x>6, 1, IIf( x>0, HASpre(x), 1 - HASpre(-
> x)))) ; }
>
> // Now once HAS function is defined use it like any normal AB function
>
> SetBarsRequired( 100000, 100000 );
>
> FedFunds=EMA(Foreign("^FedFundsWkly","C",1),12);
>
> TNX=EMA(Foreign("^TNX","C",1),60);
>
> IRX=EMA(Foreign("^IRX","C",1),60);
>
> Spread= TNX - IRX;
>
> WrightModelA = HAS(0.28 - 0.74*Spread) ;
>
> WrightModelB = HAS(-2.17 - 0.76*Spread + 0.35*FedFunds) ;
>
> Plot( WrightModelA, "WrightModA", colorRed );
> Plot( WrightModelB, "WrightModB", colorBlue );
>
> // code end
>
> -treliff
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "sebastiandanconia"
> sebastiandanconia@ wrote:
> >
> >
> > The data inputs ^TNX and ^IRX can be pulled in from Yahoo! as normal
> > symbols, but you will have to get weekly Fed Funds data (available
> for
> > free online from the Federal Reserve, a Google search on Fed Funds
> > historical data should get you there). Save as a csv. file and
> import
> > into AB.
> >
> >
> >
> > Sebastian
> >
> >
> >
> > SetBarsRequired( 100000, 100000 );
> >
> > FedFunds=EMA(Foreign("^FedFundsWkly","C",1),12);
> >
> > TNX=EMA(Foreign("^TNX","C",1),60);
> >
> > IRX=EMA(Foreign("^IRX","C",1),60);
> >
> > Spread= TNX-IRX;
> >
> > x=-2.17-0.76*Spread+0.35*FedFunds;
> >
> > Tx=1/(1+0.2316419*x);
> >
> > HASx=1-(exp(-0.5*x^2)/sqrt(2*3.141592654))*(0.31938153*Tx-
> 0.356563782*Tx\
> > ^2+1.781477937*Tx^3-1.821255978*Tx^4+1.330274429*Tx^5);
> >
> > function t(x)
> >
> > { return 1 / (1+0.2316419*x); }
> >
> > function HASpre(x)
> >
> > { return 1 - (exp(-0.5*x^2)/sqrt(2*3.141592654))*(0.31938153*t(x)-
> >
> > 0.356563782*t(x)^2+1.781477937*t(x)^3-1.821255978*t(x)
> >
> > ^4+1.330274429*t(x)^5); }
> >
> > function HAS(x)
> >
> > { return IIf(x<-6, 0, IIf(x>6, 1, IIf( x>0, HASpre(x), 1 - HASpre(-
> >
> > x)))) ; }
> >
> > Plot( HAS(x), "Trend line", colorBlue );
> >
>



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.35/680 - Release Date: 2/10/2007 9:15 PM