OPEN-SOURCE SCRIPT

Volume Delta Trailing Stop [LuxAlgo]

The 'Volume Delta Trailing Stop' indicator uses Lower Time Frame (LTF) volume delta data which can provide potential entries together with a Volume-Delta based Trailing Stop-line.

🔶 USAGE

Our 'Volume Delta Trailing Stop' script can show potential entries/Stop Loss lines
스냅샷
스냅샷

A trigger line needs to be broken before a position is taken, after which a Volume Delta-controlled Trailing Stop-line is created:
스냅샷
스냅샷

🔶 DETAILS

🔹 Volume rises when bought or sold

🔹 When the opening price appears on the chart, a buy/sell order has been executed.
If that order is less than the available supply of that particular price, volume will rise, without moving the price.

🔹 When the opening price is the same as the closing price, the volume of that bar can be seen as "neutral volume" (nV); nor "up", nor "down" volume.

Example

A buy order doesn't fill the first available supply in the order book. This price will be the opening price with a certain volume.
When at closing time, price still hasn't moved (the first available supply in the order book isn't filled, or no movement downwards),
the closing price will be equal to the opening price, but with volume. This can be seen as "neutral volume (nV)".

🔹 Delta Volume (ΔV): this is "up volume" minus "down volume"

🔹 Standard volume is colored red when closing price is lower than opening price ( = "down volume").

🔹 Standard volume is colored green when closing price is higher OR equal (nV) than opening price ( = "up volume").

스냅샷

🔹 Neutral Volume

The "Neutral-Volume" is considered "Up-Volume" - setting will dictate whether nV is considered as green 'buy' volume or not.
스냅샷
스냅샷

🔶 EXAMPLE

29 July 10:00 -> 10:05, chart timeframe 5 minutes, open 29311.28, close 29313.89

close > open, so the volume (39.55) is colored green ("up volume").
(The Volume script used in the following examples is the open-source publication Volume Columns w. Alerts (V) [LucF] from LucF)
스냅샷

Let's zoom to the 1-minute TF:
The same period is now divided into more bars, volume direction (color) is dependable on the difference between open and close.
Counting up and down volume gives a more detailed result, it remains in an upward direction though):
스냅샷
(ΔV = +15.51)

Let's further zoom in to the 1-second TF:
The same period is now divided into even more bars (more possibility for changing direction on each bar)
Here we see several bars that haven't moved in price, but they have volume ("neutral" volume).
(neutral volume is coloured light green here, while up volume is coloured darker green)
When we count all green and red volume bars, the result is quite different:
스냅샷
(ΔV = -0.35)
In total more volume is found when price went downwards, yet price went up in these 5 minutes.



When we split the green "up volume" into "up" and "neutral", the difference is even higher
(here "neutral volume" is colored grey):
스냅샷
(ΔV = -12.76; "up" - "down")

🔶 CONCEPTS



🔹 Potential positioning - forming of Trigger-line

When not in position, the script will wait for a divergence between price and volume direction. When found, a Trigger-line will appear:

• at high when a blue bar appears (bullishBear).
• at  low when an orange bar appears (bearishBull).

Next step is when the Trigger-line is broken by close or high/low (settings: Trigger)

Here, the closing price went under the grey Trigger-line -> bearish position:
스냅샷

🔹 Trailing Stop-line

When the Trigger-line is broken, the Trailing Stop-line (TS-line) will start:

low when bullish position
high when bearish position

You can choose (settings -> Trigger -> Close or H/L) whether close price or high/low should break the Trigger-line

When alerts are enabled ("Any alert() function call"), you'll get the following message:
• 'signal up'  when bullish position
• 'signal down' when bearish position

After that, the TS-line will be adjusted when:
• a    blue    bullishBear  bar appears when in bullish position  ->  lowest   of {low , previous blue bar's high or orange bar's low}
• an orange bearishBull bar appears when in bearish position -> highest of {high, previous blue bar's high or orange bar's low}

스냅샷
스냅샷

When alerts are enabled ("Any alert() function call"), and the TS-line is broken, you'll get the following message:
• 'TS-line broken down'  when out bullish  position
• 'TS-line broken up'       when out bearish position
스냅샷

🔹 Reference Point

Default the direction of price will be evaluated by comparing closing price with opening price.
When open and close are the same, you'll get "neutral volume".

You can use "previous close" instead (as in built-in volume indicator) to include gaps.
If close equals open, but close is lower than previous close, it will be regarded as "down volume",
similar, when close is higher than previous close, it will be regarded as "up volume"

Note, the setting applies for the current timeframe AND Lower timeframe:

Based on: "open" (close - open)
스냅샷

Based on: "previous close" (close - previous close)
스냅샷

🔹 Adjustment

When the TS-line changes, this can be adjusted with a percentage of price, or a multiple of "True Range"

Default (Δ line -> Adjustment - 0)
스냅샷

Δ line -> Adjustment 0.03% (of price)
스냅샷

Δ line -> Mult of TR (10)
스냅샷

🔶 SETTINGS

🔹 LTF: choose your Lower TimeFrame: 1S (seconds), 5S, 10S, 15S, 30S, 1 minute)

🔹 Trigger: Choose the trigger for breaking the Trigger-line; close or H/L (high when bullish position, low when bearish position)

🔹 Δ line (Trailing Stop-line): add/subtract an adjustment when the TS-line changes (default: Adjustment):

• Adjustment (default: 0): add/subtract an extra % of price
• Mult of TR                     : add/subtract a multiple of True Range

🔹 Based on: compare closing price against:

open
previous close

🔹 "Neutral-Volume" is considered "Up-Volume": this setting will dictate whether nV is considered as green 'buy' volume or not.

🔶 CONSIDERATIONS

🔹 The lowest LTF (1S) will give you more detail and will get data close to tick data.
However, a maximum of 100,000 intrabars can be used in calculations.
This means on the daily chart you won't see anything since 1 day ~ 86400 seconds. (just over 1 bar)
-> choose a lower chart timeframe, or choose a higher LTF (5S, 10S, ... 1 minute)

🔹 Always choose a LTF lower than the current chart timeframe.

🔹 Pine Script™ code using this request.security_lower_tf() may calculate differently on historical and real-time bars, leading to repainting.
deltavolumeLTFluxalgotrailingstopTrend AnalysistrendtradingtruerangeVolume Indicatorvolumedelta

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?


Get access to our exclusive tools: luxalgo.com

Join our 150k+ community: discord.gg/lux

All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
또한 다음에서도:

면책사항