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

    • there is no avoiding loses to be honest, its just how the market is. you win some and hopefully more, but u do lose some. 
    • Date: 11th July 2025.   Demand For Gold Rises As Trump Announces Tariffs!   Gold prices rose significantly throughout the week as investors took advantage of the 2.50% lower entry level. Investors also return to the safe-haven asset as the US trade policy continues to escalate. As a result, investors are taking a more dovish tone. The ‘risk-off’ appetite is also something which can be seen within the stock market. The NASDAQ on Thursday took a 0.90% dive within only 30 minutes.   Trade Tensions Escalate President Trump has been teasing with new tariffs throughout the week. However, the tariffs were confirmed on Thursday. A 35% tariff on Canadian imports starting August 1st, along with 50% tariffs on copper and goods from Brazil. Some experts are advising that Brazil has been specifically targeted due to its association with the BRICS.   However, the President has not directly associated the tariffs with BRICS yet. According to President Trump, Brazil is targeting US technology companies and carrying out a ‘witch hunt’against former Brazilian President Jair Bolsonaro, a close ally who is currently facing prosecution for allegedly attempting to overturn the 2022 Brazilian election.   Although Brazil is one of the largest and fastest-growing economies in the Americas, it is not the main concern for investors. Investors are more concerned about Tariffs on Canada. The White House said it will impose a 35% tariff on Canadian imports, effective August 1st, raised from the earlier 25% rate. This covers most goods, with exceptions under USMCA and exemptions for Canadian companies producing within the US.   It is also vital for investors to note that Canada is among the US;’s top 3 trading partners. The increase was justified by Trump citing issues like the trade deficit, Canada’s handling of fentanyl trafficking, and perceived unfair trade practices.   The President is also threatening new measures against the EU. These moves caused US and European stock futures to fall nearly 1%, while the Dollar rose and commodity prices saw small gains. However, the main benefactor was Silver and Gold, which are the two best-performing metals of the day.   How Will The Fed Impact Gold? The FOMC indicated that the number of members warming up to the idea of interest rate cuts is increasing. If the Fed takes a dovish tone, the price of Gold may further rise. In the meantime, the President pushing for a 3% rate cut sparked talk of a more dovish Fed nominee next year and raised worries about future inflation.   Meanwhile, jobless claims dropped for the fourth straight week, coming in better than expected and supporting the view that the labour market remains strong after last week’s solid payroll report. Markets still expect two rate cuts this year, but rate futures show most investors see no change at the next Fed meeting. Gold is expected to finish the week mostly flat.       Gold 15-Minute Chart     If the price of Gold increases above $3,337.50, buy signals are likely to materialise again. However, the price is currently retracing, meaning traders are likely to wait for regained momentum before entering further buy trades. According to HSBC, they expect an average price of $3,215 in 2025 (up from $3,015) and $3,125 in 2026, with projections showing a volatile range between $3,100 and $3,600   Key Takeaway Points: Gold Rises on Safe-Haven Demand. Gold gained as investors reacted to rising trade tensions and market volatility. Canada Tariffs Spark Concern. A 35% tariff on Canadian imports drew attention due to Canada’s key trade role. Fed Dovish Shift Supports Gold. Growing expectations of rate cuts and Trump’s push for a 3% cut boosted the gold outlook. Gold Eyes Breakout Above $3,337.5. Price is consolidating; a move above $3,337.50 could trigger new buy signals. 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 HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Michalis Efthymiou HFMarkets   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 Leveraged 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.
    • Back in the early 2000s, Netflix mailed DVDs to subscribers.   It wasn’t sexy—but it was smart. No late fees. No driving to Blockbuster.   People subscribed because they were lazy. Investors bought the stock because they realized everyone else is lazy too.   Those who saw the future in that red envelope? They could’ve caught a 10,000%+ move.   Another story…   Back in the mid-2000s, Amazon launched Prime.   It wasn’t flashy—but it was fast.   Free two-day shipping. No minimums. No hassle.   People subscribed because they were impatient. Investors bought the stock because they realized everyone hates waiting.   Those who saw the future in that speedy little yellow button? They could’ve caught another 10,000%+ move.   Finally…   Back in 2011, Bitcoin was trading under $10.   It wasn’t regulated—but it worked.   No bank. No middleman. Just wallet to wallet.   People used it to send money. Investors bought it because they saw the potential.   Those who saw something glimmering in that strange orange coin? They could’ve caught a 100,000%+ move.   The people who made those calls weren’t fortune tellers. They just noticed something simple before others did.   A better way. A quiet shift. A small edge. An asymmetric bet.   The red envelope fixed late fees. The yellow button fixed waiting. The orange coin gave billions a choice.   Of course, these types of gains are rare. And they happen only once in a blue moon. That’s exactly why it’s important to notice when the conditions start to look familiar.   Not after the move. Not once it's on CNBC. But in the quiet build-up— before the surface breaks.   Enter the Blue Button Please read more here: https://altucherconfidential.com/posts/netflix-amazon-bitcoin-blue  Profits from free accurate cryptos signals: https://www.predictmag.com/ 
    • What These Attacks Look Like There are several ways you could get hacked. And the threats compound by the day.   Here’s a quick rundown:   Phishing: Fake emails from your “bank.” Click the link, give your password—game over.   Ransomware: Malware that locks your files and demands crypto. Pay up, or it’s gone.   DDoS: Overwhelm a website with traffic until it crashes. Like 10,000 bots blocking the door. Often used by nations.   Man-in-the-Middle: Hackers intercept your messages on public WiFi and read or change them.   Social Engineering: Hackers pose as IT or drop infected USB drives labeled “Payroll.”   You don’t need to be “important” to be a target.   You just need to be online.   What You Can Do (Without Buying a Bunker) You don’t have to be tech-savvy.   You just need to stop being low-hanging fruit.   Here’s how:   Use a YubiKey (physical passkey device) or Authenticator app – Ditch text message 2FA. SIM swaps are real. Hackers often have people on the inside at telecom companies.   Use a password manager (with Yubikey) – One unique password per account. Stop using your dog’s name.   Update your devices – Those annoying updates patch real security holes. Use them.   Back up your files – If ransomware hits, you don’t want your important documents held hostage.   Avoid public WiFi for sensitive stuff – Or use a VPN.   Think before you click – Emails that feel “urgent” are often fake. Go to the websites manually for confirmation.   Consider Starlink in case the internet goes down – I think it’s time for me to make the leap. Don’t Panic. Prepare. (Then Invest.)   I spent an hour in that basement bar reading about cyberattacks—and watching real-world systems fall apart like dominos.   The internet going down used to be an inconvenience. Now, it’s a warning.   Cyberwar isn’t coming. It’s here.   And the next time your internet goes out, it might not just be your router.   Don’t panic. Prepare.   And maybe keep a backup plan in your back pocket. Like a local basement bar with good bourbon—and working WiFi.   As usual, we’re on the lookout for more opportunities in cybersecurity. Stay tuned.   Author: Chris Campbell (AltucherConfidential) Profits from free accurate cryptos signals: https://www.predictmag.com/   
    • DUMBSHELL:  re the automation of corruption ---  200,000 "Science Papers" in academic journal database PubMed may have been AI-generated with errors, hallucinations and false sourcing 
×
×
  • Create New...

Important Information

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