Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Prices Falling and MACD Rising using Min Max of Line Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
jabrae
Posted : Saturday, May 8, 2010 2:09:29 PM
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


 

Bruce_L
Posted : Monday, May 10, 2010 9:32:49 AM


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
jabrae
Posted : Monday, May 10, 2010 1:10:03 PM
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!
Bruce_L
Posted : Monday, May 10, 2010 1:11:49 PM


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.