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

Re: [amibroker] Re: Sector and industry analysis



PureBytes Links

Trading Reference Links


Pal,
 
That makes sense as I've visually seen what you've described.  It seems like our primary job when interpreting the data is to determine where the critical inflection points are versus noise.
 
I've worked with Bollinger Bands and the net positions of the three groups, but am interested in how Z-Score differs from what a Bollinger Band plots, and does it give a better sense of the inflection point we seek.
 
In addition, should any changes be made to the ZScore code as listed below for non-normal distribution as you describe COT data to be?  How do you determine if the data is normally distributed?
 
Sorry for all the questions, but you've piqued my interest, and you've been very clear in your explainations.
 
I'd be happy to code any adjustments based on your suggestions, and post them on the board.
 
Code Below
 
Kind Regards,
Gary
 

/*
There is one interpretation of the Z-Score that takes an observation from a
population and returns a Z-Score statistic, where the Z-Score is a
measurement of the number of standard deviations that that specific
observation deviates from the mean. If this is the interpretation you
intend, the following afl code returns the Z-Score of the Close of the most recent 50 days of an end-of-day price series and plots it. Copy this code and paste it into Indicator Builder.
Note that most of the Closes (95 percent, on average) will have ZScore
values between -2.0 and +2.0.
*/
// ZScore of Close
ZLen = 50;
ZScore = (C-MA(C,ZLen))/StDev(C,ZLen);
Plot(C,"C",colorBlack,>styleCandle);
Plot(ZScore,"ZScore",colorBlue,styleOwnScale|styleNoLabel,-3,3);
Plot(0,"",colorRed,styleOwnScale|styleNoLabel,-3,3);
Plot(-2.0,"", colorRed,styleOwnScale|styleNoLabel,-3,3 ); 
Plot(2.0,"", colorRed,styleOwnScale|styleNoLabel,-3,3);
/* 
Version 2
normal percentile to Z Score conversion 
Schmeiser (1979) came up with the following simple formula for p > 0.5:
z = {p ^ 0.135 - (1-p) ^ 0.135} / 0.1975
According to a table in Shore (1982), it is accurate to two digits at p = 0, 0.4, 0.8, ..., 
which may be good enough.
*/
//p = 0.025;
p = Param("p", 0.025, 0.0001, 0.9999, 0.0001 );
pp = IIf(p>=0.5, p, 1.0-p);
z = ((pp ^ 0.135) - ((1.0-pp) ^ 0.135)) / 0.1975;
z = IIf(p>=0.5, z, -z);
//----------------------
 
 
 
 
palsanand <palsanand@xxxxxxxxx> wrote:
Gary,If you plot the Net Longs of all the 3 players (Commercials, Large speculators and Small traders), you will see that the plot of the Commercials and Large speculators are at opposite sides about the mean (most of the time) and the small traders closer to the mean.You will see that the plot of the Commercials and Large speculators are either diverging from each other or going parallel (most of the time).You can then watch for trend-change pullbacks or breakout signals at the specific time on the plot where the Commercials and Large Speculators begin converging from their extreme positions (visually identified) on either side of the mean.  You may use Z-Scores to identify the extreme positions.  Z-Scores tend to be used mainly in the context of the normal curve, and their interpretation based on
 the standard normal table. It would be erroneous to conclude, however, that Z-Scores are limited to distributions that approximate the normal curve. Non-normal distributions can also be transformed into sets of Z-Scores. In this case the standard normal table cannot be consulted, since the shape of the distribution of Z-Scores is the same as that for the original non-normal distribution. For instance, if the original distribution is positively skewed the distribution of Z-Scores also will be positively skewed.Regardless of the shape of the distribution, the shift to Z-Scores always produces a distribution with a mean of 0 and a variance of 1.Regards,Pal--- In amibroker@xxxxxxxxxxxxxxx, "Gary A. Serkhoshian" <serkhoshian777@xxxx> wrote:> Pal,>  > Thanks for the post as I've been racking my brain thinking of ways to trade COT.  Could you please elaborate on your statement
 below.  Specifically, how are you identifying extremes (std dev?), and when you write "low points and turning up" are you referring to the net commercial position.  Taking it a step further, can I assume you mean net-short commerical?>  > Thanks,> Gary>  > So, for those places where the > Commercials are at extreme low points and turning up, and the Large > speculators are at the opposite extreme and turning down, the market > will probably turn down shortly (vice-versa for an upside move).  The > small speculators are usually trading with the primary trend.> > > > > ---------------------------------> Do you Yahoo!?> Yahoo! SiteBuilder - Free, easy-to-use web site design softwareSend BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software






Yahoo! Groups Sponsor


  ADVERTISEMENT 









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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.