Registered User Joined: 6/17/2015 Posts: 15
|
I am trying to add my condition to my scans for my two minute time frames scans..
The 8 EMA crossing the 15 EMA
This is the code that I have. This works:
(XAVGC15.2< AVGC8.2) AND (XAVGC15 > AVGC8) AND (C > XAVGC15)
But how do I make two scans, on one scan the 8 EMA crosses to the upside and in one scan the 8 ema crosses to the downside?
I tried making anoter condition opposite of the first :
(XAVGC8.2 < AVGC15.2) AND (XAVGC8 > AVGC15) AND (C > XAVGC8)
but that's not it because they give me the same results as the first one.
Thank you
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Well your first formula checks for EMA15 crossing up through SMA8 between 2 bars ago and the current bar with price currently above EMA15.
The second formula checks for EMA8 crossing up through SMA15 between 2 bars ago and the current bar with price currently above EMA8.
This is not the reverse of the original formula in that the moving average types have been switched between the formulas.
It is also a bit odd that you would be loowing for price to be above both moving averages in both formulas instead of being above in one of the formulas and below in the other formula.
The formulas are not the same and should not return the same results however. Note that if you edited the first formula to change it to the second formula, then this would not change the formula in places where it is already in use. You would need to remove and re-add the formula to the layout in order for the changes to be reflected.
If you just want EMA8 crossing up through EMA15 between the previous bar and the current bar, it could be written as follows.
XAVGC8 > XAVGC15 AND XAVGC8.1 <= XAVGC15.1
With the reverse of this being:
XAVGC8 < XAVGC15 AND XAVGC8.1 >= XAVGC15.1
-Bruce Personal Criteria Formulas TC2000 Support Articles
|