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:1,873 / 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 90,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

Reply
 
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

Hi:

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:

 
Code
vars:
    intrabarpersist PriceW(0),
    intrabarpersist ShareW(0),
    PriceX(0),
    ShareX(0),
    IntrabarVWAP(0);

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

Plot1(IntrabarVWAP,"BarVWAP");
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,240 since Jun 2009
Thanks: 29,353 given, 83,234 received


You might check here:

https://futures.io/tradestation-multicharts-easylanguage-programming/13577-quart...ghted-average-price.html

Mike

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.
6)
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)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received

Also worth checking out:
- https://futures.io/tradestation-multicharts-easylanguage-programming/11768-outside-volume-indicator.html
- and this post.

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

Reply



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

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

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


All times are GMT -4. The time now is 07:18 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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 2017-12-16 in 0.10 seconds with 19 queries on phoenix via your IP 54.226.113.250