Support Board
Date/Time: Mon, 24 Feb 2025 21:37:28 +0000
VWAP with current bar, use for moving average calculation
View Count: 985
[2020-12-15 18:28:05] |
User627759 - Posts: 6 |
Is there a way to create VWAP of current bar and use it for moving average calculation? Example: Using intraday tick as input from IQFeed Each bar volume is N e.g. Bar Period Type = Volume per bar, Setting = N Calculate VWAP of each bar and use it for moving average calculation. Thank you |
[2020-12-15 19:34:28] |
John - SC Support - Posts: 38146 |
First, it is possible to calculate the VWAP for each bar, as long as you have Time-based chart (1 minute, 5 minutes, etc.). This will not work with non-time-based charts (such as range, renko, etc.). Just use the VWAP study and set the duration and length to match that of the chart. You will probably also want to set the Input for Use Underlying Data to Yes in order to get a weighted average of each tick within the bar instead of just the Close of the bar. Refer to the information here: Volume Weighted Average Price (VWAP) with Standard Deviation Lines We do not understand what you are asking about in terms of using this as a weighted average. You can always apply a weighted average to the VWAP, if that is what you want. Refer to the information here for a Simple Moving Average: Moving Average - Simple For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2020-12-15 23:07:54] |
User627759 - Posts: 6 |
Thank you! Is it possible to calculate VWAP for volume based bar? For example, let's say each bar has volume of 5 (ticks/shares) Bar 1 = 1,1,1,1,1 Bar 2 = 2,2,2,2,2 Bar 3 = 3,3,3,3,3 VWAP for Bar 1 = 1 (1+1+1+1+1 / 5) VWAP for Bar 2 = 2 VWAP for Bar 3 = 3 Calculate MA using VWAP for Bar 1/2/3 . Is that possible? |
[2020-12-16 14:59:24] |
John - SC Support - Posts: 38146 |
It is not possible with the current VWAP study, as the study does not have an input to calculate each bar. It is something that you can change (or have someone change it for you) as the VWAP study code is available in the Studies3.cpp file in the ACS_Source folder under your main Sierra Chart installation. Refer to the following: How to Build an Advanced Custom Study from Source Code For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2020-12-16 16:11:30] |
User627759 - Posts: 6 |
Thank you. Is changing cpp source code the only way to do this? Would it be possible to do custom script within Sierra Chart (without changing source code) to achieve this? |
[2021-03-25 00:02:30] |
User741184 - Posts: 44 |
Hi, Were you able to solve this issue? I am also looking for its solution. |
To post a message in this thread, you need to log in with your Sierra Chart account: