NexusFi: Find Your Edge


Home Menu

 





VWAP bands


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 44 posts (111 thanks)
    2. looks_two syxforex with 10 posts (6 thanks)
    3. looks_3 Big Mike with 8 posts (6 thanks)
    4. looks_4 forrestang with 8 posts (1 thanks)
      Best Posters
    1. looks_one gtichauer with 7 thanks per post
    2. looks_two Fat Tails with 2.5 thanks per post
    3. looks_3 Big Mike with 0.8 thanks per post
    4. looks_4 syxforex with 0.6 thanks per post
    1. trending_up 65,281 views
    2. thumb_up 153 thanks given
    3. group 33 followers
    1. forum 102 posts
    2. attach_file 49 attachments




 
Search this Thread

VWAP bands

  #51 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


forrestang View Post
Do you mean like this:

 
Code
#region Using declarations
using System;
using System.Diagnostics;
using System.ComponentModel;
using System.Collections;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion

#region Global Enums

public enum anaSessionTypeVWAP33 {ETH, RTH, RTH_Multi}
public enum anaSessionCountVWAP33 {First, Second, Third, Hybrid}
public enum anaBandTypeVWAP33 {Variance_Distance, Variance_Last, Session_Range, None} 

#endregion
I am still getting quite a few errors. Have you called for these values in this study from another place before?

You do not need to recode the enums, but as they are enums, you need to call them this way:

 
Code
if(anaCurrentDayVWAPV33(Input, anaBandTypeVWAP33.Variance_Distance, anaSessionTypeVWAP33.ETH,         
1.0, 2.0, 3.0,  anaSessionCountVWAP33.Hybrid).UpperBand3.Contains  Value(0))             
         udSd3[0] = anaCurrentDayVWAPV33 (Input, anaBandTypeVWAP33.Variance_Distance,
         anaSessionTypeVWAP33.ETH, 1.0, 2.0, 3.0,  anaSessionCountVWAP33.Hybrid).UpperBand3[0];

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
GFIs1 1 DAX trade per day journal
11 thanks
HumbleTraders next chapter
11 thanks
  #52 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

I'm not sure what you mean? I have that particular line you named in my script. I'm not sure what I need to do to reference your study?

Attached Files
Elite Membership required to download: FPJPStudy.cs
Reply With Quote
  #53 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


I got it. There were some erroneous 'D' s in there, I highlighted one or two of them.

 
Code
if(anaCurrentDayVWAPV33(Input, anaBandTypeVWAPD33.Variance_Distance, anaSessionTypeVWAPD33.ETH,1.0, 2.0, 3.0,  anaSessionCountVWAPD33.Hybrid).UpperBand3.Contains  Value(0))             
         udSd3[0] = anaCurrentDayVWAPV33 (Input, anaBandTypeVWAPD33.Variance_Distance,  anaSessionTypeVWAP[COLOR="rgb(255, 140, 0)"]D[/COLOR]33.ETH, 1.0, 2.0, 3.0,  anaSessionCountVWAPD33.Hybrid).UpperBand3[0];
Still in the first line, where the 'if' is, that is causing a parsing error for some reason. I.e. if I make the changes to those erroneous Ds, and comment out the 'if' statement, it will reference that value correctly.

Reply With Quote
  #54 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


forrestang View Post
I got it. There were some erroneous 'D' s in there, I highlighted one or two of them.

 
Code
if(anaCurrentDayVWAPV33(Input, anaBandTypeVWAPD33.Variance_Distance, anaSessionTypeVWAPD33.ETH,1.0, 2.0, 3.0,  anaSessionCountVWAPD33.Hybrid).UpperBand3.Contains  Value(0))             
         udSd3[0] = anaCurrentDayVWAPV33 (Input, anaBandTypeVWAPD33.Variance_Distance,  anaSessionTypeVWAP[COLOR="rgb(255, 140, 0)"]D[/COLOR]33.ETH, 1.0, 2.0, 3.0,  anaSessionCountVWAPD33.Hybrid).UpperBand3[0];
Still in the first line, where the 'if' is, that is causing a parsing error for some reason. I.e. if I make the changes to those erroneous Ds, and comment out the 'if' statement, it will reference that value correctly.

The "ContainsValue" must be one word. It has been cut into 2 pieces by the forum software, I cannot even change it.

Yes, you are right for the "Ds". Reason is that I do not have the VWAP33 installed anymore, as I am running a newer version. With V35 I had introduced the PD for the daily VWAP, as I needed to differentiate it from the weekly VWAP which has a PW in its enums. It is not possible to use identical enums for several indicators. Each indicator needs to have a different enum, because otherwise they interfere and produce compiler errors.

Have not had the time to make all the required updates in the download section of the forum. I have simply posted too many indicators to catch up.

Reply With Quote
Thanked by:
  #55 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

@Fat Tails
Do you have any studies that have a POC in them? I need to find a study that has a POC I can reference, and the one I have (CalculateDevelopingValueArea) of course I'm having trouble referencing that value.

I need one that leaves a ghost image of where it was, similar to the picture I have attached.

Attached Thumbnails
Click image for larger version

Name:	poc.png
Views:	277
Size:	13.2 KB
ID:	44455  
Reply With Quote
  #56 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599


josh View Post
A poster by the name of jperl over at TL posted a series of threads entitled "Trading With Market Statistics" .. google it and you will find tons of info on trading with vwap and SD bands.

