1. 10. 2021

5 18

Volume-Weighted Average Price (VWAP)

In finance, volume-weighted average price (VWAP) is the ratio of the value of a security or financial asset traded to the total volume of transactions during a trading session. It is a measure of the average trading price for the period.

Typically, the indicator is computed for a period of one day, but it can be measured between any two points in time.

This implementation uses open, high , low and close prices.

Import snippets to SQX: https://strategyquant.com/doc/programming-sq/import-export-custom-indicators-and-other-snippets/

Implemented for: MT4, MT5, TS, MC.

Subscribe
Notify of
18 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
MM1
MM1
2. 10. 2021 3:51 pm

Hi, great but is missing the attachment. Cheers

tomas262
Admin
Reply to  MM1
5. 10. 2021 1:03 pm

Hello,
we apologize, the attachment has been added.

Ed Cas
Reply to  tomas262
12. 2. 2022 3:53 pm

Please let me know how to use the Snipped VWAP , as as standard indicator and signal in SQX. I have already imported the snipped in the code editor but it dos not show up in SQX.

Thank you

tomas262
Admin
Reply to  Ed Cas
14. 2. 2022 8:16 pm

Once you import the snippet you also need to recompile the files and restart SQX. Then you can find the VWAP under both – signals and indicators blocks

Renato David
Renato David
7. 11. 2021 9:45 pm

Hi, the archive SqVWMA.mq5 is missing, could you send it? Thanks!

tomas262
Admin
Reply to  Renato David
8. 11. 2021 3:32 pm

Hello, the MQ5 file is included in the attached archive. Let us know if any issues

Renato David
Renato David
Reply to  tomas262
8. 11. 2021 4:37 pm

Hello, to run the strategy in MT5 is required the file SqVWAP.mq5 OR SqVWMA.mq5, it depends on the building blocks of the strategy. The attachment has only the SqVWAP.mq5 file, só is missing the other. Thanks!

Emmanuel
20. 12. 2021 3:01 pm

Super !!!!!!!!! very good idea !!! thank you 🙂

Emmanuel
20. 12. 2021 3:06 pm

This is truly Excellent !!!!!!!!!!!!!!!!!!!!!!!!!!!

Adam Spalek
17. 1. 2022 12:30 pm

Hi all, has anyone got this working on Tradestation? I am using ES on an hourly chart and if I display the SQ_VWAP indicator as study OR via a strategy the following error is showing up:

“Attempted to divide by zero (0). You should always check before dividing to be sure divisor is not zero. Incorrect example: Value = (C – O) / (H – L) Correct Example: Value1 = IFF(H – L <> 0, (C – O) / (H – L), 1 )”

I would appreciate a fix if possible. Thanks

Peter Morrow
26. 9. 2022 5:44 pm

This is just a simple moving average, not a VWAP, such as the useful one in Trading View.

stearno
Reply to  Peter Morrow
2. 3. 2023 1:18 pm

Thats not true. If you look in the code, it does caluclate using volume, which is the formula for VWAP. It follows the formula found here: https://school.stockcharts.com/doku.php?id=technical_indicators:vwap_intraday

Jack Archer
Reply to  stearno
16. 11. 2023 8:55 pm

Ok, first don’t hate me for posting this, I am truly trying to understand vwap, as I thought it was quite simple and is a little more complicated than I once thought… This is copied from the link above: “Like moving averages, VWAP lags price because it is an average based on past data. The more data there is, the greater the lag. A stock has been trading for some 331 minutes by 3:00 PM. As a cumulative “average”, this indicator is akin to a 330 period moving average.” So, as I understand (hopefully and unlikely some days) the vwap… Read more »

stearno
2. 3. 2023 1:17 pm

I get no trades when I attached this indicator in SQ AlgoWizard. I tired both “Close Above VWAP” and When I choose VWAP and manually make it < Close.

tomas262
Admin
Reply to  stearno
6. 3. 2023 4:39 pm

Please send me your AW project file saved to support.com, I will check it

Jack Archer
18. 11. 2023 12:08 am

Ok, first don’t hate me for posting this, I am truly trying to understand vwap, as I thought it was quite simple and is a little more complicated than I once thought… This is copied from the link above: “Like moving averages, VWAP lags price because it is an average based on past data. The more data there is, the greater the lag. A stock has been trading for some 331 minutes by 3:00 PM. As a cumulative “average”, this indicator is akin to a 330 period moving average.” So, as I understand (hopefully and unlikely some days) the vwap… Read more »