Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

jperl

Trading with Market Statistics. IV Standard Deviation

Recommended Posts

Throughout the previous threads ([thread=1962]Part I[/thread],[thread=1990]Part II[/thread] and [thread=2008]Part III[/thread]), I have described the use of a probability distribution in the form of the volume distribution function as a trading tool. The shape of the probability distribution is dynamic, changing with time throughout the trading day. Nevertheless all information relating to price and price action is contained within this distribution function. Anything you want to know about price and price action can be obtained by analysis of the distribution function itself. No extraneous information from other sources is required.

 

We have so far analyzed the distribution in terms of two properties, a)the peak volume price ( PVP ) and b) the volume weighted average price ( VWAP ), which is the mean for the distribution. Both of these are dynamically updated throughout the trading day as the volume distribution function dyanmically changes. In [thread=2008]Part III[/thread], we showed how the relationship between the VWAP and the PVP could be used for an entry technique in a simple newbie VWAP trading strategy.

 

But there is much more that is needed to advance beyond the newbie strategy. In this thread and succeeding threads, we will address the following issues:

 

1)Given an entry point, where should the profit target be set?

2)What other entry points are there beside the VWAP?

3)How can you tell when a reversal may be imminent?

4)When is a breakout imminent?

5)How do you trade the opening?

6)When should you be looking for scalps.?

7)How do you set stoplosses ?

and related to this

a)Should you set stoplosses?

b)when do you scale in?

c)when do you scale out?

d)When do you reverse a trade.?

 

.

While we won't address all these questions in one thread their answers can be obtained by analysis of the volume distribution function. To do so requires that we introduce a third property of the volume distribution function called the Standard Deviation of the VWAP, SD for short. SD is computed from the following equations:

 

attachment.php?attachmentid=2043&stc=1&d=1185245629

where the summation subscript i, runs over all prices in the volume distribution

pi = ith price in the volume distribution

Pi = vi/V is the probability of occurrence of price pi

vi = the volume traded at price pi from the volume distribution

V = total volume for the entire distribution

 

That's a mouthful. If you would like more details about the variance and the standard deviation, see the wikipedia reference

http://en.wikipedia.org/wiki/Variance and references therein.

 

So what does the Standard Deviation tell you?

Well for starters,

SD tells you how far you can expect price to move away from the VWAP.

 

It can be shown (but we won't prove it here ) that computing the SD with respect to the VWAP gives the smallest expectation of price movement.

 

Put another way, if our newbie trader were to initiate a trade at the VWAP (which he/she already knows how to do from [thread=2008]Part III[/thread]), then the obvious place to put his profit target is 1 standard deviation away from his entry price. This is the least he should expect the price action to move price.

 

SD is thus a measure of market volatility for the time period over which the VWAP is computed. This gives NEWBIE a very powerful handle for his trading. If the SD is too small, he should stand aside. If it is too large, requiring a large stoploss, he might stand aside as well, if this frightens him. Too small and too large are of course qualitative terms which NEWBIE will have to decide for himself, but at least now he has a quantitative measure of market volatility and what he can expect when he enters a trade.

 

Watch the attached video ESlongJuly23.swf and see how adding the SD helps NEWBIE set his profit target.

 

After using the SD for profit targets, a light bulb goes off in NEWBIE's head. He realizes something about entry points that he didn't know about before. If he believes what he is thinking, it will totally change his way of trading now and forever. Can you tell what it is?

Check out [thread=2130]part V[/thread] to see what it is.

SD.jpg.d2c2bfe77058d53ca667f8f338383dc2.jpg

ESlongJuly23.swf

Share this post


Link to post
Share on other sites

Jerry,

 

it looks like a 2-minute chart, is that right?

 

also, just to clarify -- the std dev is for all closing 2-min bars that day vs all respective 2-min VWAP closing values for that day?

Share this post


Link to post
Share on other sites

Very interesting, love the videos. Thanks!

 

Just a question to make sure I'm clear on something. When the price is below the VWAP and around the PVP, the reason not to take trades assuming it's going to go back up to the VWAP and possibly up to the SD - is it that the area is considered more 'random' than at around the VWAP? Because my first instinct looking at that video as a newbie is "hmmm well if the price seems to gravitate toward the VWAP and possibly upward to the SD, why wouldn't I enter the trade down here instead of waiting for it to touch the VWAP".

 

So I'm assuming it has to do with less probability and that prices could continue to drop if they are at or lower than the PVP, whereas at the VWAP probability is on your side that it will continue to rise?

Share this post


Link to post
Share on other sites

 

it looks like a 2-minute chart, is that right?

Yes, 2 minute chart, but there is nothing special about using 2 minute chart, you could use any time or type chart you wanted. The volume distribution function would be the same. That's the beauty of market statistics. The VWAP only depends on when you start the computation.

 

also, just to clarify -- the std dev is for all closing 2-min bars that day vs all respective 2-min VWAP closing values for that day?

Not sure what you are asking, but let me state how the SD is computed by example. Suppose it is 12:30. Compute the VWAP from the open until 12:30. The value you get is the 12:30 VWAP value. It is that one value that is used to compute the SD at 12:30 using all prices in the subtraction from the open until 12:30.

As far as what prices to use, in principle it should be the prices for every trade. In practice this is too CPU intensive. Most computations use either the close of each bar or the average (O+H+L+C)/4 of each bar. It is not too critical.

Share this post


Link to post
Share on other sites

 

So I'm assuming it has to do with less probability and that prices could continue to drop if they are at or lower than the PVP, whereas at the VWAP probability is on your side that it will continue to rise?

 

Good observation Unleashed, you are getting the feel for this. You indeed could take a trade at the PVP, but our NEWBIE is not ready for that yet. Trades at the PVP are possible but dangerous. We will discuss this in a later thread when we get to reverse trades and break outs.

Share this post


Link to post
Share on other sites
Does anyone know how i can plot the standard deviation of the vwap on sierra chart

thanks for your help

 

Sorry losfer, not familiar with Sierra. I would recommend that any charting program that is supplying VWAP should be requested to add the standard deviation as a choice. Otherwise you will be in the dark about market volatility.

Share this post


Link to post
Share on other sites

another great video Jerry.

Unleashed, funny thing with what you mentioned because I had the same first instinct as a newb. Its interesting if you compare that to market profile too because wouldnt that basically be like trading the value low pivot in mp if you went with that lower std dev instead of waiting?

 

also, I would think with any package that has vwap and a scripting language that it shouldn't be to hard to gut bollinger band code to get vwap std dev. Even if the package didn't have a std dev function the math would all be done in the bb indicator. You would just have to swap vwap for the ema and kill the back lookup period.

Share this post


Link to post
Share on other sites
working on my EasyLanguage VWAP Std Dev code (Tradestation)... gotta figure out the trick to how you do summation of all prices since the opening bar. if someone knows how to do this, please help out. here is what my ES chart looks like today:

 

http://bp3.blogger.com/_5h-SWVGx6Ms/RqafxOvXa3I/AAAAAAAAAVk/quoPPnj8Z3I/s1600-h/ES+VWAP+Std+Dev+Bands.bmp

 

Are you using the VWAP that is on tradestation boards ? and from there on aplying sd ?...

Share this post


Link to post
Share on other sites

<<Are you using the VWAP that is on tradestation boards ? and from there on aplying sd ?...>>

 

VWAP_H is the code I am using -- Tradestation has this as a keyword. indicator can be written simply as:

 

plot1(vwap_h,"vwap");

 

--------------

 

here is how I wrote Std Dev:

 

first taking the squared difference of 'price' and VWAP_H and summing them:

 

value1=

square(c-vwap_h)+

square(c[2]-vwap_h[2])+...

 

then taking square root of value1 gives you std dev, written in EL as:

value2=squareroot(value1/n);

 

where n is the number of periods...

 

I just put it up on the tradestation forum to try to get some help:

 

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=66888

 

any help here would be appreciated...

Share this post


Link to post
Share on other sites

here is how I wrote Std Dev:

 

first taking the squared difference of 'price' and VWAP_H and summing them:

 

value1=

square(c-vwap_h)+

square(c[2]-vwap_h[2])+...

 

then taking square root of value1 gives you std dev, written in EL as:

value2=squareroot(value1/n);

 

where n is the number of periods...

 

 

Dogpile, you left out an important term in your variance computation. Remember that the VWAP is volume weighted. so you need to weight each one of your square terms by the normalized volume:

value1= Pi*square(c-vwap_h) +..... where Pi= vi/V, vi=volume traded at price c, V=total volume for the distribution.

 

Also each of the terms in the sum should be the same VWAP :

 

value1= P1*square(C-VWAP) + P2*square(c[2]-VWAP) + .....

Share this post


Link to post
Share on other sites

thx Jerry,

 

note that VWAP_H is hard-coded to already volume-weight for that side of the equation.

 

I assume you are saying that I need to weight each 'price' observation by volume as well to be consistent? hmm, need to think about this more. can you post a chart of your ES 2-min chart with the bands for today? I would like to see how mine and yours compare as is...

 

I have been using VWAP a lot lately and using my short-term trading techniques in conjunction with VWAP has so far been awesome -- and I will be thinking a lot about more ideas with VWAP. Look how NQ stopped just short of previous days VWAP again near 55.00 to offer a spot to look for a key reversal... this was sweet since my short-term entry techniques didn't signal a short until then anyway -- but gave extra confidence that this was actually typical behavior for the very volatile NQ contract.

Share this post


Link to post
Share on other sites

<<Also each of the terms in the sum should be the same VWAP :

 

value1= P1*square(C-VWAP) + P2*square(c[2]-VWAP) + .....>>

 

this is not intutive to me... I would then be comparing the current vwap to old prices..

 

I am thinking about how bollinger bands work here and applying same concept. I am quite familiar with properties of bollinger bands so this is natural for me. bollinger bands compare the price to the moving average value that occured at the same time that the price occured. this is kind of like 'matching' concept in accounting.

 

I do not know how to code it your way so will look for others for help. But this entire line of thinking is quite stimulating for new ideas.

Share this post


Link to post
Share on other sites

Jerry,

I am also confused with

"Also each of the terms in the sum should be the same VWAP" statement.

 

Vwap is developing during the day, and is a sum of (pi * vi)/ V. It would seem that SD equitation should have VWAPi and be summed at each bar. So one would get distribution of prices in reference to VWAP line.

Share this post


Link to post
Share on other sites

I like the strategy that you use but the only thing that I seem to find a bit wrong with it is that you seem to really need to wait a long time for the volume distribution function to develop i.e: you have to wait a long time in the trading day to actually do anything.

 

Can you add in another factor into your analysis, specifically time? Question being, if you factor in time then you can do a regression analysis based on price, volume, and time so that you can get a probability distribution (90% confidence intervals) to help time trades early on in the trading session.

 

I might be wrong but it's just an idea :)

Share this post


Link to post
Share on other sites

 

I assume you are saying that I need to weight each 'price' observation by volume as well to be consistent?

Not each price, but each square term in the variance computation

 

I have been using VWAP a lot lately and using my short-term trading techniques in conjunction with VWAP has so far been awesome -- and I will be thinking a lot about more ideas with VWAP. Look how NQ stopped just short of previous days VWAP again near 55.00 to offer a spot to look for a key reversal... this was sweet since my short-term entry techniques didn't signal a short until then anyway -- but gave extra confidence that this was actually typical behavior for the very volatile NQ contract.

 

Glad to see you find the VWAP useful. We have a lot more ideas about this coming up.

Share this post


Link to post
Share on other sites
<<Also each of the terms in the sum should be the same VWAP :

 

value1= P1*square(C-VWAP) + P2*square(c[2]-VWAP) + .....>>

 

this is not intutive to me... I would then be comparing the current vwap to old prices..

 

Yes, that's correct. Think of the following: Suppose you had just one VWAP value say at 12:30 and you wanted to know its variance. You would compute the difference between that value and all the old prices. Take the square of each difference and sum them up to get the unnormalized variance.

Share this post


Link to post
Share on other sites
I like the strategy that you use but the only thing that I seem to find a bit wrong with it is that you seem to really need to wait a long time for the volume distribution function to develop i.e: you have to wait a long time in the trading day to actually do anything.

 

Good observation Nick. There is a solution to this which we will eventually get to in later threads having to do with how you incorporate previous days, weeks, months VWAPs and their SD into todays price action. At this point in time, our NEWBIE trader waits for the distribution to develop and also waits for the price action to touch the VWAP. But, coming up in the next thread, we will introduce a paradigm shift in NEWBIE's thinking. Stay tuned.

 

Can you add in another factor into your analysis, specifically time? Question being, if you factor in time then you can do a regression analysis based on price, volume, and time so that you can get a probability distribution (90% confidence intervals) to help time trades early on in the trading session.

 

Perhaps you might want to expand on this, to give us an idea of what you are thinking about here.

Share this post


Link to post
Share on other sites

<<Suppose you had just one VWAP value say at 12:30 and you wanted to know its variance. You would compute the difference between that value and all the old prices. Take the square of each difference and sum them up to get the unnormalized variance.>>

 

right but when historically charting variance/std dev, don't you want the bands to show what the variance was relative to the distribution at the time of the 'price' reading. for example, lets say you wanted to plot the band that occured at 12:28 (1 bar before 12:30 on a 2-min chart)... you would then want the variance calculated through 1 bar ago, not the 'current' (12:30) VWAP... that is -- you want the distribution up through 12:28 (VWAP_H[1]), not the variance +1 period (the 12:30 VWAP_H) -- right?

Share this post


Link to post
Share on other sites
Jerry,

I am also confused with

"Also each of the terms in the sum should be the same VWAP" statement.

 

Vwap is developing during the day, and is a sum of (pi * vi)/ V. It would seem that SD equitation should have VWAPi and be summed at each bar. So one would get distribution of prices in reference to VWAP line.

 

Nickm, see the reply above to Dogpile. To compute the variance of a group of numbers, find the average of the numbers and then subtract each number from that average, square each difference and sum them up.

Share this post


Link to post
Share on other sites

I think I understand your point.... but it also is not good news from the point of calculating SD, since one has to save values for volume at price ( or whatever unit one will use) for calculating the vi/V element. This makes coding VWAP SD as complex as MP - not a good news for NEWBE:sad:

 

I have come up with crude approximation of SD, by dropping vi/V factor, and it is remarkably close to your pic for July 23rd for whatever it is worth. See the pic attached

VWAP_SD1.thumb.gif.cae25d8ae96288f5c726d181086fcd3d.gif

Share this post


Link to post
Share on other sites

nickm,

 

can I take a look at your code?

 

personally, I like the comparison to 'bollinger bands' -- bollinger bands do not 'volume weight' each observation. yes, it does matter what volume traded where -- but it can also be argued that 'data outliers' are actually more important when doing statistical analysis -- even if they occur on less volume. but you can argue this either way...

 

I think unweighted price versus VWAP_H could be a useful indicator...

Share this post


Link to post
Share on other sites

 

I have come up with crude approximation of SD, by dropping vi/V factor, and it is remarkably close to your pic for July 23rd for whatever it is worth. See the pic attached

 

You can if you wish use a frequency distribution function in place of a volume distribution function. The distributions look similar but will differ in the fine details.

Share this post


Link to post
Share on other sites
nickm,

 

I think unweighted price versus VWAP_H could be a useful indicator...

 

If you are going to use unweighted prices to compute SD, then use an unweighted average to compare it too. Be consistent. Don't compare apples to Oranges.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • No one can specify that who can become successful in what time, it all depends on the skills you have applied and know;edge you have implied while trading.
    • On this Forum by Introducing yourself new beginner will get many things to learn, good links and videos also. Forex4you is a platform where you can learn about Forex as well as Demo account trading.
    • Open a new futures brokerage account by April 30th with a NinjaTrader Lifetime license & receive: Commission-Free Micro trading in May $50 margins on Micros Access to the most powerful version of NinjaTrader Free platform upgrades for life! Simply open & fund your new account in April with as little as $400 & purchase a Lifetime license. You will then receive a rebate for commissions on all Micro futures trades placed from May 1 – May 31st.* Open Futures Account A NinjaTrader Lifetime license provide access to all premium features including Chart Trader, OCO orders, Order Flow +, and more. *Program Requirements: Account must be funded by April 30th, 2020 with $400 minimum A new NinjaTrader Lifetime license ($1099) must be purchased by April 30th, 2020 Standard exchange, NFA and routing fees still apply A commission rebate will be applied to the account holder’s balance for all May Micro trades 2nd accounts for current NinjaTrader Brokerage account owners not eligible for rebates Futures and Forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or life style. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.
    • Date : 1st April 2020. All eyes on Commodity Currencies.Asian stock markets are lower, while European and US equity index futures are showing losses of around 3%. Data out of Asia today were nothing short of dismal, showing manufacturing contracting across most of the region, highlighting the economic toll that virus-containing measures are having.The main concern remains that the massive global stimulus measures simply won’t be fully effective while many economies remain in a state of lockdown of as-yet unknown duration.Commodity currencies have come under pressure as the winds of risk aversion picked up again.The Canadian dollar was the main loser so far today , while it has remained under pressure with oil prices sinking back toward major-trend lows as crude storage facilities burst at the seems from excessive supplies.USDCAD has gained up nearly 2% in making a 1.4230 high, though the pair so far has remained below yesterday’s peak at 1.4350. This is due to the fact that crude prices are down by over 65% year-to-date. This level of price decline in Canada’s principal export, while it sustains, marks a significant deterioration in the Canadian economy’s terms of trade. Given the glut of crude flooding the market, and given that supply is increasing as demand will remain weak for a historically protracted amount of time, Canadian Dollar is anticipated to remain apt to underperformance. The likes of the Norwegian krona, which like the Canadian dollar is an oil-price correlator, and many developing world currencies have also come under pressure.From the technical perspective, USDCAD overall outlook remains positive with asset holding above all three daily SMAs since January, and momentum indicators positively configured. RSI at 59 recovery from a pullback last week, Stochastic rebound from oversold territory and MACD presents some decline of the bullish momentum but holds well above 0. That said, USDCAD revisiting its recent 17-year high at 1.4669 seems likely before long.Intraday meanwhile, the rebound of USDCAD looks to run out of steam, however only a move below 1.4050 could suggest a reverse of the outlook.AUDUSD tipped over 1% lower in making a 5-day low at 0.6064 amid weaker Gold prices (end-of-quarter flows). The Aussie still remains comfortably above the 17-year low that was seen on March 19th at 0.5507. The Kiwi dollar has also taken a tumble.Always trade with strict risk management. Your capital is the single most important aspect of your trading business.Please note that times displayed based on local time zone and are from time of writing this report.Click HERE to access the full HotForex Economic calendar.Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!Click HERE to READ more Market news. Stuart Cowell Head Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • Date : 31st March 2020. Dead cat Bounce!Dead cat Bounce! A new term? Not really but definitely something that we haven’t seen for more than a generation.In general, investors throughout the years invented this term as a follow up to a market free fall. By definition, the “Dead cat Bounce” is simply a market phenomenon that translates into temporary small and short-lived rebounds of an asset’s price within a prolonged period of downside. This term is based on the idiom that “even a dead cat will bounce if it falls far enough and fast enough“. Hence in the financial market it is said that even if an asset falls with a considerable speed, it would rebound as even a dead cat would bounce. However, every time there is a rebound, the overall initial trend is then anticipated to resume, bringing the bearish influence back into play.In addition, the phenomenon can occur in any market, yet is particularly prevalent in equity markets. It is often the case that it is considered a continuation pattern.Why are we raising this topic now? This March, was the first time after Black Monday 1987 that we have seen the worst intraday selloffs in stock markets. Since February 20th, the stock market entered an aggressive bear market with a few days of an absolute rally. An example was the 13th of March in which the stock market roared back in the biggest one-day rally since 2008 after its worst single-day crash in 33 years just a day before. This is the classic dead cat bounce.If you closely observe stock market behaviour in March you will notice that there is a dramatic decline, with a number of days when the market reversed some of its losses, but failed to take the bait, and eventually fell back down again. This is a situation of portfolio managers wanting to sell some of their positions and when they see some strength in the market, decided to unload. This is what we call a “dead cat bounce” after it falls from high enough. Remember however that not every correction/reversal can be interpreted as a dead cat bounce.Theoretically this term is defined as the term in which,   A stock in a severe steep decline has a sharp bounce off the lows. A small upward price movement in a bear market after which the market continues to fall. Unfortunately, I need to highlight that there is not an easy way to determine in advance whether an upwards movement is a dead cat bounce which will eventually reverse quickly or whether it is a trend reversal. There is nothing easy in identifying the bottom of the market. However to a large extent a dead cat bounce is a retracement, in comparison to a reversal, i.e. it is temporary.Dead cat bounce as a technical analysis tool and more precisely as a continuation pattern could be tradable from short-term or medium term traders. Having explained this phenomenon, a follow-up article will elaborate on how market participants can trade a dead cat bounce.Always trade with strict risk management. Your capital is the single most important aspect of your trading business.Please note that times displayed based on local time zone and are from time of writing this report.Click HERE to access the full HotForex Economic calendar.Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE!Click HERE to READ more Market news. Andria Pichidi Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.