Registered User Joined: 10/5/2010 Posts: 67
|
Hi,
How to make a condtion that if the price high crosses up the moving average 8, the condition is true. Thank you.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
So I am not quite sure what you want. If you want the price bar intersected by the moving average with the high above it:
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Average Intersects Price Bar
'|******************************************************************
If Price.High > Price.AVGC(8) AndAlso _
Price.AVGC(8) >= Price.Low Then
Pass
End If
If instead you want the high to have been at or below the moving average during the previous bar and above it now:
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:High Crossed Up Average
'|******************************************************************
If Price.High > Price.AVGC(8) AndAlso _
Price.AVGC(8, 1) >= Price.High(1) Then
Pass
End If
If you want something else, we would need further clarification from you as to what you want.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|