Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Price Crossover Real Code Request Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
danielbender
Posted : Friday, April 6, 2018 1:31:42 PM
Registered User
Joined: 1/14/2006
Posts: 436

Bruce

A second request for realcode to count for the number of bars (daily or 5 minute) since:

1.  Current stock price crosses from above to below prior days or prior bar High. 

Count = number of bars since occurrence (positive numbers). 

2.  Current stock price crosses from below to above prior days or prior bar Low.

Count = number of bars since occurrence (negative numbers) 

 

Thanks ... Dan 

 

Bruce_L
Posted : Monday, April 9, 2018 3:01:58 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Maybe the following for 1?

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Since xDn High
'|******************************************************************
Static Count As Single
If isfirstBar Then
	Count = Single.NaN
Else If Price.High > Price.High(1) AndAlso _
	Price.Last < Price.High(1) Then
	Count = 0
Else
	Count += 1
End If
Plot = Count

And the following for 2?

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Since xUp Low
'|******************************************************************
Static Count As Single
If isfirstBar Then
	Count = Single.NaN
Else If Price.Low < Price.Low(1) AndAlso _
	Price.Last > Price.Low(1) Then
	Count = 0
Else
	Count -= 1
End If
Plot = Count


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.