TS/MC: VWAP with standard deviation indicator. - futures io
futures io



TS/MC: VWAP with standard deviation indicator.


Discussion in TradeStation

Updated
      Top Posters
    1. looks_one pmat with 2 posts (0 thanks)
    2. looks_two Big Mike with 2 posts (5 thanks)
    3. looks_3 cbratton with 1 posts (0 thanks)
    4. looks_4 marcovth with 1 posts (0 thanks)
    1. trending_up 12,979 views
    2. thumb_up 5 thanks given
    3. group 7 followers
    1. forum 9 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

TS/MC: VWAP with standard deviation indicator.

(login for full post details)
  #1 (permalink)
 marcovth 
Canada
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES,6E
 
marcovth's Avatar
 
Posts: 25 since Jun 2010
Thanks: 1 given, 28 received

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

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(358 thanks from 36 posts)
looks_twoSalao's Journalby Salao
(81 thanks from 13 posts)
looks_3Learning to Profit - A journey in algorithms and optionsby Syntax
(58 thanks from 17 posts)
looks_4Deeteeís DAX Trading Journal (time based)by Deetee
(51 thanks from 22 posts)
looks_5Maybe a little bit different journalby Malykubo
(37 thanks from 20 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
The Crude Dude Oil Trading System
113 thanks
Help improve the FIO community
38 thanks
futures io site changelog and issues/problem reporting
26 thanks
Next New Poll Ideas/Suggestions
20 thanks
Cryptocurrencies 101 -- what Ive learned so far
18 thanks
 
(login for full post details)
  #3 (permalink)
Insearch
East Windsor, NJ
 
 
Posts: 5 since Jul 2010
Thanks: 1 given, 0 received


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
 
(login for full post details)
  #4 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,018 since Jun 2009
Thanks: 32,479 given, 98,326 received

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

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 4 users say Thank You to Big Mike for this post:
 
(login for full post details)
  #5 (permalink)
 cbratton 
Cebu, Philippines
 
Experience: Advanced
Platform: NinjaTrader
Trading: Emini ES
 
Posts: 70 since Oct 2009
Thanks: 128 given, 117 received

Has anyone converted this to NT7?

Reply With Quote
 
(login for full post details)
  #6 (permalink)
 pmat 
Paris
 
Experience: Beginner
Platform: MultiCharts, Visual Charts
Trading: Index Futures, Stocks
 
Posts: 14 since Apr 2011
Thanks: 21 given, 1 received

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
 
(login for full post details)
  #7 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,018 since Jun 2009
Thanks: 32,479 given, 98,326 received


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

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #8 (permalink)
 pmat 
Paris
 
Experience: Beginner
Platform: MultiCharts, Visual Charts
Trading: Index Futures, Stocks
 
Posts: 14 since Apr 2011
Thanks: 21 given, 1 received

thank you Big Mike, it's working.

Have a nice day.

Reply With Quote
 
(login for full post details)
  #9 (permalink)
 lifon 
Prag, Czech Republic
 
Experience: Intermediate
Platform: Jforex, TradeStation
Broker: TradeStation
Trading: Futures, Forex
 
Posts: 1 since Jun 2013
Thanks: 1 given, 0 received

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
 
(login for full post details)
  #10 (permalink)
NerradC
Perth AUSTRALIA
 
 
Posts: 253 since Jun 2017
Thanks: 79 given, 87 received


thank you Big Mike, this works well on Tradestation 9.5

Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > TS/MC: VWAP with standard deviation indicator.


Last Updated on July 7, 2017


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

An Introduction to CME Group Micro Bitcoin Futures w/David Lerman

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts