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