Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 11/13/2009 Posts: 12
|
I have various real code tests that I utilize, but how can I specify that the price of a stock is over $10 and the volume in the past day was over 200,000.
Below is an example of a code that i want to add this specification.
If Price.Open >= 1.015 * Price.Last(1) Then Pass
If price.open <= .985 * Price.Last(1) Then Pass
Also, is there any way to add this specification for preloaded tests such as crossing a moving average?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
One way to write your new requirements as a RealCode Rule would be:
If Price.Last > 10 AndAlso _
Volume.Value(1) > 2000 Then Pass
Basically you want to AND the new requirements with the old requirements. Assuming your two RealCode lines are part of a single RealCode Rule (instead of being two RealCode Rules), you could do this using RealCode as follows:
If (Price.Open >= 1.015 * Price.Last(1) OrElse _
Price.Open <= .985 * Price.Last(1)) AndAlso _
Price.Last > 10 AndAlso _
Volume.Value(1) > 2000 Then Pass
You could also combine your RealCode Rule with just the new requirements with any other Rule by Dragging and Dropping that Rule onto the Rule with which you wish to combine it and selecting Create New Combo Rule. You can choose either AND (both must be True) or OR (only one of the Rules must be True) when combining Rules.
Rule Basics
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/13/2009 Posts: 12
|
that was extremely helpful. Thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |