October 1, 2021

5 12

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.

12 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
MM1
MM1
October 2, 2021 3:51 pm

Hi, great but is missing the attachment. Cheers

tomas262
tomas262
Admin
Reply to  MM1
October 5, 2021 1:03 pm

Hello,
we apologize, the attachment has been added.

Ed Cas
Ed Cas
Reply to  tomas262
February 12, 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
tomas262
Admin
Reply to  Ed Cas
February 14, 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
November 7, 2021 9:45 pm

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

tomas262
tomas262
Admin
Reply to  Renato David
November 8, 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
November 8, 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
Emmanuel
December 20, 2021 3:01 pm

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

Emmanuel
Emmanuel
December 20, 2021 3:06 pm

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

Adam Spalek
Adam Spalek
January 17, 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