woodyjohnson

[WJ] - Corrected Seconds Volume

** ONLY WORKS FOR SECONDS CHARTS **

After staring at a chart and scratching my head, I realized that the volumes were being incorrectly reported for lower time frames.

A chart that has no updated tick for 5 minutes will report the volume that occurred in the WHOLE 5 minutes - in one tick.
For a 5 second chart like above, we have now a chart that at first appearance is giving us numbers to believe that there is MUCH more liquidity than is real.

This can really confuse us, and other scripts that rely on volume information.

This script simply takes into consideration the time delay before the next tick. If it took 5 minutes to update a tick, the volume should be divided into whatever seconds we are currently using. I also changed the coloring code - if there is no length to the candle it will look at the candle before it to determine if it is a positive or negative movement.

It does make technical sense to have the volume that occurred over 5 minutes in one tick as it is the true volume. However, this script should not be viewed as the absolute value, but a consistent, usable number that will be more accurate with tools.

To give a quick example on why this is important:

In a 10 second chart, we are given an updated tick every minute. In 2 minutes we have 2 ticks that have 1K volume each.
Alternatively, we have a 10 second chart, and we are given an updated tick every 10 seconds. In 2 minutes we have 12 ticks that have 100 volume each.

With quick mental math we can determine that the second scenario is actually (albeit slightly) more busy. However, a script would not do that extra layer of math and would assume that the first scenario is bouncing off the walls with activity and the second is a graveyard.

It's exactly for this example that I have created this script, and I hope it helps someone else out.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?