You are free to link to other forums directly. This isn't TL or T2W after all...

But where possible, why not create the discussion here on futures.io (formerly BMT) as well if you found it to be a useful topic?

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #57 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post
@Fat Tails
Do you have any studies that have a POC in them? I need to find a study that has a POC I can reference, and the one I have (CalculateDevelopingValueArea) of course I'm having trouble referencing that value.

I need one that leaves a ghost image of where it was, similar to the picture I have attached.

@Fat Tails
I managed to reference that value from the study I was using. So no worries, thanks bud!

Reply With Quote
Thanked by:
  #58 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


forrestang View Post
@ Fat Tails
Do you have any studies that have a POC in them? I need to find a study that has a POC I can reference, and the one I have (CalculateDevelopingValueArea) of course I'm having trouble referencing that value.

I need one that leaves a ghost image of where it was, similar to the picture I have attached.

Just send me your indie, and I will tell you how to reference it - or is it compiled?

Reply With Quote
  #59 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010

Hey FatTails, do you have a multisession VWAP?



Fat Tails View Post
So finally, I have finished a test version of the VWAP + bands indicator. It was a real headache.

I have found three ways to define volatility bands around the VWAP.

(1) Use the variance based on the distance of price from the corresponding value of the VWAP

Please not that this is not the way Bollinger Bands work. Typically you measure the distance of price from the last data point of the average not from the corresponding value. This method will generate narrower bands than the orthodox way, particularly on trending days.

(2) Use the variance based on the distance of price from the current (last) value of the VWAP

These bands are more like Bollinger Bands and will be wider on trending days.

(3) Replace the standard deviation with the quarter range of the current session as it develops.

The indicator allows you to choose between the three options. (1) is the default option and will possibly get you the best results. Also I managed to find an algorithm for (1) which is 15 times faster than the original one, so it is easy to use the indicator on small period tick charts now.

I have then added an option for coloring the band areas. This slows down the indicator loading time. If you want to use the indicator on high resolution charts, please set 'Opacity = 0'. The indicator will then work faster, but the ranges between the VWAP bands will not be colored.

Options

SessionType ETH: The VWAP is calculated for the full trading day.
SessionType RTH: The VWAP is calculated for the selected RTH session, After the close of that session the values will further be displayed, if the following session(s) still belong to the same trading day. However, the values will no more be updated.
SessionType RTH-Multi: Same as RTH, but the values will be updated. You can use this setting for displaying a VWAP over the second and third intraday session of the trading day.
BandType Variance_Distance: The default setting for BandType is Variance_Distance. In this case the indicator will draw the bands by calculating multiples as selected of the standard deviation of price relative to the corresponding value of the VWAP.
BandType Variance_Last: In this case the indicator will determine the bands by calculating multiples as selected of the standard deviation of price relative to the current (last) value of the VWAP.

BandType Session_Range: If this option is selected, the offset of the bands from the VWAP is calculated as a multiple of the quarter range. The quarter range is 1/4 of the current's session range, session as selected for the VWAP.
Multipliers: For each of the bands the multipliers can be selected. Default values are 1,2 and 3, so the indicator will display

-> 1, 2 and 3 standard deviation bands in Variance mode
-> 1, 2 and 3 times the quarter range as measured from the VWAP in SessionRange mode

Hybrid: This is my personal setting, which selects the 3rd RTH session for FOREX and all currencies, but the second RTH session for all other instruments. You do not need to use it.
Holiday Settings: As usual the indicator will recognize special holiday rules for CME, so if there is no bug it should display a single session for Memorial Day and the next session.

As the indicator is quite complex, please do expect minor bugs. That is the reason that it is posted here and not in the Download Section of the forum. In particular, I still want to check the bahavior for holiday sessions.


Visit my NexusFi Trade Journal Reply With Quote
  #60 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



syxforex View Post
Hey FatTails, do you have a multisession VWAP?

The question is what you call a multi-session VWAP.

The standard VWAP in the downloads allows you to select between three modes: ETH, RTH and RTH_Multi.

Let us take for example CL and assume that you have divided the day into three sessions: the night session (6:00 PM to 9:00 AM), the RTH session (9:00 AM to 2:30 PM) and the after session (2:30 PM to 5:00 PM). This is possible:

ETH: VWAP will be calculated for the entire trading day.
RTH 1: VWAP will only be calculated for the night session (first segment).
RTH 2: VWAP will only be calculated for the RTH session (second segment).
RTH-Multi 2: VWAP will be calculated for the RTH session (second segment) calculation will be continued into the after-session (third segment).

If you are talking about a weekly VWAP with standard deviation bands, I think I have it somewhere, but I still need to rework that one a little bit.

I also think I have done a version that compares 1-day VWAP (average price of the current day) with a 2-day VWAP (average price over a 2-day-period) and a 3-day VWAP. But that one is still experimental.

I also plan to code a multi- timeframe VWAP, as the accuracy is not yet good on longer period (> 10 min ) charts. VWAP is a typical example, where the resolution matters:

-> on small period tick charts it will possibly never stop calculating and exhaust your CPU
-> on large period charts it will be inaccurate

So in the two cases it is better to load a 1-minute series and use it to calculate the VWAP. This will solve both the CPU and accuracy problems.

But what do you look for?

Reply With Quote




Last Updated on March 6, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts