I created this simple indicator to gauge volume of opening bars relative to previous days (can specify how many using the variable) – volume is much more meaningful when evaluated relative to prior periods than in isolation in my view. I originally thought it would be a good forward indicator of trend, but there doesn’t appear to be a clear relationship. It’s quite a busy indicator and I would take any suggestions about how to clean it up. Getting rid of the series of points and solid lines that mark the averages and highest volume numbers either side of the histograms would be a good start, but I don’t think PRT will let me do that.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
b=8 StartTime = 080000 i = IntradayBarIndex IF i < i[1] THEN x = i[1] ENDIF IF Time = StartTime THEN Marker = i ENDIF // IF i = 0 THEN CumulativeVolume = 0 ELSIF i >= Marker+1 THEN CumulativeVolume = Volume + CumulativeVolume ENDIF // IF i = Marker+1 THEN VolumeFirstBar = CumulativeVolume ELSE VolumeFirstBar = 0 ENDIF IF i = Marker+2 THEN VolumeFirst2Bars = CumulativeVolume ELSE VolumeFirst2Bars = 0 ENDIF IF i = Marker+3 THEN VolumeFirst3Bars = CumulativeVolume ELSE VolumeFirst3Bars = 0 ENDIF IF i = Marker+4 THEN VolumeFirst4Bars = CumulativeVolume ELSE VolumeFirst4Bars = 0 ENDIF IF i = Marker+5 THEN VolumeFirst5Bars = CumulativeVolume ELSE VolumeFirst5Bars = 0 ENDIF IF i = Marker+6 THEN VolumeFirst6Bars = CumulativeVolume ELSE VolumeFirst6Bars = 0 ENDIF IF i = Marker+7 THEN VolumeFirst7Bars = CumulativeVolume ELSE VolumeFirst7Bars = 0 ENDIF IF i = Marker+8 THEN VolumeFirst8Bars = CumulativeVolume ELSE VolumeFirst8Bars = 0 ENDIF IF i = Marker+9 THEN VolumeFirst9Bars = CumulativeVolume ELSE VolumeFirst9Bars = 0 ENDIF IF i = Marker+10 THEN VolumeFirst10Bars = CumulativeVolume ELSE VolumeFirst10Bars = 0 ENDIF IF x >= 1 THEN HighestVolumeFirstBar = ROUND(Highest[(x+1)*b](VolumeFirstBar)) AverageVolumeFirstBar = ROUND((Summation[(x+1)*b](VolumeFirstBar))/b) HighestVolumeFirst2Bars = ROUND(Highest[(x+1)*b](VolumeFirst2Bars)) AverageVolumeFirst2Bars = ROUND((Summation[(x+1)*b](VolumeFirst2Bars))/b) HighestVolumeFirst3Bars = ROUND(Highest[(x+1)*b](VolumeFirst3Bars)) AverageVolumeFirst3Bars = ROUND((Summation[(x+1)*b](VolumeFirst3Bars))/b) HighestVolumeFirst4Bars = ROUND(Highest[(x+1)*b](VolumeFirst4Bars)) AverageVolumeFirst4Bars = ROUND((Summation[(x+1)*b](VolumeFirst4Bars))/b) HighestVolumeFirst5Bars = ROUND(Highest[(x+1)*b](VolumeFirst5Bars)) AverageVolumeFirst5Bars = ROUND((Summation[(x+1)*b](VolumeFirst5Bars))/b) HighestVolumeFirst6Bars = ROUND(Highest[(x+1)*b](VolumeFirst6Bars)) AverageVolumeFirst6Bars = ROUND((Summation[(x+1)*b](VolumeFirst6Bars))/b) HighestVolumeFirst7Bars = ROUND(Highest[(x+1)*b](VolumeFirst7Bars)) AverageVolumeFirst7Bars = ROUND((Summation[(x+1)*b](VolumeFirst7Bars))/b) HighestVolumeFirst8Bars = ROUND(Highest[(x+1)*b](VolumeFirst8Bars)) AverageVolumeFirst8Bars = ROUND((Summation[(x+1)*b](VolumeFirst8Bars))/b) HighestVolumeFirst9Bars = ROUND(Highest[(x+1)*b](VolumeFirst9Bars)) AverageVolumeFirst9Bars = ROUND((Summation[(x+1)*b](VolumeFirst9Bars))/b) HighestVolumeFirst10Bars = ROUND(Highest[(x+1)*b](VolumeFirst10Bars)) AverageVolumeFirst10Bars = ROUND((Summation[(x+1)*b](VolumeFirst10Bars))/b) ENDIF RETURN VolumeFirstBar COLOURED(51, 255, 255) STYLE(Histogram) AS "Volume first bar", HighestVolumeFirstBar COLOURED(51, 255, 255) AS "Highest volume first bar last n days", AverageVolumeFirstBar COLOURED(51, 255, 255) STYLE(Point) AS "Average volume first bar last n days", VolumeFirst2Bars COLOURED(51, 204, 255) STYLE(Histogram) AS "Volume first 2 bars", HighestVolumeFirst2Bars COLOURED(51, 204, 255) AS "Highest volume over first 2 bars last n days", AverageVolumeFirst2Bars COLOURED(51, 204, 255) STYLE(Point) AS "Average volume over first 2 bars last n days", VolumeFirst3Bars COLOURED(51, 153, 255) STYLE(Histogram) AS "Volume over first 3 bars", HighestVolumeFirst3Bars COLOURED(51, 153, 255) AS "Highest volume over first 3 bars last n days", AverageVolumeFirst3Bars COLOURED(51, 153, 255) STYLE(Point) AS "Average volume over first 3 bars last n days", VolumeFirst4Bars COLOURED(51, 102, 255) STYLE(Histogram) AS "Volume over first 4 bars", HighestVolumeFirst4Bars COLOURED(51, 102, 255) AS "Highest volume over first 4 bars last n days", AverageVolumeFirst4Bars COLOURED(51, 102, 255) STYLE(Point) AS "Average volume over first 4 bars last n days", VolumeFirst5Bars COLOURED(51, 51, 255) STYLE(Histogram) AS "Volume over first 5 bars", HighestVolumeFirst5Bars COLOURED(51, 51, 255) AS "Highest volume over first 5 bars last n days", AverageVolumeFirst5Bars COLOURED(51, 51, 255) STYLE(Point) AS "Average volume over first 5 bars last n days", VolumeFirst6Bars COLOURED(102, 51, 255) STYLE(Histogram) AS "Volume over first 6 bars", HighestVolumeFirst6Bars COLOURED(102, 51, 255) AS "Highest volume over first 6 bars last n days", AverageVolumeFirst6Bars COLOURED(102, 51, 255) STYLE(Point) AS "Average volume over first 6 bars last n days", VolumeFirst7Bars COLOURED(153, 51, 255) STYLE(Histogram) AS "Volume over first 7 bars", HighestVolumeFirst7Bars COLOURED(153, 51, 255) AS "Highest volume over first 7 bars last n days", AverageVolumeFirst7Bars COLOURED(153, 51, 255) STYLE(Point) AS "Average volume over first 7 bars last n days", VolumeFirst8Bars COLOURED(204, 51, 255) STYLE(Histogram) AS "Volume over first 8 bars", HighestVolumeFirst8Bars COLOURED(204, 51, 255) AS "Highest volume over first 8 bars last n days", AverageVolumeFirst8Bars COLOURED(204, 51, 255) STYLE(Point) AS "Average volume over first 8 bars last n days", VolumeFirst9Bars COLOURED(255, 51, 255) STYLE(Histogram) AS "Volume over first 9 bars", HighestVolumeFirst9Bars COLOURED(255, 51, 255) AS "Highest volume over first 9 bars last n days", AverageVolumeFirst9Bars COLOURED(255, 51, 255) STYLE(Point) AS "Average volume over first 9 bars last n days", VolumeFirst10Bars COLOURED(255, 51, 204) STYLE(Histogram) AS "Volume over first 10 bars", HighestVolumeFirst10Bars COLOURED(255, 51, 204) AS "Highest volume over first 10 bars last n days", AverageVolumeFirst10Bars COLOURED(255, 51, 204) STYLE(Point) AS "Average volume over first 10 bars last n days", 0 COLOURED(0, 0, 0) AS "Zero line" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Very useful! Thanks Mat, and Happy New Year
Great work. Thank you. However I am having trouble getting it to print in the first bar. If I set timing for US stocks for Stocks it always seems to do the print First Bar +1. I have tried putting the first bar as the one before and this does not help. Any suggestions anyone?