Discussions
»
Product and Service Development
»
Formula Assistance
»
Using an indicator that returns a variable numeric value in a systems test
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 12/15/2009(UTC) Posts: 4
|
Hello all!
I'd like to request your assistance in perfecting a formula for exploration and system testing. Perhaps you might find this formula, even in its imperfect state, helpful to your trading. I consider an essential component of any good trade. So does the fellow I pinched it from, who's generally considered the foremost technical analyst in my country..
Basically, I have an indicator which determines RSC (Relative Strength Comparative) for a security against the overall index. The formula for it is as follows:
ROC(Mov((C/P),20,S),1,%)
It divides the Rate Of Change of the stock's 20 day simple moving average by that of the index. I find it helpful to identify outperformers and underperformers relative to the index. A problem with this exploration is that the index has to be selected on its chart for the exploration to function. To get around that necessity, I amended the formula to this:
PATH:= Security("C:\MetaStock Data\INDEX\J203", C); ROC(Mov((C/PATH),20,S),1,%)
These formulas (formulae?) return values which can be compared in a table to identify winners and losers.
Now, I would like to build a system tester around this formula, both to determine the optimum number of periods for the moving average and as the first step in a trading system which would incorporate a few more formulas.
My question is this, how do I code the formula such that the system test will only go long shares which are outperforming the average (ie. returning a value >0) and only go short shares which are underperforming the average (ie. returning a value <0)?
It would also be helpful for the exploration to filter out all shares with a value <0 when I am searching for buys, or vice versa for shorts. I have other formulas in my exploration / system test that I only want to be included in the returned results if this first RSC criteria is met.
Any help appreciated, just please talk slowly as I'm quite new to coding!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/7/2005(UTC) Posts: 602
|
It will be a lot easier if you do two tests, one for short and one for long. Use a IF() statement to select only those signals that meet your (value >0 ) criteria.
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 12/15/2009(UTC) Posts: 4
|
Hi Johnl, thanks for the reply. I am using 2 different explorations, one for short and one for long.
The value>0 argument worked for filtering the results according to RSC.
I've now worked out the kinks in the exploration process, but am still at a loss as to how to convert this exploration into a systems test. Any ideas on that?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/7/2005(UTC) Posts: 602
|
From what I can gather is that the above is used to select the securities. Now you need a signal: something like Cross(RSI(14),80)=1 to create the buy and sell signals that you will put into the system tester.
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 12/15/2009(UTC) Posts: 4
|
OK, thanks. But how do I get the system test to only buy or sell when the RSC value >0? The problem is how do I put this RSC formula into a system test as a condition for its buy / sell signals?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/7/2005(UTC) Posts: 602
|
I would create two indicators, one for buy and one for sell. Both are either 1 for the signal and 0 for no signal. Plot these in a window first. If you plot each in different colors you can eyeball the buy and sell signals right on the chart.. Then worry about the system tester. Sounds like you are trying to do to many thing at once.
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Using an indicator that returns a variable numeric value in a systems test
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.