Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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
|
|
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
|
|
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
|
|
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
|
|
Guest-1 |