Registered User Joined: 12/26/2006 Posts: 109
|
For "Prices Falling" using Max Line
When I write the code:
'# MoMo = chart.MaxorMinofLine (vary period with user input)
'# If Price.Close < MoMo.Value then Pass
The compiler allows the condition but it neither Paints Scans or allows Markers.
Similary For "MACD Rising" using MIN Line If I write a separate piece of code I obtain another non functioning condition. Usually the compiler just tell me I don't know what I a doing which is TRUE but it allows this code to produce a viewable condition light??
'# MH = chart.MACDHistogram
'# MoMo = chart.MaxorMinofLine.3(vary period with user Input.
'# If MH.Value > MoMo.Value then Pass
I wrote this code as separate pieces to see if the the code would work in pieces before I tried to do the following Condition:
If "Prices are Falling" and "MACD" is rising then Pass.
What I really would like to see to use this for scan purposes is: when the condition is no longer true when the Price today again becomes equal to the MoMo line.
Thanks James
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The '# at the beginning of the line is commenting it out. I suspect you want something similar to the following (one assumes the Min or Max of Line Indicators are set so your original logic at least would do what you want):
'# MoMo = chart.MaxorMinofLine
'# MH = chart.MACDHistogram
'# MoMoMACD = chart.MaxorMinofLine.3
If Price.Close < MoMo.Value AndAlso MH.Value > MoMoMACD.Value Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 12/26/2006 Posts: 109
|
Thanks Bruce
It is amazing what one does not observe when reading someone elses code that works. I just had not clued in that ' was a comment marker. You are a great frustration remover!
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|