Registered User Joined: 11/19/2015 Posts: 459
|
Hello. I'm going to use small charts like sparklines for a couple of indictators.
1. I use the following to tell me the difference between the current bar's "percent above/below 8EMA" and the prior bar's:
(100 * (C / XAVGC8 - 1)) - (100 * (C1 / XAVGC8.1- 1))
Is this accurate?
2. How do I return a count of the bars ago that 8EMA was crossed?
Thank you very much.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Yes it is accurate, although it can be shorted somewhat.
100 * (C / XAVGC8 - C1 / XAVGC8.1)
There is a SinceTrue() function which can be used to check how many bars ago something happened. If you are looking when price crossed up in the most recent 50 bars.
SinceTrue(XUP(C, XAVGC8), 50)
If you are looking for crossdowns in the most recent 60 bars.
SinceTrue(XDOWN(C, XAVGC8), 60)
If you don't care about the direction of the cross in the most recent 40 bars.
SinceTrue(SGN(C - XAVGC8) <> SGN(C1 - XAVGC8.1), 40)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 11/19/2015 Posts: 459
|
Thank you very much, Bruce. These are perfect.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|