OPEN-SOURCE SCRIPT
Updated Volume-Weighted Trend Oscillator

The purpose of the Volume-Weighted Trend Oscillator (VWTO) indicator is to analyze both price movement and trading volume, along with the rate of change in price, to create a composite signal for tracking market trends. Below is a detailed breakdown of how it functions
VWTO Calc:
If the current close is higher, the volume is added.
If the current close is lower, the volume is subtracted.
This volume difference is summed over the orderFlowPeriod and normalized by dividing the result by 1000, resulting in the orderFlow value.
Rate of Change (ROC):
The rate of change in price (roc) is calculated over a user-defined period (lenr). This ROC measures the momentum of price movement.
Combined Oscillator Calculation:
The Volume-Weighted Trend Oscillator is computed by averaging the ROC and the volume-based trend flow: (roc + orderFlow) / 2.
An optional exponential moving average (ematrend) of this combined oscillator can be plotted if the user enables it.
The indicator changes color dynamically based on the direction of the trend:
If trendflow (the combined oscillator) is positive and increasing, it is colored green.
If it is negative and decreasing, it is colored red.
The colors allow users to quickly visualize whether the trend is strengthening or weakening.
Plotting:
The script generates several plots:
The trendflow value is plotted as a column-style chart with dynamic color changes that reflect the direction and strength of the trend.
The orderFlow (volume-based trend) is also plotted, colored green for positive values and red for negative values.
An optional exponential moving average of the trendflow can be plotted in white if the user chooses to display it.
The chart's candles are colored green or red depending on whether the order flow is positive or negative.
Also includes a robust tester to see if it's a good fit for your system, "BANGER" = good, "MEH" = not optimal.
Trend Signal Output:
The indicator produces a final signal (final) based on the direction of the orderFlow:
A value of 1 signifies a positive trend (bullish).
A value of -1 indicates a negative trend (bearish).
VWTO Calc:
If the current close is higher, the volume is added.
If the current close is lower, the volume is subtracted.
This volume difference is summed over the orderFlowPeriod and normalized by dividing the result by 1000, resulting in the orderFlow value.
Rate of Change (ROC):
The rate of change in price (roc) is calculated over a user-defined period (lenr). This ROC measures the momentum of price movement.
Combined Oscillator Calculation:
The Volume-Weighted Trend Oscillator is computed by averaging the ROC and the volume-based trend flow: (roc + orderFlow) / 2.
An optional exponential moving average (ematrend) of this combined oscillator can be plotted if the user enables it.
The indicator changes color dynamically based on the direction of the trend:
If trendflow (the combined oscillator) is positive and increasing, it is colored green.
If it is negative and decreasing, it is colored red.
The colors allow users to quickly visualize whether the trend is strengthening or weakening.
Plotting:
The script generates several plots:
The trendflow value is plotted as a column-style chart with dynamic color changes that reflect the direction and strength of the trend.
The orderFlow (volume-based trend) is also plotted, colored green for positive values and red for negative values.
An optional exponential moving average of the trendflow can be plotted in white if the user chooses to display it.
The chart's candles are colored green or red depending on whether the order flow is positive or negative.
Also includes a robust tester to see if it's a good fit for your system, "BANGER" = good, "MEH" = not optimal.
Trend Signal Output:
The indicator produces a final signal (final) based on the direction of the orderFlow:
A value of 1 signifies a positive trend (bullish).
A value of -1 indicates a negative trend (bearish).
Release Notes
Quick fixOpen-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.