NexusFi: Find Your Edge


Home Menu

 





anaVWAP Drawing Issue?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 13 posts (35 thanks)
    2. looks_two syxforex with 7 posts (0 thanks)
    3. looks_3 Big Mike with 6 posts (11 thanks)
    4. looks_4 srgtroy with 4 posts (1 thanks)
      Best Posters
    1. looks_one Fat Tails with 2.7 thanks per post
    2. looks_two Big Mike with 1.8 thanks per post
    3. looks_3 jocomoco with 1 thanks per post
    4. looks_4 srgtroy with 0.3 thanks per post
    1. trending_up 12,596 views
    2. thumb_up 49 thanks given
    3. group 8 followers
    1. forum 37 posts
    2. attach_file 17 attachments




 
Search this Thread

anaVWAP Drawing Issue?

  #1 (permalink)
 
srgtroy's Avatar
 srgtroy 
Los Angeles, California Republic
Legendary  R.I.P. 1965-2023 
 
Experience: None
Platform: Sierra Chart
Broker: CQG
Trading: ES
Posts: 1,928 since Jan 2011
Thanks Given: 1,375
Thanks Received: 3,722

I've noticed a small but significant issue with anaCurrentDayVWAPV38. If I compare it to GomMP VWAP, it generally produces the same result, however, it seems to draw it slightly off so that price action doesn't exactly respect the visual level. The following are not isolated incidents but rather occur often, albeit at a small level.





Note the prices are the same, but the visual levels are not.

Another example:





Can anything be done to fix this small discrepancy. Otherwise, sometimes it appears that price has crossed the anaVWAP when it hasn't or vice versa.

