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 V. Other Entry Points

Recommended Posts

feel free to help out at the Tradestation forum site for this:

 

https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=66875&SearchTerm=VWAP&txtExactMatch=

 

Sadly I don't have access there any more :( There are some forums that are public still (I think) but that one you need to be logged on for. Perhaps you can keep us informed if there are significant developments (though this might not be the appropriate thread to do it).

Share this post


Link to post
Share on other sites

I am really enjoying how you use market statistics to trade...thank you for sharing the insights into your method. I am new to intraday trading and it is refreshing to see a new twist on plotting distributions (like market profile).

 

I had a more experienced trader tell me one time that you have to find a method that speaks to you. Being mathematically inclined I am really enjoying this way of looking at the market. It is speaking to me "so to speak"

 

Glad you are finding that market statistics speaks to you dbntina. It speaks to me too. I realize for many traders, statistics is a difficult subject, so that is why I am trying to approach this in a slow methodical way, in the hope that those who are not generally familiar with statistical analysis will be able to follow along.

Starting with the next thread on scale-in, stoploss and trade management we will be getting into virgin territory for most new traders.

Share this post


Link to post
Share on other sites

Jerry,

 

Very much looking forward to it...(the next thread).

 

I think I have finished the code for tradestation users to get on an intraday chart the VWAP (same code as posted in the forum under VWAP_H) with the calculation of Standard Deviation from the square root of the variance but bands seem farther out than the one currently posted in the TS forums. I put everything in one indicator to do all plots with 1st and 2nd SD's.

 

Is there any way you can tell me where the VWAP and 1SD and 2SD bands ended today on your 2m chart of either the S&P or NQ. That will let me know if I have it right and then I will post on the forums the code or here...whatever suits everyone.

 

The question I have also is on the Variance formula I don't see it dividing by the result by the total number of price bars since the start but when you gave an example you did divide by the total number of bars. That's how I calculated it but didn't know if that was correct?

 

Thanks a bunch...will get it posted for TS users once I can verify it looks like yours.

 

dbntina

David

Share this post


Link to post
Share on other sites

jerry, since Newbie is using purely mathematical techniques, would you mind sharing the back-tested results for say, what you presented in 'V'? did the back-test optimize to an optimal stop placed above the PVP for a short/below for along? just curious if recent trading lines up with 'theory' of a skewed distribution...

 

also, is there a minimum difference between the PVP and the VWAP before the skew is considered significant enough to 'play'... ie, # of ATRs difference...?

Share this post


Link to post
Share on other sites

also, is there a minimum difference between the PVP and the VWAP before the skew is considered significant enough to 'play'... ie, # of ATRs difference...?

 

 

I find this to be a good question that I wanted to ask as well. I have been observing the markets (mostly the YM) and I find it rare to find a skew at all... seems like prices are always near the VWAP and the PVP runs through it, so there is seldom anything to trade at all, unless I am not using the proper tools. (the vwap I use was programmed by a third party for amibroker)

Share this post


Link to post
Share on other sites

Is there any way you can tell me where the VWAP and 1SD and 2SD bands ended today on your 2m chart of either the S&P or NQ.

 

David,

Here is the end of day VWAP +- SD for today August 2, 2007

 

ES 1474.11 +- 3.64

NQ 1968.52 +-5.77

 

The question I have also is on the Variance formula I don't see it dividing by the result by the total number of price bars since the start but when you gave an example you did divide by the total number of bars. That's how I calculated it but didn't know if that was correct?

 

No, it is not correct. To compute the variance correctly, use the equation I posted in the SD thread post 14545

 

You have to multiply each term in the variance by the probability distribution for the volume because the VWAP is volume weighted. That takes care of the normalization factor. The example I gave, had no weighting factor, so the variance was simply divided by the number of terms in the summation.

Share this post


Link to post
Share on other sites
jerry, since Newbie is using purely mathematical techniques, would you mind sharing the back-tested results for say, what you presented in 'V'? did the back-test optimize to an optimal stop placed above the PVP for a short/below for along? just curious if recent trading lines up with 'theory' of a skewed distribution...

 

