Registered User Joined: 3/6/2005 Posts: 16
|
How do I code this in TC 2000?
- decide the length of the indicator. I use 200 days,
- find a maximum price during last “length” of days
- count how many days ago was the maximum, this will be “maximum index”
- find a minimum price during last “length” of days
- count how many days ago was the minimum, this will be “minimum index”
- calculate difference: minimum index - maximum index
If the result is positive the trend is up. If the result is negative the trend is down.
|
Registered User Joined: 3/6/2005 Posts: 16
|
Corrections:
2nd line - find a maximum price during last "length" of days
3rd line - count how many days ago was the maximum, this will be "maximim index"
4th line - find a minimum price during last "length" of days
5th line - count how many days ago was the minimum, this will be "minimum index"
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It is theoretically possible to use the techniques in the Days Since Last Peak (or other day-counting needs) topic to create an Indicator Formula for this. That said, the resulting formulas end up being too slow and long to be practical or post in the forums.
Note that your description comes very close to the Aroon and Aroon Oscillator indicators. The big difference is the the Aroon indicators are calculated as a percent of the period since the high or low was most recently reached instead of using a raw count.
The Aroon and Aroon Oscillator indicators are built into TC2000 version 12.2. It is possible to create indicator formulas short enough to post for relatively short periods, but not for periods such as 200.
Aroon Indicators and Oscillator
But the fact that they are built into TC2000 version 12.2 makes such formulas mostly obsolete.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|