NexusFi: Find Your Edge


Home Menu

 





TS/MC: VWAP with standard deviation indicator.


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one Big Mike with 2 posts (5 thanks)
    2. looks_two pmat with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Insearch with 1 posts (0 thanks)
    1. trending_up 14,715 views
    2. thumb_up 5 thanks given
    3. group 7 followers
    1. forum 9 posts
    2. attach_file 0 attachments




 
Search this Thread

TS/MC: VWAP with standard deviation indicator.

  #1 (permalink)
 
marcovth's Avatar
 marcovth 
Canada
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES,6E
Posts: 25 since Jun 2010
Thanks Given: 1
Thanks Received: 30

Hello ...

I am looking for a TS/MultiCharts VWAP indicator with standard deviation bands as shown in this MarketDelta video.
Created by Camtasia Studio 6

Thanks in advance incase you can find/code that for me.

- Marco.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Are there any eval firms that allow you to sink to your …
Traders Hideout
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #3 (permalink)
Insearch
East Windsor, NJ
 
Posts: 5 since Jul 2010
Thanks Given: 1
Thanks Received: 0


Not sure about TS/MC, but can you code a little. I know there's a nice VWAP indicator on the NT support forum, which you might be able to glean code from?

Reply With Quote
  #4 (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,396 since Jun 2009
Thanks Given: 33,172
Thanks Received: 101,536

Here is EasyLanguage VWAP Hourly with standard deviation:

 
Code
                            


{***********************************************************************************************

Coded by dbntina/boxmeister 8/2/2007

Used the VWAP_H code provided by Tradestation on 02
/07/2003 Topic ID 6735 Thanks Guys!

Added the computation for variance and the Standard Deviation to combine into one indicator
plot 
and this indicator plots the VWAPSD1 bands and SD2 bands

***********************************************************************************************}



    [
LegacyColorValue true];
    
inputs:
    
iStartTime (0800),
    
ResetMinutes (60);


    
    
    
    


    
vars:
        
PriceW(0),
        
ShareW(0),
        
Count(0),
        
VolWAPValue(0),
        
VolWAPVariance(0),
        
VolWAPSD(0);
        

    if 
mod( (TimeToMinutes(time)-TimeToMinutes(iStartTime) ), TimeToMinutes(ResetMinutes) ) = 0 then 
    begin
        PriceW 
0;
        
ShareW 0;
        
Count = -1;
        
Value1 0;
        
Value2 0;
        
VolWAPValue 0;
    
end;

    
PriceW PriceW + (AvgPrice * (UpTicks+DownTicks));
    
ShareW ShareW + (UpTicks+DownTicks);
    
Count Count 1;
    
Value3 0;

    if 
ShareW 0 then VolWAPValue PriceW ShareW;

    {
Calculate the individual variance terms for each intraday bar starting with the current
    bar 
and looping back through each bar to the start bar.  The terms are each normalized
    according to the Variance formula 
for each level of volume at each price bar            }

     For 
Value1 0 To Count Begin
        Value2 
= ((UpTicks[Value1]+DownTicks[Value1])/ShareW) * (Square(AvgPrice[Value1]-VolWAPValue));
        
Value3 Value3 Value2;
    
End;

    
VolWAPVariance Value3;
    
VolWAPSD SquareRoot(VolWAPVariance);


    
Plot1(VolWAPValue"VWAP");
    
Plot2(VolWAPValue VolWAPSD"VWAP1SDUp");
    
Plot3(VolWAPValue VolWAPSD"VWAP1SDDown");
    
Plot4(VolWAPValue + (2*VolWAPSD), "VWAP2SDUp");
    
Plot5(VolWAPValue - (2*VolWAPSD), "VWAP2SDDown"); 
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
  #5 (permalink)
 cbratton 
Cebu, Philippines
 
Experience: Advanced
Platform: NinjaTrader
Trading: Emini ES
Posts: 71 since Oct 2009
Thanks Given: 128
Thanks Received: 118

Has anyone converted this to NT7?

Reply With Quote
  #6 (permalink)
 pmat 
Paris
 
Experience: Beginner
Platform: MultiCharts, Visual Charts
Trading: Index Futures, Stocks
Posts: 15 since Apr 2011
Thanks Given: 35
Thanks Received: 9

Hello everybody,

obviously some parts of the code where converted into smileys here :

if mod( (TimeToMinutes(time)-TimeToMinutes(iStartTime) , TimeToMinutes(ResetMinutes) = 0 then

could you tell me what is missing ?

Thank you very much in advance.

Reply With Quote
  #7 (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,396 since Jun 2009
Thanks Given: 33,172
Thanks Received: 101,536


pmat View Post
Hello everybody,

obviously some parts of the code where converted into smileys here :

if mod( (TimeToMinutes(time)-TimeToMinutes(iStartTime) , TimeToMinutes(ResetMinutes) = 0 then

could you tell me what is missing ?

Thank you very much in advance.

It isn't supposed to do that, sorry.


if mod( (TimeToMinutes(time)-TimeToMinutes(iStartTime) ), TimeToMinutes(ResetMinutes) ) = 0 then
begin
PriceW = 0;
ShareW = 0;
Count = -1;
Value1 = 0;
Value2 = 0;
VolWAPValue = 0;
end;


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
Thanked by:
  #8 (permalink)
 pmat 
Paris
 
Experience: Beginner
Platform: MultiCharts, Visual Charts
Trading: Index Futures, Stocks
Posts: 15 since Apr 2011
Thanks Given: 35
Thanks Received: 9

thank you Big Mike, it's working.

Have a nice day.

Reply With Quote
  #9 (permalink)
 lifon 
Prag, Czech Republic
 
Experience: Intermediate
Platform: Jforex, TradeStation
Broker: TradeStation
Trading: Futures, Forex
Posts: 1 since Jun 2013
Thanks Given: 1
Thanks Received: 0

Hi everybody,

I made some variant of this indicator. It calculate values from start of day and shows only VWAP standard deviation.
During developing I found some problems:
1) Indicator starts not only one time but more times. The less is timeframe the more will be starts
2) Indicator shows values from second day (from history) (it’s OK) but not from 00:00 but later

I attach ELD files and a part of log for 30 minutes chart.

Can anybody help me? Thanks in advance.

*******************************************************************************************************************************
vars:
string OInfo( "" ),
bool ShowInfo( False ),
bool IsStart( True ),
BarPrice(0),
BarVolume(0),
BPBV(0),
SumBPPV(0),
SumBV(0),
Count(0),
VWAPrice(0),
Index(0),
SumVRNC(0),
VWAPSD(0);

ShowInfo = True;

If IsStart = True Then
Begin
IsStart = False;
If ShowInfo = True Then Print ( "IsStart!" );
End;

//if CurrentSession( 1 ) <> CurrentSession( 1 )[ 1 ] Then
if Date > Date[ 1 ] Then
Begin
SumBPPV = 0;
SumBV = 0;
Count = 0;
End;



// BarPrice = Close;

BarPrice = AvgPrice;
BarVolume = UpTicks + DownTicks;

BPBV = BarPrice * BarVolume;

SumBPPV = SumBPPV + BPBV;
SumBV = SumBV + BarVolume;
Count = Count + 1;

If SumBV > 0 Then
Begin
VWAPrice = SumBPPV / SumBV;
End;

SumVRNC = 0;

For Index = 0 To Count - 1
Begin
BarPrice = AvgPrice[ Index ];
BarVolume = UpTicks[ Index ] + DownTicks[ Index ];
SumVRNC = SumVRNC + ( BarVolume / SumBV ) * Square( BarPrice - VWAPrice );
End;

VWAPSD = Squareroot( SumVRNC );

Plot1( VWAPSD, "VWAPStDev_D" );

If ShowInfo = True Then
Begin
OInfo = "";
OInfo = OInfo + "DTm: " + AA_getSDateTime( Bardatetime[ 0 ].ELDateTimeEx ) + "; ";
OInfo = OInfo + "D: " + NumToStr( Date + 19000000, 0 ) + "; ";
OInfo = OInfo + "D1: " + NumToStr( Date[ 1 ] + 19000000, 0 ) + "; ";
OInfo = OInfo + "Count: " + NumToStr( Count, 0 ) + "; ";
// OInfo = OInfo + "BPrice: " + NumToStr( BarPrice, 3 ) + "; ";
OInfo = OInfo + "VWAPSD: " + NumToStr( VWAPSD, 3 ) + "; ";
OInfo = OInfo + "CSss: " + NumToStr( CurrentSession( 1 ), 0 ) + "; ";
Print( OInfo );
End;

*******************************************************************************************************************************

Inputs:
DateTime( NumericSimple );

Vars:
YearsN(0),
MonthsN(0),
DaysN(0),
HoursN(0),
MinutesN(0),
SecondsN(0),
string YearsS( "" ),
string MonthsS( "" ),
string DaysS( "" ),
string HoursS( "" ),
string MinutesS( "" ),
string SecondsS( "" );

YearsN = Yearfromdatetime( DateTime);
MonthsN = Monthfromdatetime( DateTime );
DaysN = Dayfromdatetime( DateTime );
HoursN = Hoursfromdatetime( DateTime );
MinutesN = Minutesfromdatetime( DateTime );
SecondsN = Secondsfromdatetime( DateTime );

YearsS = NumToStr( YearsN, 0 );
MonthsS = NumToStr( MonthsN, 0 );
DaysS = NumToStr( DaysN, 0 );
HoursS = NumToStr( HoursN, 0 );
MinutesS = NumToStr( MinutesN, 0 );
SecondsS = NumToStr( SecondsN, 0 );

If MonthsN <= 9 Then MonthsS = "0" + MonthsS;
If DaysN <= 9 Then DaysS = "0" + DaysS;
If HoursN <= 9 Then HoursS = "0" + HoursS;
If MinutesN <= 9 Then MinutesS = "0" + MinutesS;
If SecondsN <= 9 Then SecondsS = "0" + SecondsS;

AA_getSDateTime = "?";

AA_getSDateTime = YearsS + "." + MonthsS + "." + DaysS + " " + HoursS + ":" + MinutesS + ":" + SecondsS;

*******************************************************************************************************************************

IsStart!
DTm: 2014.10.26 18:00:00; D: 20141026; D1: 20141026; Count: 1; VWAPSD: 0.000; CSss: 1;
DTm: 2014.10.26 18:30:00; D: 20141026; D1: 20141026; Count: 2; VWAPSD: 0.345; CSss: 1;
DTm: 2014.10.26 19:00:00; D: 20141026; D1: 20141026; Count: 3; VWAPSD: 0.604; CSss: 1;
IsStart!
DTm: 2014.10.26 19:00:00; D: 20141026; D1: 20141026; Count: 1; VWAPSD: 0.000; CSss: 1;
DTm: 2014.10.26 19:30:00; D: 20141026; D1: 20141026; Count: 2; VWAPSD: 0.093; CSss: 1;
DTm: 2014.10.26 20:00:00; D: 20141026; D1: 20141026; Count: 3; VWAPSD: 0.319; CSss: 1;
DTm: 2014.10.26 20:30:00; D: 20141026; D1: 20141026; Count: 4; VWAPSD: 0.736; CSss: 1;
DTm: 2014.10.26 21:00:00; D: 20141026; D1: 20141026; Count: 5; VWAPSD: 1.211; CSss: 1;
IsStart!
DTm: 2014.10.26 20:00:00; D: 20141026; D1: 20141026; Count: 1; VWAPSD: 0.000; CSss: 1;
DTm: 2014.10.26 20:30:00; D: 20141026; D1: 20141026; Count: 2; VWAPSD: 0.448; CSss: 1;
DTm: 2014.10.26 21:00:00; D: 20141026; D1: 20141026; Count: 3; VWAPSD: 0.794; CSss: 1;
DTm: 2014.10.26 21:30:00; D: 20141026; D1: 20141026; Count: 4; VWAPSD: 0.847; CSss: 1;
DTm: 2014.10.26 22:00:00; D: 20141026; D1: 20141026; Count: 5; VWAPSD: 0.946; CSss: 1;
DTm: 2014.10.26 22:30:00; D: 20141026; D1: 20141026; Count: 6; VWAPSD: 0.961; CSss: 1;
DTm: 2014.10.26 23:00:00; D: 20141026; D1: 20141026; Count: 7; VWAPSD: 0.712; CSss: 1;
IsStart!
DTm: 2014.10.26 21:00:00; D: 20141026; D1: 20141026; Count: 1; VWAPSD: 0.000; CSss: 1;
DTm: 2014.10.26 21:30:00; D: 20141026; D1: 20141026; Count: 2; VWAPSD: 0.203; CSss: 1;
DTm: 2014.10.26 22:00:00; D: 20141026; D1: 20141026; Count: 3; VWAPSD: 0.388; CSss: 1;
DTm: 2014.10.26 22:30:00; D: 20141026; D1: 20141026; Count: 4; VWAPSD: 0.412; CSss: 1;
DTm: 2014.10.26 23:00:00; D: 20141026; D1: 20141026; Count: 5; VWAPSD: 0.392; CSss: 1;
DTm: 2014.10.26 23:30:00; D: 20141026; D1: 20141026; Count: 6; VWAPSD: 0.630; CSss: 1;
DTm: 2014.10.27 00:00:00; D: 20141027; D1: 20141026; Count: 1; VWAPSD: 0.000; CSss: 1;
DTm: 2014.10.27 00:30:00; D: 20141027; D1: 20141027; Count: 2; VWAPSD: 0.156; CSss: 1;
DTm: 2014.10.27 01:00:00; D: 20141027; D1: 20141027; Count: 3; VWAPSD: 0.120; CSss: 1;
......

*******************************************************************************************************************************

Reply With Quote
  #10 (permalink)
NerradC
Perth AUSTRALIA
 
Posts: 253 since Jun 2017
Thanks Given: 79
Thanks Received: 87


thank you Big Mike, this works well on Tradestation 9.5

Reply With Quote




Last Updated on July 7, 2017


© 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