PDA

View Full Version : Vwap


Pages : 1 [2]

trader413
03-17-2010, 09:01 AM
Hi
Is there a version of vwap that works on daily bars ?

Thanks

NinjaTrader_Josh
03-17-2010, 09:05 AM
PatientTrader,

Unfortunately I would not know as I no longer maintain this code since it was provided as a 3rd party indicator during my free time.

trader413,

Unfortunately I am not aware if this does or does not exist.

PandaTrader
04-06-2010, 08:54 AM
Please update to Release Candidate 1 (3/14/2008)

VWAP and its standard deviations. You can choose at what time to start VWAP calculations and when to end them.

Note: You can only use this indicator on intraday charts.

http://i29.tinypic.com/11l7l88.jpg

Changelog:
1.0rc1:
- Optimized VWAP and SD calculation functions
- Removed forced CalculateOnBarClose setting for newer SD calculations
1.0b10:
- Added ability for user defined multiplier on SD bands
- Added ability to disable accuracy warning
- Fixed bug in Standard Deviation Population calculations
- Fixed bug with VWAP input series selection
- Fixed bug when using in a NinjaScript Strategy
- Fixed bug with real-time VWAP calculations on tick/volume/range charts
1.0b9:
- Added Start and End Times
- Replaced SD multiplier with native support for up to 3 SD bands
1.0b8:
- Added support for more accurate SD calculations
- Fixed several plotting bugs
- Optimized code
1.0b7:
- Added compatibility with NinjaTrader 6.5
1.0b6:
- Fixed bug loading VWAP when there is no data connection
1.0b5:
- Added checks to ensure proper VWAP usage
1.0b4:
- Replaced Standard Deviation plot with a DataSeries
1.0b3:
- Added coloring between VWAP bands
1.0b2:
- Added VWAP bands
- Added on/off switches for plots
1.0b1: Added VWAP standard deviation plot

Hi Josh, thanks for the indicator. I have 2 questions.

1. is the VWAP in the download section more up to date? or this one right here?

2. is it possible to extend the VWAP calculation for 2 days. So my calculation would start at 6:30 am on Monday and still adds the new data on Tuesday to the VWAP that started on Monday? Basically a VWAP for 48 hours.

Thanks.

paulg
04-06-2010, 09:07 AM
Pandatrader,
maybe iVwap /Multij by hegh2000 could help; msg #154.

NinjaTrader_Josh
04-06-2010, 09:15 AM
PandaTrader,

1. Should be the same I would think.
2. Unfortunately this was provided as a 3rd party indicator during my free time and I am no longer maintaining it. Perhaps paulg's suggestion could help.

PandaTrader
04-06-2010, 09:59 AM
Pandatrader,
maybe iVwap /Multij by hegh2000 could help; msg #154.

Thanks Josh and PaulG

RickB
05-08-2010, 01:28 PM
Hi
would someone be so kind as to convert this indicator so it works in
NT7 It only works with NT6.5 now

Thanks in advance

sbgtrading
05-08-2010, 08:10 PM
I've made what I believe to be the required changes. Initial testing shows the attached indicator runs in NT 7.0, but I would appreciate your testing and confirmation.

randyjb
05-09-2010, 03:39 AM
Thanks for the revised VWAP.. I am waiting patiently for the NT7 version of your CalculateValueArea indicator :)

Happy Trading,
Randy

RickB
05-09-2010, 05:33 AM
Thank you I will test and let you know

paulg
05-10-2010, 10:49 AM
I've made what I believe to be the required changes. Initial testing shows the attached indicator runs in NT 7.0, but I would appreciate your testing and confirmation.

Could you please post a zip version?

steve11
05-10-2010, 04:26 PM
tried coping the new modified cs files to vwap zip and no luck.

a zip format for 7 should work. I am tempted to erase any old vwap file

on my computer to make sure ninja 7 only recognizes the new zip.

need a n7 zip for vwap.

thanks all

RickB
05-11-2010, 05:40 AM
I've made what I believe to be the required changes. Initial testing shows the attached indicator runs in NT 7.0, but I would appreciate your testing and confirmation.


Hi
Thanks for the changes to vwap
I tested for a couple of days and it seems to work fine for me

Thks

dandxg
05-11-2010, 07:54 PM
I've made what I believe to be the required changes. Initial testing shows the attached indicator runs in NT 7.0, but I would appreciate your testing and confirmation.

Thanks much for modifying I was really missing it. :)

erk53
05-11-2010, 08:07 PM
I've made what I believe to be the required changes. Initial testing shows the attached indicator runs in NT 7.0, but I would appreciate your testing and confirmation.

I installed your modified VWAP indicator in NT7 beta 15, and so far it works great. Thanks for your work on this and all of the other code that you share.:)

steve11
05-12-2010, 05:08 PM
Got it up and going it looks good--j set it on true to calculate last bar or your platform will slow down and
crash !!!!

dgroch
05-26-2010, 02:03 AM
This indicator is indispensible... but it doesn't import into NT7 beta. Is anybody able to update the script so that it will run in NT7?

paulg
05-26-2010, 02:30 AM
Got it up and going it looks good--j set it on true to calculate last bar or your platform will slow down and
crash !!!!

