Problem Calculating Value Area For Market Profile

Sell the highs, buy the lows, take their money, bash their nose.
User avatar
opmtrader
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by opmtrader »

I'm trying to experiment with some Market Profile / Value Area strategies systematically. I am having a problem calculating the Value Area in Market Profile. The Value Area, as I understand it, is the zone in which 70% of the volume in the profile has taken place.



Visually I would identify the Value Area as the largest bulge area of the Market Profile. If I applied an algorithm to replicate this I would likely find the Point of Control (the single price showing the most volume) and work my way on either side of this point until I had identified 70% of the volume.



This approach seems reasonable until you consider the case of two bulged areas of volume concentration on the profile seperated by a large span of prices, one near the low end and one near the high end. How would one identify the Value Area of that profile in an algoritmic fashion? Finding the POC and working from there really would obscure the real distribution. This type of multi-peaked profile can occur a lot when using multi day lookback periods.



Is there a standard way to calculate the Value Area? Any traders here using Market Profile that could shed light on this problem? Also any creative insights on how to approach this problem will be appreciated as well. Thank you.
User avatar
TonyC
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by TonyC »

well, i read a book about market profile about 15 years ago . . . dont remember much, mostly a picture of a primitive bell spapped curve . . .



. . . but it strikes me that the ''middle'' 70% is bounded by the 15th and 85th percentiles



so just define a two column array, column 1 prices, column 2 associated volumes, sort the array by column one, and throw out everthing below the 15th and above the 85th percentiles of volume



this also properly accounts for a day that is constantly rising [falling] with big volume at the end or the beginning of the day
flaneur/boulevardier/remittance man/energy trader
User avatar
opmtrader
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by opmtrader »

TonyC, thanks for the help. I believe I have done something similar to what you've recommend. Here's what I have done:



1 X

2 X

3 X

4 X

5 XXX

6 XXXX

7 XXX

8 XXXXXX

9 XXXXX

10 XXXXXXXX

11 XXXXXXXXXXXX

12 XXXXXXXXXXX

13 XXXXXXXXXXXXXXXXXXXX

14 XXXXXXXXXXXXXXXXXXXXXX

15 XXXXXXXXXXXXXXXXXXX

16 XXXXXXXXXXXXXXXXX

17 XXXXXXXXXXXXXXXX

18 XXXXXXXXXX

19 XXXXXXXX

20 XXXXXX

21 XXXX

22 XX

23 X

24 X

25 X

26 X

27 X

28 X

29 X

30 X



This is a volume profile. I start at point 14, tabulate the volume, see whether 13 or 15 have more volume, proceed to tabulate in that direction, checking each time to find the next highest line in the area. So my accumulation of volume would proceed in order on lines 14, 13, 15, 16, 17, 12, 11, 18, 19, 10, until volume_accumulated = total_volume*0.70. In this way the value area is a continuous block of prices likely from 10 to 19. That's no problem.



What I am concerned about is a multi day lookback period where you might get a dumbell shaped curve like the following (identical copies of one another)



1 X

2 X

3 X

4 X

5 XXX

6 XXXX

7 XXX

8 XXXXXX

9 XXXXX

10 XXXXXXXX

11 XXXXXXXXXXXX

12 XXXXXXXXXXX

13 XXXXXXXXXXXXXXXXXXXX

14 XXXXXXXXXXXXXXXXXXXXXX

15 XXXXXXXXXXXXXXXXXXX

16 XXXXXXXXXXXXXXXXX

17 XXXXXXXXXXXXXXXX

18 XXXXXXXXXX

19 XXXXXXXX

20 XXXXXX

21 XXXX

22 XX

23 X

24 X

25 X

26 X

27 X

28 X

29 X

30 X

31 X

32 X

33 X

34 X

35 XXX

36 XXXX

37 XXX

38 XXXXXX

39 XXXXX

40 XXXXXXXX

41 XXXXXXXXXXXX

42 XXXXXXXXXXX

