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

Re: [amibroker] Calculating VWAP prices with RT data



PureBytes Links

Trading Reference Links

Oh, a couple of other things I forgot to mention about the DE code I 
presented. 

1) The triangles ARE where the centered MA stops and the data 
projection begins.
2) The centered MA never changes, just the band width and the 
projection of the centerline.

-ace

--- In amibroker@xxxxxxxxxxxxxxx, "acesheet" <acesheet@xxxx> wrote:
> Here's a little explanation.
> 
> The reason the band values change for future dat in the code that 
I 
> presented is that the widths are calculated based on 2 standard 
> deviations from the mean. 
> 
> I believe this to be valid because the act of centering the MA 
makes 
> the distribution about the centered moving average a true average 
of 
> the data valid to the bar period/2. Therefore, since the 
> mathematical operation is an average, and if we assume some cycle 
is 
> currently active in the form of a sinusoid, then the distribution 
> should be close to a normal distribution if enough data points are 
> taken, so standard deviation is the proper way to describe the 
> envelope width if its a normal distribution. 
> 
> In fact statisticians call standard deviation with the greek 
letter 
> sigma - ala sigma bands - so that's probably why Maggio calls his 
> bands 'sigma bands'. 
> 
> Here's the calculation for the bandwidth in terms of percent:
> 
> dp1=LastValue(Ref(StDev( (Close-cma1)/cma1, k*p1 ),(p1+1)/2-1));
> 
> where k=3 means that the standard dev is calculated over 3x the 
> period number of data points.
> 
> Using Lastvalue() makes the width a constant for all time based on 
> today's calculation. Therefore as data is added the bandwdiths 
> change and the way I have it coded it changes for all time. Its 
> almost a derivative of Bollinger bands. Bollinger was on the right 
> track he's just using the average incorrectly and standard 
deviation 
> does not describe the price distribution about a non-centered SMA 
> which is why his bands vary in width with the volatility of the 
> stock price movements.
> 
> I will bet you almost anything Maggio's charts do roughly the same 
> thing with whatever smoother or centerline calculation filter he's 
> using. There are many ways to calculate the centerline. His chart 
> could simply be a smoothed and centered SMA. You could easily 
smooth 
> a CMA with a parabolic curve fit or with various forms of 
> regression. However, he still needs to project the bands forward 
in 
> time using some method. 
> 
> If you are really amibitious you should investigate least squares 
> regression fitting of trigonometric functions. I can create 
> beautiful DE bands with them using a different program that I 
wrote. 
> You still need to project forward in time, however, so that's 
really 
> the rub. There are likely much better ways of projecting the line 
> forward than I presented here using various regression techniques. 
> Learning something about digital signal processing is probably 
also 
> key.
> 
> In evaluating Maggio's service ask yourself a few questions. Why 
> create a for pay website to sell the idea to others if it works so 
> well? Why not just trade your way to financial freedom and retire? 
> Beware of snake oil. Maybe he's got something good there - I have 
to 
> admit it looks good - but I sure don't blindly trust a web site.
> 
> I'm sure a discretionary trading system could be built using 
> envelopes and oscillators that would perform fairly well, however 
> there would really be no way to backtest it. Forward testing or 
> trading would be the only way to do it. 
> 
> -ace
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Fred" <ftonetti@xxxx> wrote:
> > Dimitris / WaveMechanic,
> > 
> > If the length of the CMA is n then 
> > 
> > The CMA can only be calculated up to n/2 bars ago after which it 
> must 
> > be extrapolated via some technique.
> > 
> > So for example if one wanted to plot a 250 bar CMA showing the 
> > history of where it had been at time of original calculation 
then 
> one 
> > would need to,
> > 
> > - At bar 375 calculate the CMA for bars 1 through 250 and 
> extrapolate 
> > for bars 251 through 375.  This would provide the initial 250 
> > plottable points.
> > 
> > - At bar 376 calculate the CMA for bars 2 through 251 and 
> extrapolate 
> > for bars 252 through 376. this should add one and only one 
> additional 
> > plottable point i.e. the one at bar 376.
> > 
> > - This process could then continue up through the current bar.
> > 
> > Someone made mention of Jan Arps Sigma Bands code for 
TradeStation 
> > which although available for usage in TS is not viewable.  It 
does 
> > however provide the capabilty of showing both the historical 
past 
> > datapoints as originally calculated as well as the current 
> picture.  
> > The only similarity between these would be the CMA for the 
cureent 
> > and any future bar.
> > 
> > See his description here ... 
http://www.janarps.com/SigmaBands.htm 
> > 
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "wavemechanic" <wd78@xxxx> 
wrote:
> > > 
> > >   ----- Original Message ----- 
> > >   From: DIMITRIS TSOKAKIS 
> > >   To: amibroker@xxxxxxxxxxxxxxx 
> > >   Sent: Saturday, February 21, 2004 3:18 AM
> > >   Subject: [amibroker] Re: Sigma Bands
> > > 
> > > 
> > >   Wayne,
> > >   Sorry, I can not agree that the history of the signals is 
> > meaningless.
> > >   I need always to check any trading idea from its past 
behavior.
> > > 
> > >   Spoken like a true system trader.  However, looking at 
> Maggio's 
> > description of the bands it is not clear to me that there should 
> be 
> > any change as new data is added, reflecting the fact that the 
> bands 
> > are simply the sigma of the % change of the data from the CMA.  
> This 
> > is a bar by bar calculation that does not change as new data is 
> > added.  Perhaps, as you suggest, the problem lies in the way CMA 
> is 
> > calculated by the code.  If so there must be a way around this 
> > problem, as evidenced by the fact that a manual calculation of 
CMA 
> > does not look into the future but simply centers a MA within the 
> > incremental period of another MA.  So one needs to make code 
> > duplicate the manual calculation which is straightforward.  Does 
> not 
> > sound like rocket science.  And extrapolation of the CMA does 
not 
> > change its previously established values.  However, even when 
> things 
> > are working right neither Sigma Bands or Hurst Channels by 
> themselves 
> > provide a mechanical buy/sell signal.  No problem for 
> discretionary 
> > traders but system traders will need some "antacid" in order to 
> avoid 
> > heartburn.  LOL.
> > > 
> > >   Dimitris Tsokakis
> > >   > Dimitris,
> > >   > 
> > >   > I think you don't get that 'signals of the past' are in 
the 
> > past. 
> > >   It's 
> > >   > history and as such is meaningless. Hurst developed his 
work 
> > before 
> > >   > computers had the power to do billions of computations per 
> > second. 
> > >   > Therefore, the idea of backtesting his work is a waste of 
> time.
> > >   > 
> > >   > The Sigma Bands we are discussing seem to be a derivative 
of 
> > the 
> > >   Hurst 
> > >   > Dependency Envelopes, so ably programmed by Ace... and 
much 
> > >   appreciated 
> > >   > too. I feel there is nothing at all to be gained from 1) 
> > looking 
> > >   into 
> > >   > the past or 2) trying to guess the future.  I want to know 
> what 
> > is 
> > >   > happening right now. The Sigma Bands MAY offer some 
insight 
> > into 
> > >   what 
> > >   > the market is saying now, but should never be used to 
trade 
> any 
> > >   market 
> > >   > by themselves. This information should always be used as 
> > >   confirmation of 
> > >   > other indicators and trading techniques.
> > >   > 
> > >   > Computers will never replace the human brain.
> > >   > 
> > >   > Wayne
> > > 
> > > 
> > > 
> > >   Send BUG REPORTS to bugs@xxxx
> > >   Send SUGGESTIONS to suggest@xxxx
> > >   -----------------------------------------
> > >   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



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/