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

Error in Formula for PRLCount Indicator Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
danielbender
Posted : Monday, March 20, 2017 7:30:13 PM
Registered User
Joined: 1/14/2006
Posts: 436

Bruce

When I use the following code, I get either a 0 or a 5 result for the Plot Variable PRLCount.  I am looking for a result between 0 and 5.  Do you know what I am doing wrong?  Thanks... Dan

 

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.1 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:PRLCount
'|*** Example: plot = price.close - price.close(1)
'|******************************************************************
 
Dim PRLCount As Integer = 0
Static PeriodDef(6) As Integer
 
If isFirstBar Then
PeriodDef(1) = 3
PeriodDef(2) = 5
PeriodDef(3) = 8
PeriodDef(4) = 10
PeriodDef(5) = 12
PeriodDef(6) = 15
End If
 
 
For i As Integer = 1 To 5
If price.close >= Price.XAVG(PeriodDef(1)) Then
PRLCount += 1
End If
Next
 
Plot = PRLCount
danielbender
Posted : Monday, March 20, 2017 9:19:29 PM
Registered User
Joined: 1/14/2006
Posts: 436

Bruce

Never mind. I found my error.  

Bruce_L
Posted : Wednesday, March 22, 2017 9:07:14 AM


Worden Trainer

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

I am happy to read you were able to figure it out on your own.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Kuf
Posted : Tuesday, April 11, 2017 9:33:42 AM


Administration

Joined: 9/18/2004
Posts: 3,522

.



Ken Gilb (Kuf)
Chief Software Engineer - Worden Brothers Inc.
Try/Catch - My RealCode Blog
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.