Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

add price and volume specifications Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
nimmer.jacob
Posted : Wednesday, December 16, 2009 8:25:32 PM
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?
Bruce_L
Posted : Thursday, December 17, 2009 8:28:47 AM


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
nimmer.jacob
Posted : Thursday, December 17, 2009 7:36:03 PM
Registered User
Joined: 11/13/2009
Posts: 12
that was extremely helpful.  Thanks.
Bruce_L
Posted : Friday, December 18, 2009 8:05:35 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
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.