| Market Profile Are you a market profile trader? Post here. |
![]() | | Tweet | |
| | #81 | ||
![]() | Re: Trading with Market Statistics. IV Standard Deviation ____________________ Volume_i = UpTicks+DownTicks;// volume for a bar "i" Price_Volume = Price_Volume + (AvgPrice * Volume_i);// SUM ( Price_Volume[i] ) + AvgPrice * Volume_i Total_Volume = Total_Volume + Volume_i;// sum total volume if Total_Volume > 0 then vwap_value = Price_Volume / Total_Volume; _________________________ ____ | ||
| |
|
| | #82 | ||
![]() | Re: Trading with Market Statistics. IV Standard Deviation posted a long reply yesterday and then couldn't submit it ! I thought I saved the txt file but can't find it. I think all the tradestation calculations for VWAP may be wrong. TS native, mine, Dbntina, and the code you submitted. In your code line 3 does not sum total volume it sums volume up to bar N. Whenever a new bar comes in (with added volume) every single preceding bar needs re-calculating with the new total volume for the series. You need to do something like for n = 1 to totalnumber of bars VolumeTotal= VolumTotal + Volume(n) then you run the weighting. for n = 1 to totalnumber of bars VWAP = close * Volume(n) /VolumeTotal Basically you need to use the volume for the whole series (not just up to bar N) for the weighting. The same issue as with the SD. I'm not sure if I am explaining myself well do you see what I am getting at? If you are calculating the variance with total volume for the whole series should you not do the same for the VWAP itself? Jerry sorry to bug you I wonder if you had any comment on this, a simple yes or no would be cool ![]() Cheers, Nick. P.S. Apologies to all, I know I am being pedantic about this but its become a sort of challenge. having said that its not wrong to strive for 'truth' & 'accuracy'. | ||
| |
|
| | #83 | ||
![]() | Re: Trading with Market Statistics. IV Standard Deviation Quick reply... I will look at the code again after market close. Should be easy to print the volume out for testing... The way I read the code is: 1. Variable "Total_Volume" is set to zero at the beginning of the period ( standard TS code uses if date[0] <> date[1] then... 2. each bar you add bar volume to "Total_Volume" ( line 3 of the code I posted) | ||
| |
|
| | #84 | ||
![]() | Re: Trading with Market Statistics. IV Standard Deviation Quote:
__________________ JERRY ---I'm going to trade til I'm 100, or die trying---- | ||
| |
|
| | #85 | ||
![]() | Re: Trading with Market Statistics. IV Standard Deviation re code comments: precondition at bar number n.. _________________________ _________________________ _____ "Price_Volume" has subtotal of all Price_i * Volume_i, where i is 1 - (n-1)... and "Total_Volume" has subtotal of all Volume_i, where i is 1 - (n-1)... _________________________ _________________________ ________ NOW the bar n happens and the code below is executed Volume_i = UpTicks+DownTicks;// volume for a bar "i" Price_Volume = Price_Volume + (AvgPrice * Volume_i);// SUM ( Price_Volume[i] ) + AvgPrice * Volume_i Total_Volume = Total_Volume + Volume_i;// sum total volume if Total_Volume > 0 then vwap_value = Price_Volume / Total_Volume; I think code is correct.. How do u read ( understand)this code segment? I guess I am not sure if I understand your concern. Note: Just noticed that I used 2 forms of ES on the pic... ESU07.D is the same as @ES.D ( TS symbol for continuous contract) Last edited by nickm001; 08-27-2007 at 05:13 PM. | ||
| |
|
| | #86 | ||
![]() | Re: Trading with Market Statistics. IV Standard Deviation The concern is that the value used for total volume in all the algorithms is not the total volume for the whole series it is the volume for the series up to the bar you are processing. As an example Lets say you are processing bar 100. Total Volume is now the old Total Volume + Volume(100) you now need to re process bars 1-99 with the new total volume!! As there is more volume in the whole 'universe' Bars 1-99 need re-weighting taking into accounting for this volume. Lets use the annotation Volume(1 to 100) for the total volume for bars 1 to 100 WeightedPrice(n) = price * volume(n) / volume(1 to 100) NOT WeightedPrice(n) = price * volume(n) / volume(1 to n) Put another way the weights on all the previous bars change when the total volume changes (i.e. there is new tick). Of course you don't re-plot old bars but the weighting they contribute changes so you do need to re-calculate the series. (well strictly speaking you do). Obviously this is computationally intensive and my hunch is most software doesn't bother. TS dosent. Actually I wonder if institutions that lean heavily on VWAP do? Thats a spooky thought... the 'inaccurate' line seems to be heavily leaned upon. Cheers, Nick. P.S. the usual caveats apply - its not the line you trade its how you trade it. Yes its all a bit anal but there is a difference etc. etc. | ||
| |
|
| | #87 | ||
![]() | Re: Trading with Market Statistics. IV Standard Deviation .. add to that computational error associated with new calculations and I would say ... nahh... this is good enough..P.S. finally got your point. I would say that error is well withing the "noise" of the market. | ||
| |
|
| | #88 | ||
![]() | Re: Trading with Market Statistics. IV Standard Deviation Ironically when you have done all that leg work its probably best forgoten when you actually trade!! I also wonder if I allowed myself to get sidetracked by the subconscious demons trying to delay the final test (trading with real money). I have spent a good portion of the last week pursuing about half a dozen versions of this indicator. Actually I think I should post them but still could do with writing a decent histogram module. I can see that taking a while to get right. Cheers. | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trading With Market Statistics.II The Volume Weighted Average Price (VWAP). | jperl | Market Profile | 65 | 02-25-2012 04:02 PM |
| Trading With Market Statistics I. Volume Histogram | jperl | Market Profile | 36 | 02-21-2012 06:23 PM |
| Trading with Market Statistics III. Basics of VWAP Trading | jperl | Market Profile | 73 | 01-03-2012 08:06 AM |
| Standard deviations & Odds | rayk | Market Profile | 2 | 10-07-2006 11:13 AM |
| Trading in a Dull Market | Soultrader | Technical Analysis | 0 | 09-06-2006 11:44 AM |