NexusFi: Find Your Edge


Home Menu

 





Simple VWAP indicator


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 13 posts (60 thanks)
    2. looks_two psmf with 13 posts (30 thanks)
    3. looks_3 Silvester17 with 6 posts (42 thanks)
    4. looks_4 Big Mike with 4 posts (2 thanks)
      Best Posters
    1. looks_one Silvester17 with 7 thanks per post
    2. looks_two Fat Tails with 4.6 thanks per post
    3. looks_3 psmf with 2.3 thanks per post
    4. looks_4 bkool with 1 thanks per post
    1. trending_up 43,454 views
    2. thumb_up 146 thanks given
    3. group 27 followers
    1. forum 57 posts
    2. attach_file 24 attachments




 
Search this Thread

Simple VWAP indicator

  #11 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731

Submitted for evaluation.

_VWAP bip1.cs

I am sorry if this is not complicated enough.

"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
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Bigger Wins or Fewer Losses?
24 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #12 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527


Zondor View Post
Submitted for evaluation.

Attachment 106991

I am sorry if this is not complicated enough.

interesting.

here're 3 vwap indicators in action. first pic with a minute based chart, second with tick based chart:

- fat tail vwap
- zondor vwap
- gom vwap






edit: was also comparing loading time:

gom vwap loads fastest (although it doesn't have bands), then fat tail vwap. zondor vwap took a bit longer to load.

Reply With Quote
  #13 (permalink)
psmf
NY
 
Posts: 14 since Nov 2010
Thanks Given: 3
Thanks Received: 30



Zondor View Post
Submitted for evaluation.

Attachment 106991

I am sorry if this is not complicated enough.

1. Do you have habit to reference original source?
2. Your programming skills have a lot of room for improvement.

Reply With Quote
  #14 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

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.

Attached Files
Elite Membership required to download: CurrentDayVWAPV40c.zip
Reply With Quote
  #15 (permalink)
psmf
NY
 
Posts: 14 since Nov 2010
Thanks Given: 3
Thanks Received: 30


Fat Tails View Post
I am currently experimenting with different formulae. The VWAP that I have put into the downloads uses (Open + High + Low + Close)/4 to calculate the VWAP and the bar closes for calculating the variances. This is not an optimal solution either. I have tried to improve the volatility estimates, but I am not really satisfied with the results so far.


Fat Tails View Post


In your evaluation above what input did you use?

Reply With Quote
  #16 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


psmf View Post
I your evaluation above what input did you use?

@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.

Reply With Quote
  #17 (permalink)
 supermht 
Naperville IL
 
Experience: Intermediate
Platform: ninjatrader
Broker: NT broker
Trading: NQ ES 6E GC CL
Posts: 962 since Feb 2010
Thanks Given: 1,189
Thanks Received: 661


Fat Tails View Post
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.

Hi, FT, any differences between version 40c and 40? currently I have version 40 installed, wondering if I should install 40c. thanks

Reply With Quote
  #18 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


supermht View Post
Hi, FT, any differences between version 40c and 40? currently I have version 40 installed, wondering if I should install 40c. thanks

The difference is mainly speed. The old version 40 uses an inefficient algorithm for the setting Variance_Last. An update is recommended.

For the version 40c, Variance_Price has become the default setting, as it is no longer penalized by creating unnecessary CPU load.

However, you can also wait a few days, as I will update the whole bunch of VWAPs and TWAPs, as soon as I find some time.

Reply With Quote
Thanked by:
  #19 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


Zondor View Post
Submitted for evaluation.

Attachment 106991

I am sorry if this is not complicated enough.


@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.


Reply With Quote
Thanked by:
  #20 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527


@Fat Tails,

just for another comparison.

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.




Reply With Quote




Last Updated on February 28, 2018


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts