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.

# 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:

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.

ESlongJuly23.swf

#### Share this 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

##### 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

##### 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

##### 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

##### Share on other sites

Does anyone know how i can plot the standard deviation of the vwap on sierra chart

thanks for your help

#### Share this 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

##### 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

##### 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

#### Share this 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

##### 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

##### 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

##### 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

##### 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

##### 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

##### 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

##### 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

##### 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

##### 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

##### 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

##### 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

##### 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

#### Share this 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

##### 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

##### 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.

## 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.

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.

×

• 75
• 2
• 0
• 0
• 2
• ### Posts

• Wow.  Yes.  Hi - hows America? I'll let Mk let me know when it happens. Also trade just HSI but keep telling myself I should also trade a variant on your style on fx.
• Howdy Doody!   I haven't been here in years. Dre gave me a nudge about your post otherwise I would never have Known... I'm keen to catch up will PM you and get in touch with Kiwi   Trading Hang Seng Futures. Mostly very short-term combined with index option swing trades.   With kind regards, MK
• Gold Is Trapped In A Narrowing Price Band Lacking In Directional Bias XAUUSD Price Analysis – February 14 Gold did not have a strong directional inclination and traded in a limited exchanging band around the \$ 1,575 level during the early European session on Friday. The blend of separating powers couldn’t give any new catalyst or support the valuable metal to build up a positive shift of the previous session to the tops in a week. Key Levels Resistance Levels: \$ 1611, \$ 1595, \$ 1585 Support Levels: \$ 1550, \$ 1540, \$ 1517 XAUUSD Long term Trend: Bullish The metal has printed lower highs and higher lows since it reached \$ 1,611.49 level in early January. This took the form of a tapering price band or a declining triangle. Marvin Steinberg und seine Sicht auf den STO-Markt: https://coincierge.de/2020/marvin-steinberg-und-seine-sicht-auf-den-sto-markt/ Admitting past the upper limit may mean the resumption of the uptrend from November lows of about \$ 1455.70 level and may lead to a move past the recent high of \$ 1611.49 level. XAUUSD Short term Trend: Ranging The day after a slight decrease in price, gold came back to the resistance region of \$1575 – \$1578 levels. With the RSI indicating a potential move higher, we could see some expansion in force. However, gold requires to get through the barrier zone to affirm further advancement and besides, it additionally needs to break past the recent highs to keep up an upswing. Instrument: XAUUSD Order: Buy Entry price: \$1,575 Stop: \$ 1,563 Target: \$1,580 Note: Learn2Trade.com is not a financial advisor. Do your research before investing your funds in any financial asset or presented product or event. We are not responsible for your investing results.   Source: https://learn2.trade
• Ripple (XRP) Starts New Uptrend, Battles Next Resistance At \$0.34 Key Resistance Levels: \$0.30, \$0.40, \$0.45 Key Support Levels: \$0.25, \$0.20, \$0.15 XRP/USD Long-term Trend: Bullish On February 11, Ripple slumped to the low of \$0.26 and rebounded as the coin reached a new high of \$0.32. Before this time, the bulls have been finding it difficult to break the resistance at \$0.28. Analysts are of the view that a break above \$0.28 will push XRP to a high of \$0.31. Today the market has reached a high of \$0.34 but has pulled back to the support of \$0.32. The upward move has been temporarily put on hold because of the minor resistance at \$0.34. Nonetheless, the bulls have to make efforts to break the current resistance. From the price action, if the bulls succeed in breaking the resistance at \$0.34, XRP will rally above \$0.40. This is because there will be little or no resistance between \$0.34 and \$0.40. Therefore, we shall lookout for the next price between \$40 and \$0.45. Daily Chart Indicators Reading: As Ripple appreciated to a high of \$0.32, the Relative Strength Index period 14 has risen to level 80. This implies that Ripple is in the overbought region of the market. The implication is that once the coin is overbought, sellers will be generated in the region to push the coin downward. Buyers are not available in the region to push the coin upward. However, in exceptional cases price will linger in the overbought region before the downward move. Marvin Steinberg und seine Sicht auf den STO-Markt: https://coincierge.de/2020/marvin-steinberg-und-seine-sicht-auf-den-sto-markt/ XRP/USD Medium-term Trend: Bullish On the 4-hour chart, the upward move was as a result of a bounce on the trend line. The rally reached a high of \$0.34 but the price found support above \$0.32. Thereafter the bulls made two attempts at the resistance without a success. The coin is fluctuating below the resistance. 4-hour Chart Indicators Reading Ripple is trading below 80% range of the daily stochastic. This means that XRP is in bearish momentum. The coin is likely to fall. Meanwhile, 21-day SMA and 50-day SMA are sloping upward indicating that uptrend is ongoing General Outlook for Ripple (XRP) Ripple is currently fluctuating above \$0.32 support but below the \$0.34 resistance. The bulls have one more hurdle at \$0.34 resistance to jump over. Ripple will be out of the downtrend zone if the bulls are successful above the resistance. There is also the possibility of a new uptrend as soon as the resistance at \$0.34 is breached. Ripple (XRP) Trade Signal Instrument: XRPUSD Order: Buy Entry price: \$0.33 Stop: \$0.32 Target: \$0.45 Note: Learn2Trade.com is not a financial advisor. Do your research before investing your funds in any financial asset or presented product or event. We are not responsible for your investing results.   Source: https://learn2.trade
• I am keen - will pm an email ..   No Forex only ES and NQ for me
×
×
• Create New...

## Important Information

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