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

highest high in last 2days > highest high in last 10 days Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
mrcauldwell
Posted : Saturday, December 18, 2010 2:36:53 PM
Registered User
Joined: 12/18/2010
Posts: 5
Hello,

I'm trying to write code to express:

if the highest high in the last 2 days is greater than the highest high in the last 10 days, then pass.

I wrote this code but it doesn't seem to be working when I use it as a scan:

If (Price.MaxHigh(2) > Price.MaxHigh(8.2)) then pass


Any help would be greatly appreciated. Thanks,

Richard
Bruce_L
Posted : Monday, December 20, 2010 12:18:07 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
The problem is probably just that you used a period instead of a comma in Price.MaxHigh().

If Price.MaxHigh(2) > Price.MaxHigh(8, 2) Then Pass

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
mrcauldwell
Posted : Wednesday, December 22, 2010 2:56:09 PM
Registered User
Joined: 12/18/2010
Posts: 5
Thanks Bruce, that seems to be working great.

I am having problems with creating the condition that a new price high has been made in the last 20 days, but again the code I have written doesn't seem to work.

if Price.High > Price.MaxHigh(20, 1) then pass

Thanks
Bruce_L
Posted : Wednesday, December 22, 2010 3:03:50 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Your RealCode would be for a New 20-Period High (I would actually think of it as a 21-Period New High). This would mean the current High is greater than the highest High over the previous 20-Bars.

If you want to check if this was True any time during the most recent 20-Bars, Edit the Condition and set it to Passing 1 of the Last 20.

-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.