Registered User Joined: 5/12/2016 Posts: 13
|
I am in the processing of trying to move from tradingview to TC2000 if I can get all of my custom filters over and I need help with this one please:
study(title="Fisher Transform of On Balance Volume with CCI", shorttitle="DM_-_Fisher_of_OBV_CCI")
//On Balance Volume
src = close
obv = cum(change(src) > 0 ? volume : change(src) < 0 ? -volume : 0*volume)
//Fisher Transform of OBV
length = input(9, minval=2, title="Period of Fisher Transform of OBV")
high_ = highest(obv, length)
low_ = lowest(obv, length)
round_(val) => val > .99 ? .999 : val < -.99 ? -.999 : val
value = round_(.66 * ((obv - low_) / max(high_ - low_, .001) - .5) + .67 * nz(value[1]))
fish1 = .5 * log((1 + value) / max(1 - value, .001)) + .5 * nz(fish1[1])
lengthCCI = input(4, minval=1, title="CCI Length")
threshold=input(0, title="CCI threshold for OBV coding")
lengthema=input(13, title="EMA length")
signallen = input(12, title="Linear Regression Signal Line Period")
signal = linreg(fish1,signallen,0)
o=fish1
c=cci(src, lengthCCI)
fish2 = fish1[1]
plot(fish2, color=silver, title="Fast Signal Line")
plot(o, color=c>=threshold?green:red, title="OBV_CCI coded", linewidth=2)
plot(ema(o,lengthema), color=orange, linewidth=2)
plot(signal,color=red, title="Linear Regression Signal Line")
hline(0, color=maroon)
hline(0, color=maroon)
hline(0, color=maroon)
Much thanks in advance!
|
Registered User Joined: 5/12/2016 Posts: 13
|
Per Bruce here is Fisher Transform(10)
A Fisher Transform 10 from TC2000 can be written as follows.
XAVG(LOG(2 * XAVG(((H + L) / 2 - MINL10) / (MAXH10 - MINL10), 5) / (2 - 2 * XAVG(((H + L) / 2 - MINL10) / (MAXH10 - MINL10), 5))), 3)
Looks like OBV is just represented as OBV.
|
Registered User Joined: 5/12/2016 Posts: 13
|
These also need to be used on HA candles, any help will be appreciated.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The 9-period Fisher transform of OBV portion would just seem to be the following.
ARCTANH(XAVG(2 * (OBV - MIN(OBV, 9)) / (MAX(OBV, 9) - MIN(OBV, 9)) - 1, 5))
And you can add three child indicators to this if you plot it as a Custom PCF Indicator.
1-period exponential moving average with an offset of 1.
13-period exponential moving average.
12-period moving lineare regeression (or possibly linear regression line).
But I really don't know what the 4 period CCI "encoding" thing is all about.
If you want the OBV calculated based on HA candles for this, sorry, but it isn't happening. We could plot the HA based OBV itself as a Custom PCF Cumulative indicator, but there wouldn't be a good way to write the above formula based on the modified OBV.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 5/12/2016 Posts: 13
|
The CCI encoding is done on the actual OBV line, the line itself represents the OBV but green represents CCI going up and Red is CCI going down. Thanks for the assistance.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The CCI certainly does not look like it is being done using OBV in the code. It is based on src and src = close (the same src being used to calculate OBV).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|