Try using hVWAP.
http://www.ninjatrader-support2.com/vb/showpost.php?p=131235&postcount=194 (http://www.ninjatrader-support2.com/vb/showpost.php?p=131235&postcount=194)

gregid
05-26-2010, 02:37 AM
dgroch:

have you checked this post?: http://www.ninjatrader.com/support/forum/showpost.php?p=164964&postcount=258

dgroch
05-26-2010, 11:44 PM
Thanks gregid, I will check tonight!

danieljsalas
06-08-2010, 10:17 AM
Hi SBG,

Is there a way to get accurate vwap just openning the chart in a mid session, or do i have to open the vwap before the market starts just to get the volume computing started for vwap?

let me know please

daniel

sbgtrading
06-08-2010, 10:27 AM
Hi SBG,

Is there a way to get accurate vwap just openning the chart in a mid session, or do i have to open the vwap before the market starts just to get the volume computing started for vwap?

let me know please

daniel
Hi Daniel,
I'm not intimately familiar with the VWAP formula and how it would be "most accurate" on live data. If it requires live time and sales data, then it would be impossible to modify the NT indicator to accomplish what you ask. If, however, the VWAP formula just needs tick data and volume at each tick, then it would be possible in NT7.0 to create a more accurate VWAP indicator using the multi-timeframe programming features in NT7.

danieljsalas
06-08-2010, 10:33 AM
What i mean SBG is with respect to the problem that if you dont open the vwap before market opens it calculates the values wrong, i think, is there a way to do something to fix this?

thanks

ps: are there any plans to make it for NT7

sam777
06-17-2010, 05:00 PM
Which one is the latest version of Vwap. I see hwap too - confused. Not using version 7 yet. Is it stable or has issues - last time had trouble when downloaded ver. 7 and had to revert to 6.5.

NinjaTrader_Jason
06-18-2010, 04:13 AM
Hello sam777,

Post #258 contains the VWAP which is compatible for NT 7 and was posted on 5/8/2010. I suspect this is the latest version of the Vwap.

NinjaTrader 7 is stable to use, however please note that it is still in beta fase.

Post #257 contains the Vwap as per NT 6.5, however I am not if this is the latest version.

sam777
06-21-2010, 05:47 AM
cannot load (import) the file vwap.cs in Ninjatrader

NinjaTrader_Kyle
06-21-2010, 06:54 AM
Hello sam777,

Do you receive an error message when attempting to import?

If so, please let me know what that message reports.

sam777
06-21-2010, 07:06 AM
I get error message when I import vwap.cs file in to Ninjatrader.

The error message is it is an invalid file type. The Ninjatrader Atchive file must be a *.zip file.

Thx

NinjaTrader_Kyle
06-21-2010, 07:12 AM
Hi sam777,

Thanks for the clarification.

Please take the following steps to successfully import VWAP.

1.) Shut down NinjaTrader.

2.) Open the following directory and add VWAP.cs:
My Documents > NinjaTrader 7 > bin > Custom > Indicator.

3.) Restart NinjaTrader 7.

4.) From the Control Center, click Tools > Edit NinjaScript > Indicator.
Next, double click on any indicator to load it's code.
In the code window, right click and select Compile.

After compiling, exit the code window - VWAP should now be an available indicator.

sam777
06-21-2010, 10:05 AM
Thx for the reply. However, I use latest 6.5 version and not 7. Please let me know how to import vwap.cs in to 6.5

NinjaTrader_Kyle
06-21-2010, 10:20 AM
Hi sam777,

The steps would remain the same, but I'm not sure if the .cs file you downloaded is for use with version 6.5.

With that said, you might try downloading the indicator attached to post 1 and importing as you were attempting to earlier.

cunparis
06-22-2010, 06:54 AM
Hey guys I just got the vwap for nt7 from post 258 and I put it on a chart and I compare the vwap levels to my market delta chart and they're exactly the same.

I previously reported they were not but that was due to having different session start times. When the sessions are the same the vwap is the same. So you can open the chart with vwap mid session and it works just fine.

dmking
06-26-2010, 08:49 PM
Hi sam777,

Thanks for the clarification.

Please take the following steps to successfully import VWAP.

1.) Shut down NinjaTrader.

2.) Open the following directory and add VWAP.cs:
My Documents > NinjaTrader 7 > bin > Custom > Indicator.

3.) Restart NinjaTrader 7.

4.) From the Control Center, click Tools > Edit NinjaScript > Indicator.
Next, double click on any indicator to load it's code.
In the code window, right click and select Compile.

After compiling, exit the code window - VWAP should now be an available indicator.
Hi,

I followed the instructions given by NT Kyle; the code compiles and the Indicator show up but nothing Plots... Are there setting that need to be specified like calc on bar clse - T or F? What about Visual? What does that do? Does it work on all chart types?

TIA for the help.


dmk

dmking
06-26-2010, 08:53 PM
DOH!

I forgot to close the code window...

Restarted after that and it works... Thanks for making this available.

Iceman10
07-02-2010, 06:17 PM
Josh,

Regarding the VWAP/SDs coded indicator, do you have a text file version of it? I want to change it a bit.

Regards,
Halli.

mea109
07-09-2010, 03:50 PM
Hello everyone
has anyone tried it already to create an indicator that may represent a VWAP stock?
for example on a graph could see schedule
VWAP 30 minutes, or 5 minutes or any other unit

