Rules: Indicator crosses Indicator of Indicator
Author: ricksstocks
Creation Date: 9/10/2013 7:03 PM
profile picture

ricksstocks

#1
Has anyone coded an adjustable RSI with an adjustable Moving average of the RSI that can be used as a condition in a Rule Based Strategy?
profile picture

Eugene

#2
Any indicator can be used in a Rule-based Strategy. Question is, what exactly are "adjustable RSI" and "adjustable Moving average"?

Meanwhile this might be close to what you're looking for:

Adaptive Lookback & Adaptive RSI
ActiveTrader 2009-07 | Adaptive RSI 2.0
profile picture

ricksstocks

#3
By adjustable I mean to adjust the periods…which WLP has (for RSI and SMA).

When I try to build a rule based strategy using general indicators “indicator crosses indicator” with the statement RSI Series (Close,14) crosses over SMA Series (Close,9) it appears that it is applying the EMA to the chart and not the RSI.
As you know the input is from a menu not manual. I’m guessing there needs to be a menu option that states “SMA Series (RSI(Close,14),9)”…or something like that. Having the same for MACD would be nice as well.

Of course it is highly probable that it is a case operator error.
Thanks, Rick
profile picture

Cone

#4
QUOTE:
RSI Series (Close,14) crosses over SMA Series (Close,9) it appears that it is applying the EMA to the chart and not the RSI.
As you know,the rule makes no sense. You can create a general crossover rule with two RSIs, but you'd have to unlock the code and edit it to get “SMA Series (RSI(Close,14),9)”.

Although this particular rule could be created for the Strategy Builder, generally creating a rule with that uses "indicator of another indicator" is one of it's limitations.

MACD-specific rules are included in a separate group.
profile picture

ricksstocks

#5
"As you know,the rule makes no sense". (???)

Using the Total Market ETF-VTI it has given one false signal year to date. That is: When the Wilder’s RSI-14 crosses its 9 day moving average.
... In conjunction with the MACD 8-17 crossing its 9 day moving average as confirmation.
profile picture

Eugene

#6
I've renamed the topic. Previous title ("Adjustable RSI with an adjustable Moving average of the RSI") was too confusing and did not reflect what the actual question is.
profile picture

ricksstocks

#7
Attached image shows what I’m talking about. I misspoke…it had two false signals and 5 positive signals.
profile picture

Cone

#8
QUOTE:
"As you know,the rule makes no sense". (???)
It was in reference to what I had quoted, which was RSI(Close) crossing SMA(Close), i.e., not the SMA of the RSI.

By the looks of the image, it seems you've got a good handle on things. What you can do now it to "push" those indicators into the Editor (rightmost Chart Toolbar button) where you can access the series, albeit with some manipulation. Let's go through the exercise.

First, here's the plot code after you push it into the Editor -
CODE:
Please log in to see this code.


The bad news is that Wealth-Lab doesn't make it straightforward to access those series and use the in the strategy. So, the first thing to do is to create simple references to the DataSeries, like the following. Notice that you need the references above the for loop, where the trading signals will go. (I also did a search and replace to add a space behind each comma.)

CODE:
Please log in to see this code.


These two snippets are equivalent. Now adding the buy and sell rules are simple:

CODE:
Please log in to see this code.
profile picture

ricksstocks

#9
Wow!! Thank you very much. The results don’t look so good in the long run...shows what I know.

Wonder if you can take into account the slope of the SMA’s? Like flat to slopping up as confirmation?

Thank you very much Cone, I’ll study the post and help files to start learning the coding process.

Rick
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).