--- In [email protected], "Mike" <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm not sure what you meant by "compare", but I believe that the > following will at least get you going. > > The end result is a histogram such that the values are the ratio of > the HHV up days compared to the HHV down days. > > Days where the HHV of up days was greater will be green and have a > value greater than 1. Days where the HHV of down days was greater > will be red and have a value less than 1. Days where the two HHV are > equal will be red (i.e. treated as down days) and will have a value > of 1. > > For example; if the HHV of up days in the last x days was 1000 and > the HHV of down days in the same last x days was 800, then the > histogram bar will have a value of 1000/800 = 1.25 and be painted > green. > > If the HHV of up days in the last x days was 800 and the HHV of down > days in the same last x days was 1000, then the histogram bar will > have a value of 800/1000 = 0.8 and be painted red. > > The periods (i.e. x in the examples above) is a configurable > parameter. > > The farther a value is from 1, the greater was the difference (i.e. > values approaching infinity mean HHV of up day volume was much > greater than HHV of down day volume, values approaching zero mean HHV > of down day volume was much greater than HHV of up day volume). > > Periods = Param("Periods", 20, 1, 100, 1); > UpDayVolume = IIF(Close > Open, Volume, 0); > DownDayVolume = IIF(Close <= Open, Volume, 0); > HHVUpDayVolume = HHV(UpDayVolume, Periods); > HHVDownDayVolume = HHV(DownDayVolume, Periods); > > ColorBars = IIF(HHVUpDayVolume > HHVDownDayVolume, colorGreen, > colorRed); > Plot(1, "Equal", colorDarkGrey, styleLine); > Plot(HHVUpDayVolume/HHVDownDayVolume, "Up:Down ratio", ColorBars, > styleHistogram); > > Hope that helps, > > Mike > > --- In [email protected], "chorlton_c_hardy" <chorlton-c- > hardy@> wrote: > > > > Hello All, > > > > Can anyone help with this coding problem? > > > > Over the last 'x' periods, I want to compare the HHV of Volume that > > occurred on a DownDay against the HHV of Volume that occurred on an > > Upday? > > > > where: > > UpDay = C > O > > DownDay = C < O > > > > > > Any ideas on how I could go about doing this? > > > > Thanks in advance.. > > >
Mike, Many Thanks for taking the time to reply. This will definately help to get me going!!! PS. I like the idea of the histogram as a visual aid.... Kind Regards...