display a dot or bar in panel 2
thank you

NinjaTrader_Josh
07-09-2010, 04:14 PM
Iceman10,

No, I do not. The files available can already be edited though. They should all be either .zip files or .cs files which you can ultimately open in any text editor. Unfortunately this indicator was provided as a 3rd party indicator and has since spawned several spin off versions. I am no longer maintaining this code due to time constraints.

dmking
07-26-2010, 12:28 PM
Is there a problem running hVwap on one chart (say, Point & Figure) and VWAP on another (reversal)?

Right now, hVWAP works on the P&F chart, but VWAP will not work on the Reversal chart.

Any ideas?

TIA

sam777
08-10-2010, 03:28 PM
Looking at dvaluearea indicator parameters: Slot session color and slot pre-session color. I understand what it means but on close observation the length of each bar (say using TPO as the calculation method) looks just visual and not representing the actual TPO count as it should. Correct me if I am wrong? I hope POC and Vat and Vab are accurate based on TPO count or with the other by calculation choices.

I will try the hVWAP from post 194. I am not sure how different it is from dvaluearea other than showing the std. deviation lines and what else it does that dvaluearea doesn't.

Hope to get clarification.

Thx Sam

forrestang
10-10-2010, 11:01 PM
One question.....

Do you think this can be made where the user can drag and drop the start and end times to the current prices we want it to evaluate for? Instead of having to enter a specific time?

rperez
10-12-2010, 11:34 AM
Hi Josh... May I ask where can I learn to use the VWAP indicator?

NinjaTrader_Kyle
10-12-2010, 11:44 AM
Hello rperez,

Thanks for your post.

I just spoke with Josh - while he didn't have any specific resources to recommend, he did mention that a Google search should yield sufficient results.

rperez
10-12-2010, 12:03 PM
Thank you Kyle, I shall do that.

sjogia
10-14-2010, 02:24 AM
Re: cs file post 258: Please post the instruction on how I can load this indicator on N7. At the moment, my N7 does not recognise this file at all.
many thanks for all your help

jgrobertson
10-16-2010, 08:54 AM
Try www.alphatrends.net (http://www.alphatrends.net). He uses it a lot. To me this is the most important indicator after volume and price.

jgrobertson
10-16-2010, 09:44 AM
Re: cs file post 258: Please post the instruction on how I can load this indicator on N7. At the moment, my N7 does not recognise this file at all.
many thanks for all your help

An earlier post, 279 I think, has the instructions.

rperez
10-22-2010, 01:03 PM
Could somebody please tell me how can I call the hVWAP indicator from a strategy sending predetermined startTimeString and endTimeString parameters? I thought it could be possible by using a command such as:

_VWAP = hVWAP(Open).StartTimeString....from here on I'm lost.

Thanks.

rperez

Antraman
01-06-2011, 01:08 AM
can anyone say if ths works in 7.1000.1?

Pabloh
01-06-2011, 02:53 AM
Anyone can tell me how to put an alert on VWAP? I just want an alert that advise me when the price is crossing the VWAP line, thank you!

jgrobertson
01-06-2011, 08:36 AM
Josh,

Regarding the VWAP/SDs coded indicator, do you have a text file version of it? I want to change it a bit.

Regards,
Halli.
I have been looking all over for that. I was actually writing a script to do that for eSignal but then I discontinued their service. It seems so obvious but I don't find it on freestockcharts.com, EB TWS, or TOS.

nick9
01-20-2011, 02:39 PM
Hi sam777,

Thanks for the clarification.

Please take the following steps to successfully import VWAP.

1.) Shut down NinjaTrader.

2.) Open the following directory and add VWAP.cs:
My Documents > NinjaTrader 7 > bin > Custom > Indicator.

3.) Restart NinjaTrader 7.

4.) From the Control Center, click Tools > Edit NinjaScript > Indicator.
Next, double click on any indicator to load it's code.
In the code window, right click and select Compile.

After compiling, exit the code window - VWAP should now be an available indicator.
Kyle,

I got the vwap for nt7 from post 258 and installed it in the Indicators folder per your instructions, but there is nothing under Tools about editing scripts. I am using the latest version of Ninja 7. Can you (or anyone) tell me how to get vwap working in the latest Ninja 7?

Thanks

nick9

NinjaTrader_Kyle
01-20-2011, 02:44 PM
Hi nick9,

Those are still the right steps to take even in the current version. Have you tried this again?

nick9
01-20-2011, 03:18 PM
Hi nick9,

Those are still the right steps to take even in the current version. Have you tried this again?
There's no entry under Tools called Edit Ninja Script!

Anyway, I found a vwap zip file by another guy on your staff and imported it via File>Utilities>import Ninjascript and this worked. This seems to be the current method. Are you running the latest version of Ninja 7?

NinjaJJ
01-31-2011, 03:11 PM
Got it working! Nevermind

NinjaTrader_RyanM
01-31-2011, 03:39 PM
Hello NinjaJJ,

Welcome to the NinjaTrader forums!

Please take the following steps to place VWAP into your NT installation.

1.) Shut down NinjaTrader.

