Thread: Raw Ideas
View Single Post
  #8 (permalink)  
Old 10-27-2005, 12:34 AM
jlouidor jlouidor is offline
Junior Member
 
Join Date: Oct 2005
Posts: 1
jlouidor is on a distinguished road
How to determine slope of an Indicator

I am trying to determine the slope of an indicator, whether it is up and has been up or down for the last 4-5 bars (or more). Depending on the slope I would send an alert. Considering I am just developing my skills on that matter, I am looking for some code snippets that may help me get further quicker.

Basically what I am trying to do is the following:

A- Sound Speech Alert for Up Slope if Ind(0) > Ind[-1] > Ind[-2] > Ind[-3] > Ind[-4] ...

B- Sound Speech Alert for Dn Slope if Ind(0) < Ind[-1] < Ind[-2] < Ind[-3] < Ind[-4] ...

Ind[0] is the current value of the indicator
Ind[-1] is the value 1 bar ago
Ind[-2] is th evalue 2 bars ago
...
...

If you have any code snippets that can do that, please let me know. Or if you know a place where I can find some, please do not hesitate to point to me.

Cheers
Reply With Quote