Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PCF for the TSV crossing the RSI Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Tanstaafl
Posted : Wednesday, June 8, 2005 8:54:47 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Copyright 2005 by James D. Dean, All Rights Reserved


I've recently been asked by several people how to model the crossover of a TSV line with an RSI line with a PCF that produces signals at the same place they would be shown if those two indicators were plotted on the same TC chart. This is sort of a strange thing to do in my opinion, for the reasons mentioned below, but after giving it some thought I've come up with a limited but workable solution that can be applied in concept to virtually ANY two different indicators. Please note that this can also be done by plotting two versions of the TSV and two of the RSI on the same chart (today and yesterday), AND doing two Visual SortBy's with appropriate flagging. However the process of creating a PCF to do it is a bit trickier ... the answer to THAT question is: there's some BAD news and some GOOD news - and some "I suppose it's Good News" ...

-------------------

First, the BAD news. It does not make any sense to look for crossovers of RSI and TSV on the same chart. Period.

These two indicators are on entirely different scales, and they have nothing to do with one another in their units of measure, or method of generation.

The TSV is an UNBOUNDED indicator ... its scale differs by symbol, by zoom, and by timeframe. It is NOT reasonable to compare two symbols' TSV values to one another - much less to an entirely different indicator!

-------------------

But now the GOOD news ...

If the RSI and TSV are evaluated INDEPENDENTLY ... ie TSV crossing its zero line, or TSV crossing its MA, or TSV diverging with price, or TSV slope, etc to give a TSV buy/sell signal ... and a separate consideration of RSI crossing its zero or its 30/70, or RSI crossing its MA, or RSI diverging with price, or RSI slope, etc to give a RSI buy/sell signal ... then one might make a rule that if BOTH indicators INDEPENDENTLY signal a buy/sell, then it is an acceptable signal.

This logic is also true of ANY other combination of indicators unless BOTH are bounded oscillators. That is, Stoch with Stoch, Stoc with RSI, BOP with RSI, BOP with Stoch are all of the combinations that native TC offers in which that kind of logic MIGHT work consistently ... of course you can invent an infinite number of alternative CUSTOM bounded oscillators that might also work.

This is not a matter of opinion or trading style, by the way ... it is simply a result of how the MATH works, and how TC DISPLAYS the charts on the screen.

-------------------

And finally, the "I suppose it's Good News" ...

Having said all that, there IS a way to SORT OF get the TSV and RSI crossover to give consistent answers (tho I CANNOT not attest to their usefulness).

First, to write a PCF for this you must LOCK IN on a particular chart Zoom factor, such as Zoom 6 = 66 bars (to see this on the chart, consistently). That will force the TSV plot to always be bounded by the Max or Min value DURING THAT TIMEFRAME (the farthest one from zero) ... making it a bounded oscillator whose limits are set by the fixed period of time under consideration. This is similar to how the Stochastic formula works, by the way.

If that is an acceptable limitation, then a PCF can be written to model it, and thus also model the RSI crossover with this (limited) TSV form.

Let's say that TSV18 and RSI14 are the desired forms, and that two TC limitations are acceptable:
1) TSV18 and RSI14 both use a SIMPLE moving average
2) RSI14 is NOT the "true Wilder" form of the RSI, but W's undocumented custom version

In that case, we need to convert the TSV18 to a 0-100% value, then do a crossover formula of that "bounded TSV18" value vs the RSI14. This ONLY works if we lock in on Daily bars (no way to convert undocumented TSV or undocumented RSI to weekly bars), and lock in a particular Zoom depth ... assume Zoom6 with 66 daily bars - if matches to the chart are not important, we could pick ANY arbitrary fixed period of time.

The TSV "+100%" scale at Zoom 6 is set by:
Max( Abs( Max(TSV18,66) ), Abs( Min(TSV18,66) ) )
... this can be calculated in PCFeze as:
( Abs(Max(TSV18,66)) + Abs(Min(TSV18,66)) +
Abs( Abs(Max(TSV18,66)) - Abs(Min(TSV18,66)) ) ) /2

Using that formula to define the MaxTSV, MinTSV value would be the negative of the MaxTSV value, and the a 66-day bounded-oscillator TSV18 0-100% oscillator would be:
BOscTSV18 =
100 * (TSV18-MinTSV) / (MaxTSV-MinTSV) =
100 * (TSV18-(-MaxTSV)) / (MaxTSV-(-MaxTSV)) =
100 * (TSV18+MaxTSV) / (2*MaxTSV) =
100 * (TSV18/MaxTSV + 1)/2 =
50 + 50*TSV18/MaxTSV
... which is the simplest form possible, and which expands to:

50 + 50 * TSV18 /
(Abs(Max(TSV18,66)) + Abs(Min(TSV18,66)) +
Abs( Abs(Max(TSV18,66)) - Abs(Min(TSV18,66)) )) /2 =
... cleans up to become, finally:
50 + 100 * TSV18 /
(Abs(Max(TSV18,66)) + Abs(Min(TSV18,66)) +
Abs( Abs(Max(TSV18,66)) - Abs(Min(TSV18,66)) ))

OK ... that's the "bounded oscillator" form of the TSV18. Please note that it only applies to the "today" bar, on a 66-day Zoom-6 window

The crossover of the RSI vs this oscillator, producing a +1 for BOscTSV18 xUpThru RSI, and a -1 for BOscTSV18 xDnThru RSI14, would be:

Sgn( BOscTSV18 - RSI14.1) -
Sgn( BOscTSV18.1 - RSI14.1.1 )
... or ...
Sgn( 50 + 100 * TSV18 /
(Abs(Max(TSV18,66)) + Abs(Min(TSV18,66)) +
Abs( Abs(Max(TSV18,66)) - Abs(Min(TSV18,66)) ))
- RSI14.1 ) -
Sgn( 50 + 100 * TSV18.1 /
(Abs(Max(TSV18.1,66)) + Abs(Min(TSV18,66)) +
Abs( Abs(Max(TSV18,66)) - Abs(Min(TSV18,66)) ))
- RSI14.1.1 )

A similar technique can be used for other unbounded oscillators such as TSV. The formulae would need minor modifications for an unbounded indicator that does NOT oscillate around zero, such as MS or OBV.

-------------------

Many thanks to Jim Murphy (aka BusterMu) for pointing out the important following qualifier:

If you want to modify the PCF to check out the crossover that occured, say, 40 days ago within the current 66-day window, you would NOT just push back all of the TSV and RSI references arbitrarily, which is the normal process for that kind of thing. It is critical that *the MaxMin window remain fixed* to the time period that you are *looking at* on the screen. However, the specific RSI14.1.40 and TSV18.40 values do have to be properly represented. So, for this example, the formula would change to:

Sgn( BOscTSV18 - RSI14.1) -
Sgn( BOscTSV18.1 - RSI14.1.1 )
... or ...
Sgn( 50 + 100 * TSV18.40 /
(Abs(Max(TSV18,66)) + Abs(Min(TSV18,66)) +
Abs( Abs(Max(TSV18,66)) - Abs(Min(TSV18,66)) ))
- RSI14.1.40 ) -
Sgn( 50 + 100 * TSV18.41 /
(Abs(Max(TSV18.1,66)) + Abs(Min(TSV18,66)) +
Abs( Abs(Max(TSV18,66)) - Abs(Min(TSV18,66)) ))
- RSI14.1.41 )

If you plot the original "today" formula on the Zoom6 chart, then in order to properly see on the chart what the formula is calculating for the 40th day ago, you would need to use the "[" key to move the chart into the past, until the 40th day ago is on the far right edge of the display.

-------------------

Jim Dean

jfisamm
Posted : Tuesday, June 14, 2005 12:43:20 AM
Registered User
Joined: 12/18/2004
Posts: 44
Dear Mr. Dean:

Can you help me with the following PCF

1) OBV s crossing up ( or down ) its own 20 days MA eitther today or yesterday

2) Price Relative ( comparing to SP or Q's ) is crossing up ( or down) its own 20 days MA either today or yesterday.

Thank you so much for your help

Best Regards

Jack
(Removed by Moderator)
Tanstaafl
Posted : Tuesday, June 14, 2005 6:47:34 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Hi, Jack:

The first part is PCF-able:
Sgn(OBV-OBV20)-Sgn(OBV.1-OBV20.1)
... this yields +2 for a bull cross, -2 for a bear cross, else zero (+1/-1 theoretically possible but rare)

The second part isn't PCF-able since TC only allows one symbol in a PCF. Sorry, but you just have to do it visually, going thru the charts by hand.

If you are facile with Excel, you can export the data and do it there.

Jim Dean




jfisamm
Posted : Wednesday, June 15, 2005 4:13:47 AM
Registered User
Joined: 12/18/2004
Posts: 44
Dear Mr Dean:

Thank you so much.

Appreciate your help

Jack
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.