There is actually no good way to back test something like this Dogpile, because the distribution function, the volatility and HUP distribution (Hold Up Price, which we haven't discussed yet) is constantly changing from day to day. What you will discover in the next thread, is a new paradigm about stop loss placement and trade management.

 

is there a minimum difference between the PVP and the VWAP before the skew is considered significant enough to 'play'... ie, # of ATRs difference...?

 

Very good question, glad you asked. I'll phrase it differently. How large does the skew have to be to consider taking a trade at the VWAP or SD in the direction of the skew.

The answer is: I was concerned about this for a long time. It turns out, that there is no correlation between the size of the skew (as measured by the Karl Pearson definition of skew which is (VWAP-PVP)/SD ) and the momentum of the trade in the skew direction. What only seems relevant is that a skew exist. Other HUPs will come into play between the entry point and the profit target which will play an important role in the momentum of the trade. We will discuss these in a later thread.

Share this post


Link to post
Share on other sites

Trade Station Users,

Jerry gave good description of SD function and how to calculate it in thread #IV. In the same thread I have posted code for calculating simulated SD, which tracks pretty close with ensign SW and jerry's calculation. Important point is that SD is cumulative calculation with lookback period changing thru the day to always start at the beginning of the session ( basically one has to count bars and change lookback period to include data from the first bar of the day. SD is calculating price distribution around VWAP. What SD calculation is is missing is vi/V factor vi is volume @ price; V is total volume for the session.

Share this post


Link to post
Share on other sites

<<It turns out, that there is no correlation between the size of the skew (as measured by the Karl Pearson definition of skew which is (VWAP-PVP)/SD ) and the momentum of the trade in the skew direction. What only seems relevant is that a skew exist. >>

 

thx. the problem is that if not much skew, then the stop point (PVP) will be very close to the VWAP price -- where you might be entering.

 

for example, market trades down and then retraces back up to the -1 SD level, you enter short with stop just above PVP. market trades to VWAP and overshoots a bit on noise. here is where a tight PVP might be a problem... I guess such is life.

Share this post


Link to post
Share on other sites
I find this to be a good question that I wanted to ask as well. I have been observing the markets (mostly the YM) and I find it rare to find a skew at all... seems like prices are always near the VWAP and the PVP runs through it, so there is seldom anything to trade at all, unless I am not using the proper tools. (the vwap I use was programmed by a third party for amibroker)

 

Unleashed, perhaps you can post a chart of what you see and I can take a look

Share this post


Link to post
Share on other sites

What you will discover in the next thread, is a new paradigm about stop loss placement and trade management.

 

Other HUPs will come into play between the entry point and the profit target which will play an important role in the momentum of the trade. We will discuss these in a later thread.

 

 

Really looking forward to these missing pieces of the puzzle. (and getting hold of/writing some indicators so I can follow along properly).

Share this post


Link to post
Share on other sites

Okay...I thank I got it...just need to figure out where/how to post the code in here.

 

Thanks for your help Jerry. I was able to match your numbers yesterday on ES and NQ within a tick or two so I will consider it matched.

 

Any TS coders take a look and see if it looks correct please.

 

Thanks everyone...looking forward to learning more Jerry,

 

dbntina

 

;)

Share this post


Link to post
Share on other sites

nice job dbntina -- that looks visually right -- I am not an advanced EasyLanguage guy but the bands look great.

 

would you know how to code 'PVP' to update dynamically? it is the same number that appears in the matrix window under 'Vol Bars'... would just like to place that into a 'chart analysis' window as a histogram indicator on the left side of the chart (Y axis).

Share this post


Link to post
Share on other sites

Thanks Dogpile...I am pretty confident in the formula because it is exactly the same as jperl posted. The only thing I was mainly concerned with is if the count was off by 1 bar for looping and summing the terms. It looks correct though when I look at the chart because the bands move on the 2nd intraday bar, not the 1st or 3rd so it seems to be working correctly and it matches jperls numbers (within a tick or two).

 

After looking at past intraday data it is scary how well the bands are acting as support and resistance.

 

Anyway...I am disappointed in TS and the market profile thing. Esignal has an add on for $10 a month or something like that and TS has nothing. The probability map stinks in my opinion and I actually was using marketprofileplus for a while and ghkramer has a decent one that I can't get to work on my machine (and believe me I am thankful for guys like ant and ghkramer) but TS is dropping the ball big time on this and I like TS.....

 

So the bottom line is I will probably have to write market profile code myself because I do want to know the PVP/POC (if they are exactly the same...they probably are a little different if you are using a smaller tf than 30M??) and VAH and VAL from previous days and the developing numbers as they do act as HUP's just like pivot points and such good to be aware of.

 

Anyway writing that code should make it easier to write the code for volume distribution as well. The problem I am going to have is figuring out exactly the formulas for calculating all the stuff...once I get that then I should be able to crank it out...we'll see I am kind of dreading it actually.

 

So the short answer dogpile is I don't have code for that....anyone else...of course if I create it I will post it for free.

 

Sorry this went a little of topic...ranting a little bit

 

dbntina

Share this post


Link to post
Share on other sites
Unleashed, perhaps you can post a chart of what you see and I can take a look

 

Okay, this is my YM chart taken @ 12:29pm, as you can see the VWAP is +17 above my PVP, and I would have considered going long at 13444, it is currently 12:54 and prices are hovering around there, fell through a bit to 13430s. I am wondering if going long here would have been a good idea. (I did not, only simulating)

 