2.) Open the following directory and add VWAP.cs:
My Documents > NinjaTrader 7 > bin > Custom > Indicator.

3.) Restart NinjaTrader 7.

4.) From the Control Center, click Tools > Edit NinjaScript > Indicator.
Next, double click on any indicator to load it's code.
In the code window, right click and select Compile.

After compiling, exit the code window - VWAP should now be an available indicator.

NinjaJJ
01-31-2011, 04:28 PM
Thank you RyanM, appreciate your prompt reply!

Rodger11
03-20-2011, 07:51 PM
Hi Ryan,
I installed the VWAP indicator from a 2007 post!
I guess that this is out of date, I'm using NT7
Should I install the latest version? If so, how do I remove the existing installation?
Regards, Rodger

NinjaTrader_Kyle
03-21-2011, 07:01 AM
Hi Rodger11,

Thank you for your post and welcome to the NinjaTrader support forum!

We do reccomend using the most current release of NinjaTrader 7, but there's no requirement that you uninstall your existing version before installing the new release. Just shut NinjaTrader down and install over your existing copy.

You may download the current release of NinjaTrader via the following link: http://www.ninjatrader.com/webnew/download_download.htm

Johnny
03-23-2011, 10:17 AM
I just downloaded this indicator and it works like a charm. Many thanks! :)

However, I only have interest of the VWAP, not the bands.

How do I get rid of those?

I entered "0" in SD1,2,3 multiplier and got rid of most of it, but my VWAP line still had lots of blue in it, so I colored all the SD lines "transparent".

Problem solved.

But I suspect it might take power from my CPU by doing un-necessary computations? Any other way to rid those bands? Or is it only the computation of the VWAP itself that demands CPU power and not the bands? If so, this solution works for me.

Thanks!

Johnny

crosscreek
04-14-2011, 05:07 PM
There is an option to disable the bands. "Show Std Dev" = false.

xcel55
05-16-2011, 10:33 PM
Hi,

I just downloaded NT 7.0.1000.5 and I cannot get my VWAP indicator to work for this latest version of NT.I was using NT 7.0.1000.2 previously and the indicator worked fine. Does anyone know how to go about fixing this? Any help would be greatly appreciated!

paulg
05-17-2011, 01:46 PM
Hi,

I just downloaded NT 7.0.1000.5 and I cannot get my VWAP indicator to work for this latest version of NT.I was using NT 7.0.1000.2 previously and the indicator worked fine. Does anyone know how to go about fixing this? Any help would be greatly appreciated!


..do you mean hvwap, original vwap or ....?

xcel55
05-17-2011, 04:03 PM
..do you mean hvwap, original vwap or ....?

Original Vwap, not sure what hvwap is. But I was able to fix my problem already after contacting support. Thanks!

crosscreek
05-17-2011, 05:53 PM
What was the Fix? I am running it on 7.0 10004, want to make sure it will be ok when I upgrade

xcel55
05-17-2011, 06:42 PM
What was the Fix? I am running it on 7.0 10004, want to make sure it will be ok when I upgrade

It turns out since I have the free version, my license key does not allow me to edit ninjascript. So I contacted support and they sent me a sim license key so I can edit the ninjascript.

paulg
05-18-2011, 01:10 AM
Original Vwap, not sure what hvwap is. But I was able to fix my problem already after contacting support. Thanks!

...so what's the solution pls for the benefit of other forum members? ;)

xcel55
05-18-2011, 07:18 AM
...so what's the solution pls for the benefit of other forum members? ;)

Well here's what I did to make it work for me.
-copy the vwap.cs file to the "indicator" folder
-plug in the sim license key
-go to tools>edit ninjascript>indicator
-a list of your indicator pops up, click on vwap
-a window with the programming code pops up, close that
-close trading platform and restart it
-re-enter my live license key

Harry
05-29-2011, 07:23 PM
Have tested the VWAP indicator today against my own version of the VWAP and bands. The result was peculiar.

For some instruments (ES) the bands match well. This confirms that the same underlying logic has been used. For other instruments such as all currencies, the VWAP bands produced by the VWAP indicator from this forum do tno look right. See chart of DX attached.

To check the results, I have calculated the bands for the first bars of the session manually, and the results from the forum indicator came out ways too narrow. The silver chart below also shows that the standard deviation bands are not correct, as most of the price action of the first hour of the session is outside the 3 standard deviation bands.

Please compare the blue bands of the forum indicator, with the coral bands of my personal version, which I think is correct. I will make my indicator available shortly, so I would appreciate any comments.

crosscreek
05-29-2011, 07:40 PM
DX is not a currency per say. I suggest you take a look at a 6E chart/data or any other Globex pair.

Harry
05-30-2011, 05:05 AM
DX is not a currency per say. I suggest you take a look at a 6E chart/data or any other Globex pair.

Whether you take DX or 6E makes no difference, the VWAP from this forum returns false results. The chart below for 6E shows the correct bands (coral) and the false bands (blue) returned by the VWAP indicator.

In the meantime I have compared the NinjaTrader forum VWAP to the Sierra Chart VWAP. That comparison also showed that the VWAP bands that can be found here are not usable.

The VWAP itself, however, matches very well with all other VWAPs. I am only talking about the bands. Chart for 6E attached.

