Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
This is a trade off between accuracy and CPU load.
The most accurate VWAP can be calculated from a 1-tick series, which is possible with GOMI's VWAP. This takes a toll on the CPU. If you calculate a VWAP from minute data and do it correctly via a recursive algorrithm, it should always be fast.
I admit that I had used an inefficient algorithm for a long time, but had only recently replaced it. Also the NinjaScript method DrawRegion() causes a delay, and I have therefore replaced it with a custom plot.
Accuracy: The two simple VWAP are currently pretty inaccurate, but this is only due to input data.
Speed: I have compared the speed of the anaCurrentDayVWAPV40c (attached) to the simple VWAP by running the through a replay test with speed x500. Of course the simple VWAP is slightly faster. However, the difference is not significant.
The anaCurrentDayVWAPV40c is nearly as fast and has
-> 3 different options to calculate the bands
-> lets you display both RTH and ETH VWAPs
-> has a user selectable offset that lets you select the start time
-> has the zones between the bands colored
-> and does not show false connectors to the prior session
But let the users select what they like....
Accuracy: The orange line is the VWAP TOS, the blue line is the CurrentDayVWAPV40c
Speed (anaCurrentDayVWAPV40c at x500 during RTH session):
Speed (VWAP TOS at x500 during RTH session):
For the speed comparisons please ignore the spikes, which are due to other applications that have been started in the background.
@psmf: I had the indicator file attached. You can check it and use it for your version.
VWAP:
The indicator uses (Open + High + Low + Close)/4 for the input series. If you just use the closing price, you introduce an error on a trending day, as was the case yesterday. If the instrument trades down, the close does not correctly represent the volume weighted average price of a single bar.
Standard Deviation Bands:
The largest error occurs with the first bar. If you compare the close to the close, you will obtain a standard deviation of zero for the first bar, even if it is a wide ranging bar. This does not make sense as the first bar only has a zero variance, if the high of that bar equals the low.
I therefore have used a technique, where each bar is represented by 8 data points. I calculate the variance of a single bar from those points, which are high, low, open, close, 2 x (high+low)/2, 2 x (open+close)/2.
I have empirically verified that this formula gets me much better results than the close-to-close approach. For the empirical verification, I have used a simple VWAP applied to a 1-tick chart. The error term on a 1-tick chart is zero, so it can be considered that it will display the exact value for the standard deviation.
I have also made some experiments with Parkinson, RogersSatchell and GarmanKlass variance estimators, but the results were not satisfactory so far.
@Zondor: It is fast and 100% accurate, as it loads a 1-tick series.
However, it requires historical tick data. So it might take a little bit longer to load in the beginning. On real-time data it will be as fast as any other VWAP with setting COBC = false.
The indicator also allowed me to test the accuracy of the anaCurrentDayVWAPV40c with 1-minute data. The chart below shows your simple VWAP (red) against the anaCurrentDayVWAPV40c (blue).
The absolute error that I can measure for ES after the first 15 minutes into the session is about 0.06 points or 0.25 ticks. An error of 0.25 ticks seems acceptable for the anaCurrentDayVWAPV40c. See chart attached.
I added some bands to the gom vwap and compared it to your new 40c version. used a 4 range and a 1 minute chart. as far as I can tell, they match nicely and both load really fast. even with variance price.