Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PVT Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
danielbender
Posted : Friday, October 17, 2014 4:08:46 PM
Registered User
Joined: 1/14/2006
Posts: 436

Bruce

Is there an easy way to calculate an indicator for "days since PVT moving up quickly" has triggered?

I want to use the indicator in a watch list column that I can sort from longest (days since PVT moving up quickly) to shortest (days since moving up quickly).

Thanks.... Dan

PS.  It has bee a while since I posted here.  Hope you are doing well.

Bruce_L
Posted : Friday, October 17, 2014 4:24:53 PM


Worden Trainer

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

You could do something like the following RealCode Indicator.

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.1 www.worden.com 
'|*** Copy and paste this header and code into StocFinder *********
'|*** Indicator:Bars Since Condition Example
'|*** Example: plot = price.close - price.close(1)
'|******************************************************************
'# PVT = chartCondition.PriceVolumeTrend(PVT)MovingUp
Static Since As Single
If isFirstBar Then
	Since = Single.NaN
End If
Since += 1
If PVT.Value = True Then
	Since = 0
End If
Plot = Since

THe '# PVT = line was created by dragging and dropping a condition for PVT moving up quickly from the charts into the Code tab of the RealCode Editor.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
danielbender
Posted : Friday, October 17, 2014 5:38:12 PM
Registered User
Joined: 1/14/2006
Posts: 436

Bruce

1. I duplicated your code after creating the PVT moving up quickly condition and importing it into a new real code indicator.  It compiles correcty, but When I plot the new indicator, it is blank.  Any thoughts?

2. I would like modify the indicator so it shows the folowing output:

if today pvtmovingupquickly = false, then plot = 0 no

if today pvtmovingupquicly = true, then plot the number of days between todays pvt true signal and last instance of a pvt true signal
 

Thanks.... Dan

 
Bruce_L
Posted : Monday, October 20, 2014 12:05:51 PM


Worden Trainer

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

I have no idea why it would be blank. You could select Help | Send Layout to send us a copy of the layout so we can take a look and troubleshoot the issue. Please include a description of what is wrong and why you are sending the layout.

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.1 www.worden.com 
'|*** Copy and paste this header and code into StocFinder *********
'|*** Indicator:Bars Since Condition Example
'|******************************************************************
'# PVT = chartCondition.PriceVolumeTrend(PVT)MovingUp
Static Since As Single
If isFirstBar Then
	Since = Single.NaN
End If
Since += 1
If PVT.Value = False Then
	If Single.IsNaN(Since) Then
		Plot = Single.NaN
	Else
		Plot = 0
	End If
Else If PVT.Value = True Then
	Plot = Since
	Since = 0
End If


-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.