Trouble calculating the VWAP of each bar in a chart - EasyLanguage Programming | futures io social day trading
futures io futures trading

Trouble calculating the VWAP of each bar in a chart
Updated: Views / Replies:2,127 / 3
Created: by chisound Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

Trouble calculating the VWAP of each bar in a chart

  #1 (permalink)
Elite Member
Chicago, IL USA
Futures Experience: Advanced
Platform: Multicharts
Broker/Data: TT and IQFeed
Favorite Futures: ES
Posts: 6 since Apr 2010
Thanks: 3 given, 5 received

Trouble calculating the VWAP of each bar in a chart


I am attempting to calculate the internal VWAP for each bar in a chart as opposed to what is normally done when calculating VWAP, ie calculate the VWAP of a day as of the close of the last bar. So for each tick in a bar after and including the first tick of the bar i need to keep two counters going, one to keep a sum of Price of tick * volume of tick for the bar and the other to sum the volume of each tick for the bar. At the end of each bar i then calculate the internal VWAP of the bar that just closed using the following:

IntrabarVWAP = Bar Sum of (Price of tick * volume of tick ) / ( Sum of volume of ticks)

I then need to reset the two sum counters to 0 so that the internal VWAP for the next bar can be calculated independently.

Seems simple enough but this is a real headache. I either get the Internal VWAP of each bar to equal the Close of each bar, which is not possible or i get it to be a number that is outside of the range of each bar, which is also not possible.

I am using Multicharts 7.0 and have "Update on every tick" disabled for the indicator as i am using intrabarpersist . I have tried using Range Bars, minute bars (built from ticks) and tick bars all with the same results.

Here is the code i am using:

    intrabarpersist PriceW(0),
    intrabarpersist ShareW(0),

If barstatus = 0 then begin    
    PriceW = 0;
    ShareW = 0;
PriceW = PriceW + (Close * (Ticks));
ShareW = ShareW + (Ticks);
PriceX = PriceW;
ShareX = ShareW;
If ShareX > 0 then IntrabarVWAP = PriceX / ShareX; 

Many thanks for your help with this.

Reply With Quote
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

  #3 (permalink)
Site Administrator
Manta, Ecuador
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 46,553 since Jun 2009
Thanks: 29,626 given, 85,054 received

You might check here:


Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
  #4 (permalink)
The Netherlands
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
Jura's Avatar
Posts: 774 since Apr 2010
Thanks: 2,347 given, 665 received

Also worth checking out:
- and this post.

Reply With Quote
The following user says Thank You to Jura for this post:


futures io > > > > > Trouble calculating the VWAP of each bar in a chart

Upcoming Webinars and Events (4:30PM ET unless noted)

September Journal Challenge (sponsored by TopstepTrader)


Free Elite Membership: Twitter Tuesday and Facebook Friday!

Tue & Fri

Trading with Python: Using Machine Learning w/Ran Aroussi [12:30PM ET]

Elite only

TopstepTrader (TBD)

Sep 25

RandBots (TBD)

Sep 27

Anthony Drager (TBD)

Oct 4

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sierra Chart and custom bar types Big Mike Sierra Chart 35 January 9th, 2018 03:55 AM
Chart Bar with volume indicator inside Bar? hector24 NinjaTrader 11 October 9th, 2011 10:41 AM
chart stocks with vwap ciardim Reviews of Brokers and Data Feeds 2 August 23rd, 2010 11:36 AM
Variable Bar Chart DavidHP Traders Hideout 0 December 4th, 2009 03:53 PM
Volume Chart Bar Size Setting??? RJay Traders Hideout 5 September 1st, 2009 10:32 PM

All times are GMT -4. The time now is 08:41 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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.
no new posts
Page generated 2018-09-20 in 0.12 seconds with 14 queries on phoenix