R.I.P. Roy Goldberg (srgtroy), 1965-2023.
Please visit [url="https://nexusfi.com/off-topic/60226-srgtroy-r-i-p-brotha.html[/url] for more information.
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
29 thanks
Tao te Trade: way of the WLD
24 thanks
Diary of a simple price action trader
21 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
10 thanks
  #2 (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


srgtroy View Post
I've noticed a small but significant issue with anaCurrentDayVWAPV38. If I compare it to GomMP VWAP, it generally produces the same result, however, it seems to draw it slightly off so that price action doesn't exactly respect the visual level. The following are not isolated incidents but rather occur often, albeit at a small level.

How did you conclude that the anaCurrentDayVWAP is slightly off and not the GomMPVWAP?

If you are within the session and price action continues, the VWAP cannot be a horizontal line, but it must follow price action. That is if prices are above the VWAP, the VWAP should rise and if prices are below the VWAP, the VWAP should fall. In any case it cannot be stable during the session.

Depending on the data used for calculating a VWAP there can be a slight inaccuracy. The correct VWAP can only be calculated from tick-by-tick data by using every single trade. The anaCurrentDayVWAP38 uses an approximation for calculating the average price, as it cannot access the 1-tick data series, but only the bars on the chart. I do not know what type of bars you use, because you have not shown it. But whatever it is, it is used. The best available approximation for the VWAP of a bar is (high + low + open + close) / 4. The indicator then collects the VWAPs of all bars and calculates the average price for the session. On larger timeframes, such as 15 or 60 min bars, anaCurrentDayVWAP may be 1 or 2 ticks off, because the necessary price and volume information to calculate a 100% accurate VWAP is not available with the bar series.

That price respects the visual level of the GomMPVWAP is just an illusion. But if you need that illusion, this is the way to go:

-> round the VWAP to the tick (needs a slight modification of the indicator code)
-> set the Plot Style of the VWAP plot to square and you will see a step function as for the other one

Reply With Quote
Thanked by:
  #3 (permalink)
 
srgtroy's Avatar
 srgtroy 
Los Angeles, California Republic
Legendary  R.I.P. 1965-2023 
 
Experience: None
Platform: Sierra Chart
Broker: CQG
Trading: ES
Posts: 1,928 since Jan 2011
Thanks Given: 1,375
Thanks Received: 3,722



Fat Tails View Post
How did you conclude that the anaCurrentDayVWAP is slightly off and not the GomMPVWAP?

If you are within the session and price action continues, the VWAP cannot be a horizontal line, but it must follow price action. That is if prices are above the VWAP, the VWAP should rise and if prices are below the VWAP, the VWAP should fall. In any case it cannot be stable during the session.

Depending on the data used for calculating a VWAP there can be a slight inaccuracy. The correct VWAP can only be calculated from tick-by-tick data by using every single trade. The anaCurrentDayVWAP38 uses an approximation for calculating the average price, as it cannot access the 1-tick data series, but only the bars on the chart. I do not know what type of bars you use, because you have not shown it. But whatever it is, it is used. The best available approximation for the VWAP of a bar is (high + low + open + close) / 4. The indicator then collects the VWAPs of all bars and calculates the average price for the session. On larger timeframes, such as 15 or 60 min bars, anaCurrentDayVWAP may be 1 or 2 ticks off, because the necessary price and volume information to calculate a 100% accurate VWAP is not available with the bar series.

That price respects the visual level of the GomMPVWAP is just an illusion. But if you need that illusion, this is the way to go:

-> round the VWAP to the tick (needs a slight modification of the indicator code)
-> set the Plot Style of the VWAP plot to square and you will see a step function as for the other one

I was not saying that your calculations are wrong, in fact, considering they are only being done bar by bar instead of tick by tick like Gomi's VWAP, they are amazingly accurate.

I thought maybe there was a NinjaTrader rendering issue. It looked like NinjaTrader was rendering your VWAP line at one edge of a price point's pixel range instead of in the middle, making it appear slightly off vis-a-vis price action. I thought Gomi's VWAP didn't have the same problem maybe because it has its own rendering engine.

However, the instructions you posted explain the issue. Additionally, you have correctly pointed out that the color of the VWAP line provides the proper guidance as to whether price is above or below it.

Thanks for your response and your work!

R.I.P. Roy Goldberg (srgtroy), 1965-2023.
Please visit [url="https://nexusfi.com/off-topic/60226-srgtroy-r-i-p-brotha.html[/url] for more information.
Started this thread Reply With Quote
  #4 (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

Here is a modified version of the anaCurrentDayVWAPV38, which has its plots rounded to the tick.


Attached Files
Elite Membership required to download: CurrentDayVWAPV38X.zip
Reply With Quote
  #5 (permalink)
 
srgtroy's Avatar
 srgtroy 
Los Angeles, California Republic
Legendary  R.I.P. 1965-2023 
 
Experience: None
Platform: Sierra Chart
Broker: CQG
Trading: ES
Posts: 1,928 since Jan 2011
Thanks Given: 1,375
Thanks Received: 3,722


Fat Tails View Post
Here is a modified version of the anaCurrentDayVWAPV38, which has its plots rounded to the tick.

A wonderful illusion Many thanks!

R.I.P. Roy Goldberg (srgtroy), 1965-2023.
Please visit [url="https://nexusfi.com/off-topic/60226-srgtroy-r-i-p-brotha.html[/url] for more information.
Started this thread Reply With Quote
  #6 (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


srgtroy View Post
A wonderful illusion Many thanks!

Let me know how it compares to the GomMP VWAP.

Reply With Quote
  #7 (permalink)
 
srgtroy's Avatar
 srgtroy 
Los Angeles, California Republic
Legendary  R.I.P. 1965-2023 
 
Experience: None
Platform: Sierra Chart
Broker: CQG
Trading: ES
Posts: 1,928 since Jan 2011
Thanks Given: 1,375
Thanks Received: 3,722

Looks pretty much like a perfect match. Amazing. Even though this was a small change, I do think it certainly improves the usability of the indicator, not only the VWAP, but the bands as well, thanks again

R.I.P. Roy Goldberg (srgtroy), 1965-2023.
Please visit [url="https://nexusfi.com/off-topic/60226-srgtroy-r-i-p-brotha.html[/url] for more information.
Started this thread Reply With Quote
Thanked by:
  #8 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010

I'm looking for a 3 day vwap. Would any programmers be able to convert ana38 to a three day version and could anybody tell me whether Gomi's MP will plot a three day vwap? Thanks

Visit my NexusFi Trade Journal Reply With Quote
  #9 (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


syxforex View Post
I'm looking for a 3 day vwap. Would any programmers be able to convert ana38 to a three day version and could anybody tell me whether Gomi's MP will plot a three day vwap? Thanks

What do you need a 3-day VWAP for. Do you want a rolling 3-day VWAP or a 3-day VWAP that resets at the beginning of the session. This is the difference:

Rolling 3-day VWAP: Takes into account the last 72 hours of trades. Adds continuously new trades and subtracts trades prior to the period of 72 hours.

3-day VWAP: Starts at the beginning of the session with the volume weighted average price of the preceding 2 days and then adds the trades of the current day. After the end of the day it restarts with a gap.

Reply With Quote
  #10 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010


Hi Fattails, thanks for your reply,

I am looking for a three session vwap that resets to the beginning of each new session.

thanks

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 9, 2013


© 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