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 |

% pcfs Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
bluesman
Posted : Saturday, July 17, 2010 2:30:22 PM
Registered User
Joined: 10/7/2004
Posts: 3
I need help in creating two pcf:s
stocks that are within 20% of a new high within 2 months.
And

stocks that have volume on any of the last 10 days exceeding 120% of the prior 20-day volume average.

jas0501
Posted : Saturday, July 17, 2010 7:57:39 PM
Registered User
Joined: 12/31/2005
Posts: 2,499

stocks that have volume on any of the last 10 days exceeding 120% of the prior 20-day volume average.

The most efficient way to get this is to count the days since the volume exceeded the 20-day Volume average:

'# period = userinput.integer = 20
'# percentage = userinput.single = 1.2

static barsSince as integer
static exceeded as boolean
if isfirstbar then
   barsSince = 0
   exceeded = false
endif
if volume.value > volume.avg(period) * percentage then
     exceeded = true
     barsSince = -1
 end if
if exceeded then
    barsSince + = 1
end if
plot = count
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.