attachment.php?attachmentid=2210&stc=1&d=1186159927

Share this post


Link to post
Share on other sites

Just an update. That trade would have been good for about +15 if you entered right at the VWAP, but if you held longer would have been stopped out depending on how tight you had it...

 

Market seems pretty flat, whipsawing the VWAP and bouncing off the PVP since lunch hour.

 

 

attachment.php?attachmentid=2211&stc=1&d=1186163593

vwap2.thumb.png.6abc751fd86856c3bdcea44177970c6a.png

Share this post


Link to post
Share on other sites

finally with patience a good move to the upside was there if your stops were wide enough...

 

If it wasn't obvious enough the VWAP is the yellow moving average line, and the red line mixed into it is the 89 EMA, solid horizontal line is the PVP.

 

Move was good for about +50 YM points if you had good nerves :).

 

attachment.php?attachmentid=2212&stc=1&d=1186164448

 

edit - DAMN, after this 'trade', at that 13500 level, the YM dropped 100 points in less than half an hour...

vwap3.png.f47860ef45beb4932e6d0e3c127a48fb.png

Share this post


Link to post
Share on other sites
Okay...I thank I got it...just need to figure out where/how to post the code in here.

 

Thanks for your help Jerry. I was able to match your numbers yesterday on ES and NQ within a tick or two so I will consider it matched.

 

Any TS coders take a look and see if it looks correct please.

 

Thanks everyone...looking forward to learning more Jerry,

 

dbntina

 

;)

 

You could either cut and paste the test into a message. Or use the 'manage attachments button' down below the message posting box.

 

Cheers.

Share this post


Link to post
Share on other sites

Blowfish,

 

The code is posted in the indicators section.

 

Nick had a good question about using the normalized volume to multiply with in the variance formula.

 

The indicator is doing that in the calculation. It is taking the volume of the current bar and dividing it by the total volume since the start and using that to multiply the square of the difference between price and the VWAP (and then summing all the terms of course)

 

I am pretty sure that's what we were trying to accomplish.

 

Take a look and see if the code looks correct...if not we want to catch it now. I think that is what Jerry was getting at when calculating it (that was causing the calculation to be a nightmare).

 

Cheers,

 

dbntina

Share this post


Link to post
Share on other sites
finally with patience a good move to the upside was there if your stops were wide enough...

 

Ok, for your reference unleashed, I took a look at YM at 12.28 EST. My values for VWAP and PVP are as follows:

 

VWAP= 13445

PVP = 13433 for a difference of 12 ticks.

 

And yes you could have taken the trade at 13445 and exited at the 1st SD which was 13472 at 13:54 EST for a profit of 27 ticks or held on until the 2nd SD at 13500 14:02 EST for a profit of 55 ticks.

 

HOWEVER---if you set a stoploss at the PVP you would have been stopped out earlier with a loss on the trade. This is a good example of why hard stoplosses will slowly bleed you to death. In the next thread we will discuss an alternate paradigm called risk tolerance to replace hard stop losses

Share this post


Link to post
Share on other sites

Great point Jerry. I was looking at the same thing on my chart with the bands and saw the spike just below the PVP to stop you out...before moving towards the bands....very interested in seeing the risk tolerance ideas...etc.

 

dbntina

Share this post


Link to post
Share on other sites

This is a good example of why hard stoplosses will slowly bleed you to death. In the next thread we will discuss an alternate paradigm called risk tolerance to replace hard stop losses

 

Fixed stops (and targets for that matter) are quick and dirty but take no account of changing volatility. I kind of favour using market structure (previous swing high/lows) but of course absolutely everyone know stops are located there and so they are frequently run. Then of course you can place the stop 'a few' ticks outside but that is kind of arbitrary too.

 

Dbtina thanks I'll take a look. I have concidered the PoC stuff and whilst not hard it will be a bit 'tricky' volume at each level will need accumulating in an array. I can't help feel there should be a code fragment somwhere to do this.

 

Cheers.

Share this post


Link to post
Share on other sites

Blowfish,

 

Yes I am thinking about writing some simple code for the PVP and POC intraday and maybe including that in the VWAP, SD bands code so that it will all be in one place.

 

The challenge is going to be when JPERL starts looking at the weeks PVP/POC with the weeks VWAP and SD bands and using that as a framework in framing the days statistics and taking trades that way.

 

Because I will have to figure out how to do that in code for TS as well...man this coding stuff gets tiring after a while.

 

I don't know for sure but I have a feeling JPERL is heading that direction.

 

Also the POC is simply where the most 30M TPO's occur horizontally correct...this is not the same where the most volume traded at price correct? (PVP) Just want to make sure I have it correct before trying to code it.

 

Cheers,

 

dbntina

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.


×
×
  • Create New...

Important Information

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