Tetsumaz

Time Dilated Donchian Channel

Before anything, take notes of the script limitations :
1) The script has the setting : "Max_bars_back" set to 390. This is required to use dynamic length and an "internal clock"
*390 is the normal number of bars in a typical stock trading day.

2) The script requires volume data to work correctly
* I use a way to represent volatility that requires ( volume + price movement + time, no sma , no stdev)
Why ? Because:
HIGH-LOW = Fail to get gap information, fail to get volume information
TR /ATR = Fail to get volume information
STDEV = Not very good with dynamic length as it use SMA and fails when length <2
SMA = SMA give very strange results when using non-integer numbers.

So a good idea is to use the 1 minute timeframe for this indicator.

Conclusion: this script is basically limited to stock trading.
If I could set Max_bars_back to 23 400 this would even work better with a 1 second time frame as more data would be entered in the system.

The idea behind the script is that volatility exists in two different formats depending on how you observe the situation.
Remember your physics class? Light can be a wave or a particle depending of the situation.
Volatility seems to share a strange similar property.

If volatility share similarities with light, then time dilation effect could be applied to stock movement.

Time Dilation formula
Time observed = (Last time - First time) / sqrt(1-(pow(v,2)/pow(c,2))
I've tried a lot of ways to use this formula as is.
Problem is : C.
C is the speed of light and I haven't found the equivalent stock market constant yet.

So I had to tweak the time dilation formula to make it compatible with my volatility. The result is not perfect but it's interesting.
Sometime my volatility gets over that "unknown C stock market constant" which cause "Time travel"

In order to keep the law of physics like they actually work, when a new time is set, I had to "Protect its value".
protected_new_time = highest_(observed time , normal time)
No time travel is allowed. *yet.

I've "speculated" more signal lines by using mathematical geometry.
(Reflective & Inverted)

I've also created another Script that show you the effect volatility over time named : DC Time Keeper.
The script has no other use in itself. It's really only a way to represent how time gets slowed by speed.


For more information about time dilation:
https://en.wikipedia.org/wiki/Time_dilation
Protected script
This script is published closed-source but you may use it freely. You can favorite it to use it on a chart. You cannot view or modify its source code.
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.

Want to use this script on a chart?