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

    • $VKTX Viking Therapeutics stock attempting to move higher off the 64.24 support area, volume 47% above normal, https://stockconsultant.com/?VKTX
    • Date: 26th April 2024. Alphabet Easily Beat Earnings Predictions But Focus Shifts to Today’s PCE Data. Microsoft and Alphabet’s earnings reports beat expectations pushing the NASDAQ to the top of the charts. The Bank of Japan keep interest rates unchanged applying pressure on the Japanese Yen. The Yen Index declines 0.36% and is down 40% against the USD over the past 5 years. The US GDP growth rate falls below its 2.5% expectations, reading 1.6%, but economists advise the Fed may only cut once in 2024! The market turns its attention to the Core PCE Price Index which analysts expect to fall from 2.8% to 2.6%. USA100 – Alphabet Easily Beat Analysts’ Earnings Predictions and Sees its P/E Ratio Fall! The price of the NASDAQ ended the day higher and rose to a slightly higher high. As a result, the index is close to forming a traditional bullish trend and making Wednesday’s decline a retracement or medium-term correction. In terms technical analysis, indicators are mainly indicating a reverting price condition where the asset cannot maintain longer term momentum. However, momentum indications provide a slight bullish bias. The upward price movement is being driven by earnings reports from Microsoft and Alphabet which beat earnings expectations. Microsoft is the most influential stock for the NASDAQ while Alphabet is the third most influential. Alphabet’s earnings beat expectations by 21.61% and revenue rose more than $6 billion. As a result, the price of the stock rose 11.56% after market close. Furthermore, Microsoft’s Earnings Per Share beat Wall Street’s expectations by 3.40% and revenue by 1.50%. The stock rose by 4.30% after market close and is close to trading at the all-time high. However, investors should note that from the “magnificent 7”, Alphabet and Meta have the lowest Price to Earnings ratio. Meaning these stocks are the most likely to be trading below their intrinsic value. However, investors should note that negatives for the stock market in general remain. This also supports the bias shown by technical analysis. The GDP growth rate fell considerably below expectations while inflation data continues to show signs of rising prices. Investors will closely be monitoring today’s Core PCE Price Index which is the most watched index by the Federal Reserve. Analysts expect the Core PCE Price Index to fall from 2.8% to 2.6%. If the index reads more than 0.3%, a rate cut will become unlikely making stocks less attractive. Whereas, if the PCE Price Index is not as high as expectations, Bond Yields will likely decline, as will the US Dollar and a rate cut will be put back on the table. As a result, investors may look to take advantage of the strong earnings and continue purchasing stocks. USDJPY – BOJ Hold Interest Rates Unchanged! The price of the USDJPY exchange rate again rose to an all-time recent high after increasing in value for 3 consecutive days. Trend and momentum-based indicators point towards a higher price. However, the exchange rate is trading within the overbought range of most oscillators and is also showing a divergence pattern. Both are known to indicate a decline, but not necessarily a complete change of trend. The Bank of Japan’s statement from earlier this morning was largely “dovish” and gave no clear indication that the central bank wishes to keep rising interest rates. However, shortly the Governor will answer questions from journalists and may give a more hawkish tone. Either way, investors are mainly concentrating on if the Federal Government will again opt to intervene within the currency market. Most economists believe the intervention will only come if the USD continues to rise and it will not be before the Core PCE Price Index. 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 on how markets work. Click HERE to register for FREE! Click HERE to READ more Market news. Michalis Efthymiou Market Analyst 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 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.
    • 📁 Population in 2100, as projected by UN Population Division.   🇮🇳 India: 1,533 million 🇨🇳 China: 771 million 🇳🇬 Nigeria: 546 million 🇵🇰 Pakistan: 487 million 🇨🇩 Congo: 431 million 🇺🇸 US: 394 million 🇪🇹 Ethiopia: 323 million 🇮🇩 Indonesia: 297 million 🇹🇿 Tanzania: 244 million 🇪🇬 Egypt: 205 million 🇧🇷 Brazil: 185 million 🇵🇭 Philippines: 180 million 🇧🇩 Bangladesh: 177 million 🇳🇪 Niger: 166 million 🇸🇩 Sudan: 142 million 🇦🇴 Angola: 133 million 🇺🇬 Uganda: 132 million 🇲🇽 Mexico: 116 million 🇰🇪 Kenya: 113 million 🇷🇺 Russia: 112 million 🇮🇶 Iraq: 111 million 🇦🇫 Afghanistan: 110 million   @FinancialWorldUpdates Profits from free accurate cryptos signals: https://www.predictmag.com/   
    • “If the West finds itself falling behind in AI, it won’t be due to a lack of technological prowess or resources. It won’t be because we weren’t smart enough or didn’t move fast enough. It will be because of something many of our Eastern counterparts don’t share with us: fear of AI.   The root of the West's fear of AI can no doubt be traced back to decades of Hollywood movies and books that have consistently depicted AI as a threat to humanity. From the iconic "Terminator" franchise to the more recent "Ex Machina," we have been conditioned to view AI as an adversary, a force that will ultimately turn against us.   In contrast, Eastern cultures have a WAY different attitude towards AI. As UN AI Advisor Neil Sahota points out, "In Eastern culture, movies, and books, they've always seen AI and robots as helpers and assistants, as a tool to be used to further the benefit of humans."   This positive outlook on AI has allowed countries like Japan, South Korea, and China to forge ahead with AI development, including in areas like healthcare, where AI is being used to improve the quality of services.   The West's fear of AI is not only shaping public opinion but also influencing policy decisions and regulatory frameworks. The European Union, for example, recently introduced AI legislation prioritizing heavy-handed protection over supporting innovation.   While such measures might be well-intentioned, they risk stifling AI development and innovation, making it harder for Western companies and researchers to compete.   Among the nations leading common-sense AI regulation, one stands out for now: Singapore.” – Chris C Profits from free accurate cryptos signals: https://www.predictmag.com/ 
    • $NFLX Netflix stock hold at 556.59 support or breakdown?  https://stockconsultant.com/?NFLX
×
×
  • Create New...

Important Information

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