Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 7/16/2009(UTC) Posts: 3
|
Hi Guys, this is my first post so please excuse the basic nature of it.
I'm trying to write an exploration that finds whenever a 14 period RSI crosses the value 50. I've gone through the Formula Primer and built an indicator that shows a value of "1" when it crosses going up, and also an indicator that works when it crosses down (why doesn't "cross" work in both directions?).
The new exploration I put together uses the formula from the indicators and is as follows: Col A : Cross(RSI(14),50) Col B : Cross(50,(RSI(14))) Filter : colA OR colB
When i run the exploration it returns results which for the most part are correct but a few results come in where the RSI either crossed several days ago or hasn't crossed for ages. My concern is that it's including some irrelevant results and excluding relevant ones.
Any help would really be appreciated
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/7/2005(UTC) Posts: 602
|
Cross does work in both directions. When I think my results are fishy I will create a indicator from the explorer, then plot the indicator on the chart of the security that I think is wrong and I can usually figure out what the problem is.
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 7/16/2009(UTC) Posts: 3
|
Thanks Johnl,
I did those checks as I copied the formula from the custom indicator into the explorer. Eveything works OK with the indicators but when the esplorer uses them something dodgy seems to happen.
The formula I used was CROSS(RSI(14),50) is that supposed to work when it crosses either way? Because when I plot it and compare it to the RSI it only gives a value of 1 when it crosses up, nothing when it crosses down.
Any ideas?
Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi pjhtrader
Your method of using two Cross() functions to detect both up and down crosses is correct. This function only picks up crosses where the first parameter crosses above the second, so reversing the parameters effectively picks up crosses going the other way.
Try increasing the number of bars scanned to 100 - I suspect you're using Minimum Records at the moment. After opening up the Explorer window click on the Options button and change this setting. The problem of inaccurate results is caused by the Wilders() functions that are internal to the RSI(). Wilders is a slower form of exponential moving average and needs at least five times as much data as the RSI() Periods parameter will deliver. This is not really a problem on a chart because no one is terribly interested in what an RSI looks like at the left side. However it's a very real problem in an exploration and the use of Minimum Records is not appropriate where an EMA is used.
Many MetaStock functions use Wilders() or an EMA internally - ATR() and ADX() are just two that come to mind.
Roy
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 7/16/2009(UTC) Posts: 3
|
Hi Roy,
Thanks for your help! I've increased the records and it's resolved the issue.
[:D] Great forum!
pjhtrader
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
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.