Platinum Customer
  Joined: 10/7/2004 Posts: 80 
	 | 
	
		 
	Bruce, 
	Please add a condition of Dividend >= to 1.5% to this code.  
	Thanks, 
	Michael 
	'# SMAperiod = UserInput.Integer = 225 
	'# AbovePeriod = UserInput.Integer = 250 
	'# Percent = UserInput.Single = 90 
	Static Count As Integer 
	Static Threshold As Single 
	Static Valid As Integer 
	If isFirstBar Then 
	Count = 0 
	Threshold = AbovePeriod * Percent / 100 
	Valid = AbovePeriod + SMAperiod - 1 
	SetIndexInvalid 
	Else If CurrentIndex >= SMAperiod Then 
	If Price.Last > Price.AVGC(SMAperiod) Then 
	Count += 1 
	End If 
	If CurrentIndex > Valid Then 
	If Price.Last(AbovePeriod) > Price.AVGC(SMAperiod, AbovePeriod) Then 
	Count -= 1 
	End If 
	If Count >= Threshold Then 
	Pass 
	End If 
	Else 
	SetIndexInvalid 
	End If 
	Else 
	SetIndexInvalid 
	End If 
	 | 
	
	
		 
   Worden Trainer
  Joined: 10/7/2004 Posts: 65,138 
	 | 
	
		 
	Please try the following RealCode Condition: 
'# SMAperiod = UserInput.Integer = 225
'# AbovePeriod = UserInput.Integer = 250
'# Percent = UserInput.Single = 90
'# DY = indicator.Library.Dividend Yield
Static Count As Integer
Static Threshold As Single
Static Valid As Integer
If isFirstBar Then
	Count = 0
	Threshold = AbovePeriod * Percent / 100
	Valid = AbovePeriod + SMAperiod - 1
	SetIndexInvalid
Else If CurrentIndex >= SMAperiod Then
	If Price.Last > Price.AVGC(SMAperiod) Then
		Count += 1
	End If
	If CurrentIndex > Valid Then
		If Price.Last(AbovePeriod) > Price.AVGC(SMAperiod, AbovePeriod) Then
			Count -= 1
		End If
		If Count >= Threshold AndAlso _
			DY.Value >= 1.5 Then
			Pass
		End If
	Else
		SetIndexInvalid
	End If
Else
	SetIndexInvalid
End If 
  -Bruce Personal Criteria Formulas TC2000 Support Articles
	 | 
	
	
		  Platinum Customer
  Joined: 10/7/2004 Posts: 80 
	 | 
	
		 
	Thank you. 
	Michael 
	 | 
	
	
		Registered User Joined: 3/11/2005 Posts: 10 
	 | 
	
		 
	Dividend yields are wrong ! 
	 Dividend Yield - This is the latest dividend divided by the share price. It reads in percentage. 
	Unfortunately - when I look at DRAD I get WAY different numbers 
	Morningstar says       YIELD is 1.13 
	TC2000                     YIELD is 4.51 
	Telechat                    YIELD is 5.22 
	  
	SO .... what gives?  Confidence in low at this time.  
	 | 
	
	
		Registered User Joined: 3/11/2005 Posts: 10 
	 | 
	
		 
	Ok  Telechart adjusted today to read Yield for DRAD as 4.51 .... but still ?!?! 
	 | 
	
	
		 
   Worden Trainer
  Joined: 10/7/2004 Posts: 65,138 
	 | 
	
		 
	Thank you for reporting the issue. I am forwarding the information to our data department for clarification on the calculations. 
  -Bruce Personal Criteria Formulas TC2000 Support Articles
	 | 
	
	
		 
   Worden Trainer
  Joined: 10/7/2004 Posts: 65,138 
	 | 
	
		 
	I checked with our data department and what we are currently reporting is Projected Yield. We will be adding trailing yield early next week. 
	Dividend Yield - Dividends Per Share over the trailing 12 months / Price 
	Projected Dividend Yield - (Current Dividend Per Share * Payout Frequency) / Price 
  -Bruce Personal Criteria Formulas TC2000 Support Articles
	 |