43 XXXXXXXXXXXXXXXXXXXX

44 XXXXXXXXXXXXXXXXXXXXXX

45 XXXXXXXXXXXXXXXXXXX

46 XXXXXXXXXXXXXXXXX

47 XXXXXXXXXXXXXXXX

48 XXXXXXXXXX

49 XXXXXXXX

50 XXXXXX

51 XXXX

52 XX

53 X

54 X

55 X

56 X

57 X

58 X

59 X

60 X



Then perhaps if I chose the lower peak as the peak my algorithm would progress until it accumulated 70% of the volume which would likely identify the range of 17 to 60 as the value area, when in fact this betrays the visual interpretation of dual value areas from 10 to 19 and 40 to 49.



Any ideas? Did TonyC's suggestion to "throw out everthing below the 15th and above the 85th percentiles of volume" solve my problem and I am not recognizing that, or does that not exactly apply when you get far outside the shape of bell shaped distributions?
User avatar
FDAXHunter
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by FDAXHunter »

I don't see the problem? TonyC's solution should give you exactly what you need?

Work down your column from 1 and throw out 1,2,3,4,5,6,7,8 etc. till you have accounted for 15% of the total.

Then proceed to throw out 60,59,58,57,58 etc. till you have chucked out 15% of the bottom profile.



Note that for distributions that are monotonically increasing, this doesn't work.
The Figs Protocol.
User avatar
opmtrader
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by opmtrader »

True. Admittedly when I read that I wasn't thinking clearly about where to start the loop. Bottom and top obviously and work inward. I just wasn't thinking. Thanks TonyC anf FDAX.



Using that approach will give me the same exact answer in the first example. It will give me a slightly different answer in the second example than the way I was doing it. Shouldn't be too different though. Any way you slice it that second example is kind of a mess unless you are going to do two value areas.
User avatar
opmtrader
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by opmtrader »

As we've discussed in other threads I'm not too sure about the usefulness of the Market Profile concept. I thought I'd check it out. I have heard that there is a propensity for price to pass through the previous Value Area when the market opens outside the Value Area range and then proceeds back inside its boundary. Probably no better than any other mean reverting kind of idea but I'll test it. What's a day or two if it reveals a good strategy right? Any other well recognized Market Profile strategies I'm not aware of?
User avatar
TonyC
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by TonyC »

> Note that for distributions that are monotonically increasing, this doesn't work.



i did write my response just before nodding off in the barcolounger, but ,it doesn't?
flaneur/boulevardier/remittance man/energy trader
User avatar
FDAXHunter
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by FDAXHunter »

Well, strictly speaking, it will give you the 70% of the volume area.



Consider this distribution:



0 X

1 X

2 XX

3 XXX

4 X

5 XXXXX

6 XXXXXX

7 XXXXX

8 XXXXXXX

9 XXXXXXXXXX



While you can calculate the price area making up 70% of the volume (3-9) it would be better to recognize that this distribution is in fact "one sided" and simply take the range as 5-9.

So, technically it does work, but I don't think it that situation it would be accurate, because you could be discarding prices where volume was, in fact, heaviest. Pedantic maybe.
The Figs Protocol.
User avatar
opmtrader
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by opmtrader »

Hey guys, I finally got around to getting this code to work.  On my first trial run I found an example of the scenario I was hoping to avoid.  Seems like we've already laid out the ways we can deal with this.  I just wanted to show you what I was talking about.



[img]/beta/User%20Files/5/Market%20Profile%20-%20Dumbell.jpg[/img]
User avatar
opmtrader
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Problem Calculating Value Area For Market Profile

Post by opmtrader »

I thought this was funny. On www.dailyspeculations.com Victor Niederhoffer was talking about examining a new indicator and said the following if it does not work out:



"If nothing of value turns up, it's an encompassing system like market profiles et al that could foster a series of seminars around the world, books, and newsletters, and money management services (placed of course in a fund of funds to reduce risk). And, that's just for openers."



I thought that was hilarious.
Post Reply