djkiwi
05-30-2011, 08:44 PM
Hi Harry, thanks for confirming this as I have suspected this for sometime as the 1st SD seemed nonsensical. Do you by any chance have a snippet of code to include in the ninjatrader version to correct this issue?

Thanks
DJ

paulg
05-31-2011, 01:31 AM
[...] Chart for 6E attached.

Hi Harry,
Thanks for your contribution; could you please repost a new chart for 6E with the differences?

Harry
05-31-2011, 04:36 AM
Hi Harry, thanks for confirming this as I have suspected this for sometime as the 1st SD seemed nonsensical. Do you by any chance have a snippet of code to include in the ninjatrader version to correct this issue?

Thanks
DJ

Let me try to explain first how VWAP bands are calculated.

Typical calculation of Standard Deviation

The typical way to calculate a standard deviation is to measure the (vertical) distances of all data point of the trading session from the average, square them, add up the volume weighted squares and then calculate the square root of the sum. The value for the average used is the current (last) value of the average.

I have seen that there is a modified version of the flawed VWAP around, which is called hVWAP. It uses this method.

Alternative Calculation for Standard Deviation for VWAP

For the VWAP bands I am not so much interested in the distance of a data point this morning from the value of the average this afternoon, so instead of calculating the variance relative to the current value of the average, I will calculate the variance of all the distances measured between the data point and the corresponding value of the moving average- So the 10:00 AM close will be compared to the VWAP value at 10:00 AM to calculate the distance. The standard deviation will reflect the distribution of all these vertical distances.

The alternative calculation has several advantages: On trending days the typical calculation as shown above will incorporate the trend shift into the variance and therefore produce larger standard deviations. The alternative calculation eliminates the trend shift and shows the dispersion of the data points around the VWAP. This is what is needed for trading. The second advantage is that the algorithm for the alternative way of calculating is about 10 to 15 times faster, so you can use an indicator on high resolution tick charts as well.

Let me add here, that the results I have seen from Sierra Chart and Inversotr R/T also point to this solution

A third simple way of drawing bands: Use the Session Range

There is another easy way of drawing volatility bands around the VWAP. You can just take the developing range of the current session - calculated from the current session high and low - divide by four to get the quarter range. Then use this quarter range instead of the standard deviation as an offset for the bands.

Forum VWAP

Sorry it does not display bands in line with any of the alternative models.


I am currently working on an indicator that will have an option to use the three alternative models explained above. The indicator will be available for free. If you want to test it, send me a private message.

Below are shown the results for the three approaches and for the forum VWAP. This was a non-trending day for GC, so the results for the 3 different models are surprisingly similar.

Harry
05-31-2011, 04:52 AM
Hi Harry,
Thanks for your contribution; could you please repost a new chart for 6E with the differences?

I love this question, because CME has a double day trading session becuase of Memorial Day, so you would calculate the VWAP with the bands for that double session, proivded that the indicator can cope with that.

Below VWAP and bands for the complete trading session. Alternatively you could display VWAP and bands for the regular trading hours only.

cassb
06-03-2011, 12:43 PM
Does anyone know why the VWAP calculations would reset at 5pm instead of at midnight like I have it set to in the indicator? I cannot seem to get mine to reset at midnight! See attached screen shot...

My session is set to Default 24/7. This chart is for 6B.

Thanks!
Bryan

Harry
06-08-2011, 01:02 PM
5 P.M is the session break, the VWAP will only calculate within the current session. If you change your session template to match the start time, it should work.

But why do you bother, as it does not calculate the bands correctly?


Does anyone know why the VWAP calculations would reset at 5pm instead of at midnight like I have it set to in the indicator? I cannot seem to get mine to reset at midnight! See attached screen shot...

My session is set to Default 24/7. This chart is for 6B.

Thanks!
Bryan

Harry
06-22-2011, 05:52 AM
Here is a link to the last version of the Session VWAP and Session TWAP. It addresses the problems of the NInjaTrader VWAP

-> in Variance_Distance and Session_Range mode the SessionVWAP is about 10 to 15 times faster (depending on session length) than the VWAP discussed in this thread

-> the VWAP in this thread sometimes calculates completely false standard deviation bands, therefore you should either use the hVWAP, which has the bug corrected but is slow as well, or use the versions below:

http://www.bigmiketrading.com/free_downloads/ninjatrader-7/indicators/674-download.html
http://www.bigmiketrading.com/free_downloads/ninjatrader-7/indicators/934-download.html?view

The chart attached shows why the VWAP from this forum cannot be recommended.

paulg
06-22-2011, 07:05 AM
Here is a link to the last version of the Session VWAP and Session TWAP. It addresses the problems of the NInjaTrader VWAP

-> in Variance_Distance and Session_Range mode the SessionVWAP is about 10 to 15 times faster (depending on session length) than the VWAP discussed in this thread

-> the VWAP in this thread sometimes calculates completely false standard deviation bands, therefore you should either use the hVWAP, which has the bug corrected but is slow as well, or use the versions below:

http://www.bigmiketrading.com/free_downloads/ninjatrader-7/indicators/674-download.html
http://www.bigmiketrading.com/free_downloads/ninjatrader-7/indicators/934-download.html?view

The chart attached shows why the VWAP from this forum cannot be recommended.


