Profile Picture

Reference last 20 closing prices, find most common occurring and create user series

Posted By ywlee 2 Years Ago

Reference last 20 closing prices, find most common occurring and...

Message
Posted Saturday July 11 2015
Hi 

I want to find the most frequently occurring closing prices for the last x bars and then use it as an indicator/User series.

Can I do this under a User Series or do I need to create a custom indicator?   If it is the latter, is there an existing indicator that would be close to what I'm trying to do which I can modify?

Thanks in advance.
Posted Sunday July 12 2015
Attached is a sample for a class named ValueCountQueue which can calculate this, and a sample system which shows how to use it to display the most common closing price and the number of occurrences of that price over the last 20 bars on a chart.

In the daily data I looked at, most of the time there were no repeated close price within 20 bars- ie all of the prices are tied at one occurrence.  In this case the ValueCountQueue returns the lowest value out of the ties.

Thanks,
Daniel

Attachments
ValueCountQueue.cs (182 views, 1.00 KB)
PriceFrequency.cs (168 views, 1.00 KB)
Posted Monday July 13 2015
Hi Daniel

Thanks for the same!


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems