Intra-bar Volume

1052 görüntülenme
1052 9

I have take and try to improuve the source code of indicator "intra-bar volume" by backtest-rookies.com

This indicator categorized the volume in lower timeframe, if the candle close up it's a buying volume , if it close down...

Beware that is not easy to work with different TF on tradingview so you have some limitation on the TF with this indicator. Also in TV we can't have a mutable variable in a security fonction.. so my approche is not clean but it works, if someone find better way, please comment or contact me :)

So by default the indicator can work on the following TF : 5m 15m 30m 60m 120m 240m 480m 720m 1D 1W 12M .

But ... this indicator need a lower timeframe and the number of bar to work correctly, in my code i suppose that the market run 24/7, so you need to adapte it or use intraday TF for other market.

To make sure that the indicator work correctly i have juste add circle, if it's green the buying+selling+balance volume is equal to the volume on the last close candle. If it's red theire is a problem.

I hope you enjoy it, feel free to modify the code and comment if you have any sugestion, i have just make it so maybe i will ajust some part of the code.
May 24
Sürüm Notları: Sometime the count volume on lower TF is not the same of the report volume(miss data round data ? ), no impact on the indicator but the control cricle turn red, so i add a tolerence of +-1%.
May 26
Sürüm Notları: I*ve add a option to stack the buying and selling value to get the same representation as the total volume.
If the buying value is superior or equal to the selling volume the buying volume gone represente the total volume (buy vol + sell vol + balance vol) and the selling value is (blance + sell vol) and it reverse is selling volue is superior to the buying value.
With this you lose the real value of the volume for each type of volume but you get the better reading beaucause the seeling/buying/blance volume proportional to the area of the columns, and more importante you keep the information of the total volume.
May 26
Sürüm Notları: Ok so this time i have just find a way to work arround the transparence issue, I just to use a other plot and switch the buying volume. No more brown stuff just green red and black.
May 26
Sürüm Notları: stack volume is now enable by default, and i have change the order fo display for the higher categorie of volume.
Jun 15
Sürüm Notları: add precision=0 to get special rules for formatting very large numbers (like volume, e.g. '5183' will be formatted as '5K')
Jun 19
Sürüm Notları: I have update the code to allow custom setting for user.

To use it you can check "Use custom value" then the entries bellow will apply. "TF for custom value" is the TF of your chart, by default i have put 1W, and TF to look and Number of candles to "1D" and "5".
So if you are in a weekly chart the indicator will work on 5 daly candles usefull for forex, equities... You can apply only one custom setting for one timeframe, if you switch in a other timeframe the indicator will use hard coded preset.
If you select "Any" that means that the indicator will no longer detect and apply hard coded value but user value all the time.

I have also make a small change in the light check, now it will show "Error" if the total buying, selling and balance volume don't match the volume, keep in mind that it only check le last close candle of you chart and not all the data display. in case of a break of quotation, holiday... the information shown by the indicator can be wrong, but you check manualy by enable "Show classic volume".
Jun 19
Sürüm Notları: smal fix for UI.
Favori Komutlardan Çıkart Favori Komutlara Ekle
@rimko I think this is just what I am looking for. But I am just trying to figure it out. I have a chart with 3M, 1M, 1W and 1D timeframes on and have added your indicator to the 1W and 1D timeframes. I am assuming that your script looks on a lower timeframe than the indicator is applied to and then sums the buy and sell volumes on a lower timeframe to get a more accurate picture of buy and sell orders for the higher timeframe? ie: For the 1W timeframe, you may be analysing the 240m timeframe to get the sums and then plot the 240m sums on the 1W timeframe??
You mention that you have green or red circle to show if the data is correct or there is a problem, but I can't see either of these?
I would assume that the standard volume would be the same as your indicator, but it doesn't appear to always be the same.
I have attached a screenshot to show you what I am seeing. Does this look correct?

Cevap Gönder
finvim finvim
@rimko , Okay, I've have reread your notes and looked at the pictures. After scrolling past the current plot on your intra-bar indicator I can now see the green/red light. I have a green light on the 1D timeframe both normal volume levels and your intra-bar levels are the same. So all okay there. On the 1W timeframe I have a red light but the intra-bar volume follows the normal volume peaks, so it appears a good representation.

How often is the intra-bar volume sampled for 1D and 1W out of interest?

This looks just what I am after, so thanks very much for your effort.
Cevap Gönder
rimko finvim
@finvim, Hi, thx for the report as i said the indicator was made for market with 24/7 quotation time.
On a weekly chart the indicatior try to work on daily timeframe and count 7 daily candles but on fx market it's open only 5 day in a week so the value are wrong.

It's difficult to work arround for every market and in any timeframe with public holiday, trading interruption a lot of things can alter the functioning of the indicator.It's why i have put the green/red light to and the classic volume.

To answer you on daily timeframe the indicator look at 1H TF so it work on 24 candles. in weekly as a said it looks on daily TF and use 7 candles.
When i have time i will update the indicator to allow user imput or maybe custom input for each TF so anyone can configure it as he like.

If you would like to modify the indictor for forex market on weekly TF you have just to change 3 values on lines 30, 31 and 32 you will find :

"isweekly ?security(tickerid, lower_tf, buying_volume(7))" , "isweekly ?security(tickerid, lower_tf, selling_volume(7))" and "isweekly ?security(tickerid, lower_tf, balanced_volume(7))"

7 is the number of candles that the indicator sum for a weekly TF , the FX market is open only 5 days in a week so you just have to change 7 to 5 for each line and it will work.
Cevap Gönder
rimko finvim
@finvim, finaly i have find the time to update the code.
Cevap Gönder
@rimko, I've just reinstalled the indicator and its showing the custom option. Really great response and as I have said before, just what I was looking for. Thanks for your time and skill !!
+1 Cevap Gönder
@rimko, Oh yes, forgot to say, I have green now on both 1D and 1W indicators :)
+1 Cevap Gönder
love this one. Only issue is the volume numbers on the right should show 1M instead of 1000000. It makes it hard to know what the value is at a glance.
Cevap Gönder
rimko simonshawn1
@simonshawn1, Thx for comment, i have correct the code to get formatting for very large numbers.
Cevap Gönder
So just to show you how it's look with the stack option enable, i have done this to get a easier reading and to replace the built in volume indicator.
Cevap Gönder
Ana Sayfa Hisse Senedi Takipçisi Forex Takipçisi Kripto Takipçisi Ekonomik Takvim Gösterimler Nasıl Çalışır Grafik Özellikleri Ücretlendirme Kurallarımız Moderatörler Web Sitesi & Aracı Kurum Çözümleri Görsel Bileşenler(Widget) Grafik Çözümleri Hafif Grafik Kitaplığı Destek Merkezi Bir arkadaşınıza yönlendirin Yeni Özellik Talebi Blog ve Haberler SSS Viki Twitter
Profil Profil Ayarları Hesap ve Ödemeler Bir arkadaşınıza yönlendirin Destek Kayıtlarım Destek Merkezi Yayınlanmış Fikirler Takip Edenler Takip Ediliyor Özel Mesajlar Sohbet Çıkış