LOG scale for Volume: a solution for you...
This topic has been replaced by our new Incredible Support Tracking System. If you need support please submit a Support Request.


Last Poster 
Posts 
Pages 
Last Post 

Closed: New threads not accepted on this page 





Author 
Message 
luigidedeo
Member
Username: luigidedeo Post Number: 4 Registered: 092004Rating: Votes: 1

 Saturday, October 02, 2004  02:56 am: 

Hi Colin, I assume what we want achieve here is to resolve with nakedeye differences BETWEEN orders of magnitude and differences greater than 2x WHITHIN the same order. We dont care about differences less that 2x (or 1.5x) within the same order. Which is something reasonable. What does it mean? 1) We want to keep the visibility of differences between eg: 1, 10, 100, 1000 (BETWEEN) 2) But  at the same time  we dont want to lose the visibility of the difference between eg 10 and 20, 100 and 150 or 200, 1000 and 1500, and so on. (WITHIN) 3) We dont deem relevant differences comparable to 1 order of magnitude below the reference. We dont pay attention to differences between eg: 10 and 12; 100 and 120; 1000 and 1100, etc... Now if you use the LOG scale appropriately, it is excelent for this purpose. Here it is how you should set it up. Nice and easy. 1) Take the minimum of the volumes in the TimeWindow shown in the chart. 2) Name this minimum as Vm 3) Calculate for each day: Vl=LOG(Vd/Vm) LOG is log base 10 Vd the volume of the day Vl the transformation of the volume of the day Vm the minimum Volume in the Time Window 4) Display the series on Vd by adding to each a baseline equal to Vm so that: Vldisplay= Vl + Vm 5) You might wanna mark horiziontal lines that mark orders of magnitude (LOG10/Vm, LOG100/Vm, LOG1000/Vm) for the unaccustomed eye. Why this is OK? 1) No negative Vl values as Vd>Vm always by definition 2) Fuflill requirement 1/2/3 above mentioned 3) No discontinuity in Reference(Vm) whithin the window shown... Attached a quick example of the effect we get. (It's just a quick excel, dont expect nice stuff) What do yo think? Regards Luigi

colin_twiggs
Member
Username: colin_twiggs Post Number: 1326 Registered: 092002Rating: Votes: 1

 Saturday, October 02, 2004  10:17 am: 

Thanks Luigi That looks very interesting. So we plot the log rather than a log scale. It should be fairly straightforward to implement. Regards Colin

colin_twiggs
Member
Username: colin_twiggs Post Number: 1377 Registered: 092002Rating: N/A Votes: 0

 Tuesday, October 12, 2004  06:12 pm: 

Luigi I have played around with some figures and plotting the log (base 10 or natural log) fails to highlight the significance of changes in volume. See attachment below. Regards Colin

colin_twiggs
Member
Username: colin_twiggs Post Number: 1378 Registered: 092002Rating: N/A Votes: 0

 Tuesday, October 12, 2004  06:22 pm: 

Volumes in the middle range (2m to 5m) appear very similar in size. Only the largest spike (20m) stands out. Regards Colin

mosaic1996
Member
Username: mosaic1996 Post Number: 979 Registered: 012003Rating: N/A Votes: 0

 Tuesday, October 12, 2004  06:42 pm: 

Luigi, Colin, Doesn't matter whether you use Log10 or Ln as they are essentially the same in that the bars have the same relative height, i.e., Ln(Vol) = Log10(Vol)/Log10(e) = Log10(Vol)/constant so only the yaxis scale changes. To make the bars standout you need to apply some other transformation to have the desired effect, i.e., to increase the percentage of screen real estate assigned to normal volume ranges. You also have to look at data that replicates the problem. I would suugest the following data point 40m bigger spike 20m big spike 2.5m normal very high volume 1.5m normal high volume 1.0m normal volume 0.5m normal low volume 0.1m normal very low volume I have done some work as posted on another thread http://www.incrediblecharts.com/userscripts/forums/show.plx?tpc=24&post=51740#PO ST51740 PLOTt = LOG( (VOLt + VOLscale) / VOLscale) where PLOTt is the plot point at time period t Volt is the actual volume at time period t and I would try Volscale to the follwoing values as a starting point 40.0m (max vol) 20.0m 2.0m 1.0m 0.5m 0.25m Luigi, if you have the time could you code and post charts for the model that I have suggested. Please let me know if the above doesn't make sense and I will try and explain it better. Cheers, Mosaic (Message edited by mosaic1996 on October 12, 2004)

colin_twiggs
Member
Username: colin_twiggs Post Number: 1380 Registered: 092002Rating: N/A Votes: 0

 Tuesday, October 12, 2004  06:50 pm: 

Mosaic Your formula best highlights the differences in the midrange. See attachment below. What is the purpose of the Volscale? Is this to avoid Log of zero errors? Regards Colin

colin_twiggs
Member
Username: colin_twiggs Post Number: 1381 Registered: 092002Rating: N/A Votes: 0

 Tuesday, October 12, 2004  06:51 pm: 


mosaic1996
Member
Username: mosaic1996 Post Number: 980 Registered: 012003Rating: N/A Votes: 0

 Tuesday, October 12, 2004  06:53 pm: 

One other aspect that you have to consider is that the method used has to also work for normal volume. So in the above examples, you could eliminate the 2 volume spikes from the data (40m and 20m) and use Volscale values of 2.0m (nonspike max), 1.0, 0.5, and 0.25. Cheers, Mosaic

mosaic1996
Member
Username: mosaic1996 Post Number: 981 Registered: 012003Rating: N/A Votes: 0

 Tuesday, October 12, 2004  07:06 pm: 

Colin, To better understand the issue, can you change the data points to the volume data that I suggested  or something similar. The objective of using scale factor is to make the numbers smaller which then makes the relative logs differences larger, which means that you make better use of screen real estate. Rewriting the formula to highlight the two parts PLOTt = LOG( Volt/VolScale + 1) where you can more clearly see the scaling factor and the +1 is to make sure that all plot values are >= 0. Cheers, Graeme (alias Mosaic  I am sure that I am going to write Mosaic in a legal document in the not too distant future)

mosaic1996
Member
Username: mosaic1996 Post Number: 982 Registered: 012003Rating: N/A Votes: 0

 Tuesday, October 12, 2004  07:08 pm: 

The +1 also avoids Log(0) errors and results in a PLOTt = 0 for Volt = 0. Cheers, Graeme

macka
Member
Username: macka Post Number: 75 Registered: 102003Rating: N/A Votes: 0

 Tuesday, October 12, 2004  08:39 pm: 

Mos Mate, you are going to have to get a life. I just hope that you are not a blood donor. I am sure that it would come out black as your oil industry knowledge would make any Saudi Arabian green with envy. Are there any oil industry issues that you are not across ?. And what are these formulae that you and Colin are exchanging all about ?. So no other option. When we can convince the Captain to have another table you must again grace us with your presence. Regards....Macka...

colin_twiggs
Member
Username: colin_twiggs Post Number: 1384 Registered: 092002Rating: N/A Votes: 0

 Friday, October 15, 2004  07:42 am: 

Mosaic, Have been thinking about this. The +1 deals with the log of zero problem in much the the same way as my earlier spreadsheet: IF(Vol>0,0,Log(........)). It only calculates the log if volume is greater than zero, otherwise it substitutes 0. I am currently experimenting with the Richter scale (for measuring earthquakes). The formula is: 2/3*LOG10(Vol)0.9 Or in Excel: =IF(Vol>0,2/3*LOG10(Vol)0.9,0) See attached spreadsheet. Regards Colin

mosaic1996
Member
Username: mosaic1996 Post Number: 983 Registered: 012003Rating: N/A Votes: 0

 Friday, October 15, 2004  03:46 pm: 

Colin, Firstly, the better solutions to the data spike problem are a) price and volume overlaid in the same chart space, e.g., charts posted by Hershy http://www.incrediblecharts.com/userscripts/forums/show.plx?tpc=8&post=42268#POS T42268 b) cropping/capping volume at some value, say n time x day MA However, persuing the rescaling approach that we have been discussing..... There is a problem with your formula when the Vol is <= 22, but I will get to that later. The Richiter solution is the same as I proposed, only with a suboptimal scale factor.. Richter = 2/3 * LOG(vOL)0.9 = 2/3 * ( LOG(Vol)  0.9*3/2 ) = 2/3 * ( LOG(Vol)  1.35) = 2/3 * ( LOG(Vol)  LOG( 22.39) ) = 2/3 * LOG (Vol / 22.39) = LOG ( {Vol / 22.39 ) ^ (2/3) ) where ^ is raised to the power of. Now muliplying the log by 2/3 (a constant) doesn't change anything in realtive terms, it only changes the scale on the yaxis, and all the data points will have exactly the same realtive position. So we can get rid of the 2/3, which leaves us with = LOG( Vol / 22.39 ) Now the problem with this formula is that when the volume is less than 22.39, you will have a log of a number that is less than 1, which is negative. Now one way around this is to add 22.39 (or more) to the Vol to avoid the problem of plotting negative values, and fortunately it also maps a Volume of 0 to 0  a desirable outcome. So now the forumla becomes = LOG( (Vol + 22.39) / 22.39 ) which is one instance of = LOG( (Vol + VolScale) / VolScale ) which is what I proposed in the first place. I have done a little extra research and I believe that one of the better VolScale values is around 15% of a 200 period SMA which I believe would be far superior to a value of 22.39 (far too small). To guage the effectivenes of any solution, you need to look at the two broad cases: a) volume spike b) no volume spike and you need to select/design data series that are representative of these two cases. I would suggest the following data series Series 1: 100m, 50m, 5m, 2m, 1.5m, 1m, 500k, 250k, 100k, 50k, 10k.  very unusual spike Series 2: 50m, 5m, 2m, 1.5m, 1m, 500k, 250k, 100k, 50k, 10k.  typical (but infrequent) spike Series 3: 5m, 2m, 1.5m, 1m, 500k, 250k, 100k, 50k, 10k  normal series and where the main volume points of interest lie in the 500k to 5m range, and the 200 SMA is say 1.5 million, so my suggested scale factor would be 225k. Cheers, Graeme

mosaic1996
Member
Username: mosaic1996 Post Number: 984 Registered: 012003Rating: N/A Votes: 0

 Friday, October 15, 2004  07:42 pm: 

Re. RICHTER FORMULA < 0 Just in case it wasn't evident from my jottings... = 2/3*LOG(vol)0.9 say volume = 10 = 2/3 * log(10)0.9 =2/3 * 1  0.9 = 0.6666  0.9 = 0.23333 Cheers, Graeme



Protect Your Capital
Incredible Charts offers
ATR, Chandelier, Ichimoku, Keltner, Parablolic SAR, Safezone and Volatility trailing stops.
Download and receive a 30day FREE TRIAL of our Premium Service.
