Hi Nicolas, no replies I see, to what I thought might be a fascinating subject?
So…. just before I have to go out, so apologies for the formatting, this is raw ascii text copied from the site so the code and the math symbols need to be configured – I may have time to come back and edit over the weekend, IF there is any glimmer of interest of course 🙂 So here is something to hopefully start the ball rolling!
User
new idea
ChatGPT
Certainly, let’s discuss a novel indicator that I’ve been contemplating recently: the “Volatility-Weighted Moving Time” (VWMT) indicator.
Concept
The idea behind the VWMT is to capture changes in market volatility and to weigh them against time intervals in which they occur. Instead of considering all time intervals as equal, the VWMT assigns more weight to time periods where there are significant price and volume movements.
Mathematical Formulation
The VWMT is calculated as follows:
Compute Volatility Score (VS) for each time interval
Calculate Time-Weight for each time interval
Finally, compute the VWMT for each time interval
Where
N is the number of periods you want to consider for the moving time window.
Visual Representation
On a graph, the VWMT would look like a moving average line but with varying smoothness and responsiveness depending on the underlying volatility and volume. High volatility would make the VWMT more sensitive, and low volatility would make it smoother.
ProRealTime Code
Here’s how you could implement this in ProRealTime:
pascal
Copy code
// Volatility-Weighted Moving Time (VWMT)
periods = 14
VS = SQRT((CLOSE – CLOSE[1])^2 + VOLUME)
TotalVS = SUM[periods](VS)
// Calculate the Time-Weight
TimeWeight = VS / TotalVS
// Calculate the VWMT
VWMT = SUM[periods](TimeWeight * CLOSE)
RETURN VWMT COLOURED(0, 255, 0) AS “Volatility-Weighted Moving Time”
Would you like to explore more about this idea, or shall we move on to another?
User
explore more
ChatGPT
Certainly, let’s delve deeper into the nuances of the Volatility-Weighted Moving Time (VWMT) indicator.
Interpretation
The VWMT’s value, much like a traditional moving average, provides a smoothed representation of price action. However, it also factors in both the volatility in price and trading volume. Because it gives more weight to periods of higher volatility and volume, this makes it potentially more responsive to significant market events.
Breakouts: A sudden and sharp deviation from the VWMT line could be indicative of a market breakout. The more significant the divergence, the stronger the breakout signal.
Convergence-Divergence: When the VWMT starts converging towards the price, it may suggest a potential period of lower volatility ahead. On the other hand, divergence could signify an upcoming volatile phase.
Cross-Over Strategies: VWMT could also be used in cross-over strategies with other moving averages. When VWMT crosses above another slower moving average, it might indicate a bullish trend, and vice versa.
Advantages and Limitations
Advantages:
Takes into account both volume and price volatility, potentially making it more responsive to market changes.
Can be adjusted for different time frames to suit various trading styles.
Limitations:
Like all indicators, it is not foolproof and should be used in conjunction with other tools and analyses.
Because it’s more sensitive during high volatility, it might generate false signals in extremely volatile markets.
Fine-Tuning
Parameter Optimization: The periods variable is flexible, and one could conduct back-testing to find the optimal setting for their specific trading style.
Smoothing: To reduce the impact of extreme values, one might consider applying a secondary smoothing algorithm to the VWMT, like a simple moving average or an exponential moving average of the VWMT line.
Would you like to discuss potential improvements, modifications, or have any specific queries on this topic?
User
can you suggest a good mathematical formula to use to smooth this, and add the Prorealcode to your reply
ChatGPT
Certainly, a common technique for smoothing data is to use an Exponential Moving Average (EMA). The EMA provides a balanced way to give more weight to recent data while still incorporating older data to a certain extent.
Mathematical Formulation for EMA
The formula for calculating the EMA of the VWMT would be:
Updated ProRealTime Code with EMA
Here’s the ProRealTime code incorporating the EMA for smoothing the VWMT:
pascal
Copy code
// Volatility-Weighted Moving Time (VWMT) with EMA smoothing
periods = 14
EMAPeriods = 10 // Number of periods for EMA smoothing
alpha = 2 / (EMAPeriods + 1) // Smoothing factor for EMA
VS = SQRT((CLOSE – CLOSE[1])^2 + VOLUME)
TotalVS = SUM[periods](VS)
// Calculate the Time-Weight
TimeWeight = VS / TotalVS
// Calculate the VWMT
VWMT = SUM[periods](TimeWeight * CLOSE)
// Calculate the EMA of VWMT
if barindex > 1 then
EMA_VWMT = alpha * VWMT + (1 – alpha) * EMA_VWMT[1]
else
EMA_VWMT = VWMT
endif
RETURN EMA_VWMT COLOURED(0, 0, 255) AS “Smoothed VWMT”
In this code snippet, EMAPeriods sets the number of periods for the EMA. You may adjust this parameter according to your preference or based on back-testing results.
The smoothed VWMT should display on your graph as a curve that is less sensitive to individual spikes, making it easier to identify general trends and patterns.
Would you like to know more about this smoothed version or another aspect of VWMT?