What's crackin', so this will be a revised version of the stochastic signals I recently posted. This update includes better options for buy/sell shapes and a new function you can use to identify potential uptrends. The correlation coefficient is taken from John F Ehlers and a link to the paper can be found at the bottom of this post.
A trend is identified with the correlation factor when the line is showing +/- 0.5 - 20 bar history is found to work the best for any time-frame.
Signals for stochastic buy and sells should be used for accumulation and distribution of a trading position. They are not signals for long term reversals and they should be used in tandum with the time-frame they were given on.
Ex. Time Frame Trade Periods: 1hr (BUY) - 5hr hold (estimate) - 1hr (SELL)
Stochastic settings work best as (8, 3, 3) or (14, 3, 3).
To use correlation feature, remove the comments in the source code. Although, I would read the paper or look at how the signal is produced.
John F Ehlers (I cannot post links yet): Google John F Ehlers Correlation as a Trend Indicator