| Registered User Joined: 12/15/2004
 Posts: 34
 
 | 
 Bruce I have been struggling trying to write a PCF that represents a possible MACD histogram turning point.  That is the histogram 2 days ago is higher than the histogram 1 day ago and the histogram today is higher than the histogram yesterday.  Seems like it should be simple but I am getting a little confused on the formulas for the MACD and that of signal line.  Can you help? | 
	
	|  
  Worden Trainer
 
 Joined: 10/7/2004
 Posts: 65,138
 
 | 
	The exact formula would depend on your particular MACD Histogram settings. If you are using an Exponential MACD Histogram 12,26,9 then the formula would be: 
	XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9) AND XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) + XAVG(XAVGC26.1,9) < XAVGC12.2 - XAVGC26.2 - XAVG(XAVGC12.2,9) + XAVG(XAVGC26.2,9) 
	Understanding MACD 
 -Bruce
 Personal Criteria Formulas
 TC2000 Support Articles
 | 
	
	| Registered User Joined: 12/15/2004
 Posts: 34
 
 | 
 Thank you. | 
	
	| Registered User Joined: 12/31/2007
 Posts: 2
 
 | 
 Hi Bruce, 
 I have struggling with how to write a formula for 10 EMA, 20 EMA and 50 SMA all three crosing one another. Your reply is highly appreciated. Thanks.  | 
	
	|  
  Worden Trainer
 
 Joined: 10/7/2004
 Posts: 65,138
 
 | 
	If all three moving averages have to cross each other during the same bar, then the Condition Formula is relatively straightforward: 
	SGN(XAVGC10 - XAVGC20) <> SGN(XAVGC10.1 - XAVGC20.1) AND SGN(XAVGC10 - AVGC50) <> SGN(XAVGC10.1 - AVGC50.1) AND SGN(XAVGC20 - AVGC50) <> SGN(XAVGC20.1 - AVGC50.1) 
	If the crossovers can happen over more than one bar, you would need to determine the maximum number of bars over which the crossover can occur. The simplest version of such a formula would just replace all of the .1s in the formulas with this number of bars instead. 
 -Bruce
 Personal Criteria Formulas
 TC2000 Support Articles
 |