Harry,

Could you please compare your Session versions with the hVWAP (post # 194)that originally has been released to be better compatible with NT7 and with some fixed bugs?

http://www.ninjatrader.com/support/forum/showpost.php?p=131235&postcount=194

Harry
06-22-2011, 07:48 AM
Harry,

Could you please compare your Session versions with the hVWAP (post # 194)that originally has been released to be better compatible with NT7 and with some fixed bugs?

http://www.ninjatrader.com/support/forum/showpost.php?p=131235&postcount=194

The hVWAP calculates correctly and produces near-identical results to the SessionVWAP in Variance_Last mode. Variance_Last means that the bands are calculated as Bollinger Bands for a VWMA, with the VWMA and bands increasing the period with each bar.

These are the differences between the hVWAP and the SessionVWAP

Session Times: You have to enter them manually for the hVWAP, while the SessionVWAP catches them from the session template used.

VWAP: The hVWAP calculates the VWAP from the input value (default value: close), while the session VWAP uses (high + low + open + close)/4 to track the volume weighted average price with higher accuracy.

VWAP bands: Both hVWAP and SessionVWAP in Variance_Last mode calculate the bands by using the variance calculated from all input values of the defined session and the last value of the VWAP.

I have an old version of my VWAP, which still used the close instead of (high+low+open+close)/4, and this version perfectly matches the hVWAP in Variance_Last mode, if the same sessions are selected.

If you use it Variance_Last mode, the SessionVWAP is slower than the hVWAP, if you use it in Variance_Distance or Session_Range mode, it is considerably faster.

paulg
06-22-2011, 08:03 AM
Harry,

I'm glad I'm using a good VWAP, thanks to the hVWAP ;)

But which is the best indicator to use in order to manage the weekly VWAP?

I used to use hegh2000 iVWAP_W (post #168 &236) but I'm not sure it's correct.

cassb
06-22-2011, 08:10 AM
5 P.M is the session break, the VWAP will only calculate within the current session. If you change your session template to match the start time, it should work.

But why do you bother, as it does not calculate the bands correctly?

Thanks for the reply, Harry. I did have the session set to Default 24/7 and still it recalculated at 6pm. But since then, I have changed to using the hVWAP instead and it works as expected now.

I don't use the SD bands, just the VWAP line itself. How does your version compare to hVWAP?

Thanks!
Bryan

crosscreek
06-22-2011, 08:32 AM
Do you use tick or range charts? I have noticed that I get a more accurate reading when using time charts (minutes).

cassb
06-22-2011, 08:44 AM
Do you use tick or range charts? I have noticed that I get a more accurate reading when using time charts (minutes).

I was using it on a 2 Range chart, Calculate on Bar Close = true. It seems to work OK for me, although I don't display the std. dev. lines.

Harry
06-22-2011, 11:52 AM
Thanks for the reply, Harry. I did have the session set to Default 24/7 and still it recalculated at 6pm. But since then, I have changed to using the hVWAP instead and it works as expected now.

I don't use the SD bands, just the VWAP line itself. How does your version compare to hVWAP?

Thanks!
Bryan

If you do not use the SD bands, all VWAPs are similar. You may get inaccurate values if you use it on 10 min charts or larger time period, due to the resolution. All the VWAPs will get you precise information on a 1 min chart or a high resolution tick charts.

cassb
06-22-2011, 12:04 PM
If you do not use the SD bands, all VWAPs are similar. You may get inaccurate values if you use it on 10 min charts or larger time period, due to the resolution. All the VWAPs will get you precise information on a 1 min chart or a high resolution tick charts.

All the VWAPs except for the one supplied by NinjaTrader. It does not reset at midnight when you set it to start at 0:00:00. It still resets at 6pm.

Harry
06-22-2011, 02:52 PM
All the VWAPs except for the one supplied by NinjaTrader. It does not reset at midnight when you set it to start at 0:00:00. It still resets at 6pm.

t resets at the session break. If you use a session template with a session end at 6:00Pm, it will reset there.

I suspect that you use the 24/7 session template, which is inappropriate for all futures and FOREX instruments that I kwow. Use a correct session template, enter it under instrument settings, open all charts in <use instrument settings> mode, and never ever use 24/7 again. http://www.ninjatrader.com/support/forum/images/smilies/biggrin.png

And even the VWAP will work (but don't use the bands).

cassb
06-22-2011, 02:59 PM
t resets at the session break. If you use a session template with a session end at 6:00Pm, it will reset there.

I suspect that you use the 24/7 session template, which is inappropriate for all futures and FOREX instruments that I kwow. Use a correct session template, enter it under instrument settings, open all charts in <use instrument settings> mode, and never ever use 24/7 again. http://www.ninjatrader.com/support/forum/images/smilies/biggrin.png

And even the VWAP will work (but don't use the bands).


Yeah, but what if you want the VWAP to reset at midnight and not at the session end time?

Harry
06-22-2011, 03:18 PM
Yeah, but what if you want the VWAP to reset at midnight and not at the session end time?

Why do you want it to reset at midnight? My midnight is different from yours and the only thing that really counts is the trading day as defined per exchange. And this should be reflected by your template.

Why do you want to reset it in the middle of the night session? Does not make sense, does it? :rolleyes:

cassb
06-22-2011, 08:06 PM
Why do you want it to reset at midnight? My midnight is different from yours and the only thing that really counts is the trading day as defined per exchange. And this should be reflected by your template.

Why do you want to reset it in the middle of the night session? Does not make sense, does it? :rolleyes:

'Cause that's how we roll here in NY, my friend. :-)

paulca
09-04-2011, 06:30 PM
Here is a link to the last version of the Session VWAP and Session TWAP. It addresses the problems of the NInjaTrader VWAP

-> in Variance_Distance and Session_Range mode the SessionVWAP is about 10 to 15 times faster (depending on session length) than the VWAP discussed in this thread

-> the VWAP in this thread sometimes calculates completely false standard deviation bands, therefore you should either use the hVWAP, which has the bug corrected but is slow as well, or use the versions below:

http://www.bigmiketrading.com/free_downloads/ninjatrader-7/indicators/674-download.html
http://www.bigmiketrading.com/free_downloads/ninjatrader-7/indicators/934-download.html?view

The chart attached shows why the VWAP from this forum cannot be recommended.

Hi Harry,

are the 2 downloads from bigmike your implementation?

Thxs,

Paul

paulca
09-04-2011, 06:32 PM
Here is a link to the last version of the Session VWAP and Session TWAP. It addresses the problems of the NInjaTrader VWAP

-> in Variance_Distance and Session_Range mode the SessionVWAP is about 10 to 15 times faster (depending on session length) than the VWAP discussed in this thread

-> the VWAP in this thread sometimes calculates completely false standard deviation bands, therefore you should either use the hVWAP, which has the bug corrected but is slow as well, or use the versions below:

http://www.bigmiketrading.com/free_downloads/ninjatrader-7/indicators/674-download.html
http://www.bigmiketrading.com/free_downloads/ninjatrader-7/indicators/934-download.html?view

The chart attached shows why the VWAP from this forum cannot be recommended.
I'll just try that again Harry - are the two bigmike downloads your VWAP implementation?

Harry
09-05-2011, 06:56 AM
I'll just try that again Harry - are the two bigmike downloads your VWAP implementation?

Yes, they are. I have also coded TWAPs, and (not published so far) rolling VWAPs, and trendfilters built from VWAPs.

Do not hesitate to come back via private message, if you have any questions.

paulca
09-05-2011, 04:15 PM
Yes, they are. I have also coded TWAPs, and (not published so far) rolling VWAPs, and trendfilters built from VWAPs.

Do not hesitate to come back via private message, if you have any questions.

Nice piece of code Harry, looks like you have a good deal of knowledge on NT internals. Thanks again for sharing and I do have a few questions I'll PM you with.

Paul

thavva
10-14-2011, 10:58 PM
Friends,

How to get this indicator added to Ninja Trader system? Or point me to a thread on how to add customer indicator.

Thanks,
Thavva

NinjaTrader_AdamP
10-15-2011, 03:11 PM
thavva,

You can import indicators from .zip format in NinjaTrader by going to File > Utilities > Import NinjaScript. Then, navigate to the location of the indicator and select open.

If the indicator is a .cs file, you will need to put it in My Documents / NinjaTrader 7 / bin / Custom / Indicator, then, in NinjaTrader, go to Tools > Edit NinjaScript > Open the Indicator you added, hit the compile button at the top of the toolbar in the editor window.

Please let me know if I can assist further.

mirkocero
11-12-2011, 03:11 AM
Hi everyone!
I need help!
I would like to obtain a determinate number of decimals after the comma for the vwap and standard deviation lines. Infact now they have a lot of decimals because they are double variables. Where I can find the variables to modify? Is it correct to use the line Values.ToString? I tried for VWAPLine. For example, to have 2 decimals:
Values.ToString("0,00")
but this doesn't work.
And if I wanna have an integer value?

Thanks!

Harry
11-12-2011, 05:49 AM
Hi everyone!
I need help!
I would like to obtain a determinate number of decimals after the comma for the vwap and standard deviation lines. Infact now they have a lot of decimals because they are double variables. Where I can find the variables to modify? Is it correct to use the line Values.ToString? I tried for VWAPLine. For example, to have 2 decimals:
Values.ToString("0,00")
but this doesn't work.
And if I wanna have an integer value?

Thanks!

Do you want to code an indicator or to use an indicator? The SessionVWAP auto-adjusts the number of decimals to the instrument. For example you will get an integer value for YM, because YM trades in whole points. Chart attached.

If you want to code an indicator, you would need to use FormatPriceMarker().

sbgtrading
11-12-2011, 12:45 PM
Hi everyone!
I need help!
I would like to obtain a determinate number of decimals after the comma for the vwap and standard deviation lines. In fact now they have a lot of decimals because they are double variables. Where I can find the variables to modify? Is it correct to use the line Values.ToString? I tried for VWAPLine. For example, to have 2 decimals:
Values.ToString("0,00")
but this doesn't work.
And if I wanna have an integer value?

Thanks!

Are you getting an error at compile time? If so, you should try this: Values[0].ToString("0.00"). And if you wanted it rounded to the nearest integer, you'd use Values[0].ToString("0")

Those will compile ok...again assuming that you were having a problem at the compilation stage.

koganam
11-12-2011, 01:14 PM
Hi everyone!
I need help!
I would like to obtain a determinate number of decimals after the comma for the vwap and standard deviation lines. Infact now they have a lot of decimals because they are double variables. Where I can find the variables to modify? Is it correct to use the line Values.ToString? I tried for VWAPLine. For example, to have 2 decimals:
Values.ToString("0,00")
but this doesn't work.
And if I wanna have an integer value?

Thanks!

What exactly are you trying to achieve?


You want the actual values as plotted by the indicator to be rounded before they are plotted?
You want to output rounded values to the OutputWindow or an external file?

mirkocero
11-13-2011, 09:09 AM
Hi sbgtrading and thanks for the answer!

I try to correct in this way:

public DataSeries VWAPLine
{
get { return Values[0].ToString("0.00");}
}

But this is the error (attached)

Where I did wrong?

Thanks a lot!

mirkocero
11-13-2011, 09:14 AM
Hi koganam! Thank you very much for your help.

I would like to obtain what you're writing in your first solution.

I tried using the help of sbgtrading but it didn't work.

Thanks!

mirkocero
11-13-2011, 09:19 AM
Hello Harry!

I don't need to code a new indicator. I just want to modify that existing obtaining a series of dots for vwap and standard deviations as you are doing in your chart. (I use volume and NOT minute like Period Type).

Thanks!

Harry
11-13-2011, 10:20 AM
I have daily and weekly VWAPs and TWAPs published here:

http://www.bigmiketrading.com/download/ninjatrader-7/indicators/674-download.html?view

koganam
11-13-2011, 12:38 PM
Hi koganam! Thank you very much for your help.

I would like to obtain what you're writing in your first solution.

I tried using the help of sbgtrading but it didn't work.

Thanks!

There are 2 choices then.

1. The more elegant is to round to the TickSize, thus ensuring that your values are always to the same precision as the price data:
Instrument.MasterInstrument.Round2TickSize(Values) ;2. Round to a specific number of deciimal places:
Math.Round(Values, 2, MidpointRounding.AwayFromZero);will round to 2 decimal places. Replace that number to specify how many decimal places you desire.

mirkocero
11-14-2011, 08:16 AM
There are 2 choices then.

1. The more elegant is to round to the TickSize, thus ensuring that your values are always to the same precision as the price data:
Instrument.MasterInstrument.Round2TickSize(Values) ;2. Round to a specific number of deciimal places:
Math.Round(Values, 2, MidpointRounding.AwayFromZero);will round to 2 decimal places. Replace that number to specify how many decimal places you desire.

Hy koganam! I'm trying with both your solution. Thank you very much. Sure, I prefer the first one because I trade other different instrument.
I add the line of code in the OnBarUpdate event using a null reference first: if (Instrument != null). Where I'm wrong? The compiling is OK but the vwap hasn't the desire format; it's always with a lot of decimals...

if (Instrument!= null)
{
Instrument.MasterInstrument.Round2TickSize(VWAPLin e[0]);
}

I think I'm wrong about the place where I insert the code... but I try a lot of place. Result: always too much decimals...
Is it correct adding the lines that you suggested to me in other part of the code like Properties or Miscellaneous? Or in the Plot section?

Thanks a lot for the great help!

mirkocero
11-14-2011, 08:19 AM
I have daily and weekly VWAPs and TWAPs published here:

http://www.bigmiketrading.com/download/ninjatrader-7/indicators/674-download.html?view

Hi Harry! Thanks a lot but I'm not an Elite Member so I can't try your indicator. Maybe in the future...

Harry
11-14-2011, 08:44 AM
Hi Harry! Thanks a lot but I'm not an Elite Member so I can't try your indicator. Maybe in the future...

Send me a private message, I don't mind sending it via e-mail.

Also you could copy the code of this indicator, as it uses FormatPriceMarker() to format the indicator values.

koganam
11-14-2011, 09:58 AM
Hy koganam! I'm trying with both your solution. Thank you very much. Sure, I prefer the first one because I trade other different instrument.
I add the line of code in the OnBarUpdate event using a null reference first: if (Instrument != null). Where I'm wrong? The compiling is OK but the vwap hasn't the desire format; it's always with a lot of decimals...

if (Instrument!= null)
{
Instrument.MasterInstrument.Round2TickSize(VWAPLin e[0]);
}

I think I'm wrong about the place where I insert the code... but I try a lot of place. Result: always too much decimals...
Is it correct adding the lines that you suggested to me in other part of the code like Properties or Miscellaneous? Or in the Plot section?

Thanks a lot for the great help!

You want to format your value before you put it into the Set() statement, or in the Set() statement itself. From what you write here, it seems that you are formatting after the Plot() has already been set, so it will have no effect.

So, in this case, the volwap line is the one that you would modify to format the output. One way would be:
volwap = vwap(volumearray, pricearray);
volwap = Instrument.MasterInstrument.Round2TickSize(volwap) ;as that is eminently more readable that doing it on one line, as for example:
volwap = Instrument.MasterInstrument.Round2TickSize(vwap(vo lumearray, pricearray));

mirkocero
11-21-2011, 08:43 AM
Ok! Now it's work! :D

I made the same changes for the SDs.

Thanks a lot!

Mirko