Click here to Login








Candle Pattern Forecast

by Kyra Packens, 3545 days ago
Share |






This indicator makes a prediction for the returns of the current bar based upon averaging the returns of the NumClosest (parameter) candlestick patterns that were most similar to the current bar's pattern in the Lookback (parameter) period. "Similarity" here is the squared euclidean distance between vectors describing the two patterns.

The Filter (parameter) can be useful for training the forecast under differing market regimes; any pattern where the filter is false on the final bar of the pattern will be excluded from the "training" set. The indicator will also produce a prediction of 0 for any bars where the filter is false.


Examples:

kpCandlePatternForecast(1000, 3, 50, 1) -> would form a prediction by averaging the next day returns of the 50 3 bar candle patterns most similar to the current 3 bar candle pattern found in the previous 1000 bars.

kpCandlePatternForecast(1000, 3, 50, close > sma(close, 20)) -> same as above but would only include patterns in the training set if the final bar of the pattern closes above the 20 period SMA. The forecast would also be zero for any bar whose close is below the 20 period SMA.

kpCandlePatternForecast(90, 2, 10, 1) -> would form a prediction by averaging the next day returns of the 10 2 bar candle patterns most similar to the current 2 bar candle pattern found in the previous 90 bars.

Interpreting the results:

Any bar where the indicator produces an excessively high or low result may be a good signal to go long / short for the next day as similar patterns have generated an unusually high / low return over the lookback period. Playing with the filter parameter can also be a good way to visually get an idea of the tendencies of an instrument for the filter regime over the lookback period.

Important: Forecasted returns are from close of the current day to the next day's close. Make sure to SetSimTiming appropriately when you're backtesting.


Credit:

K Nearest Neighbors is certainly not a novel idea, but this page:

http://qusma.com/2013/04/29/mining-for-three-day-candlestick-patterns/

Got me interested enough to code up the indicator for QS. Have a look there for a nice writeup including performance statistics as well as some ideas for improving things even further.


Happy Trading!
-- kp




Share This ->
Share |


You have to log in to bookmark this object
What is this?
Additional Information




Type: Trading Indicator

Object ID: 1563


Country:


Market:

Style:

Reviews
You must log in first

Join now
and get instant access for free to the trading software, the Sharing server and the Social network website.
Click here


Related objects
Show All
Relative Performance against a Group of Stocks (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 28 Notes Report an item
Auto Support and Resistance Indicator (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 60 Notes Report an item
Stock Trading Above/Below its Moving Averages (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 33 Notes Report an item
Opening Range Breakout Indicator (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 38 Notes Report an item
Demand Index (by Brian Brown, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 67 Notes Report an item
Keltner/Bollinger Bands Squeeze (by Brian Brown, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 83 Notes Report an item
Big Up Gap (by Peter Gum, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads 15 Notes Report an item
Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

Technical Analysis


Fundamental Analysis



Random Blog Posts

How to use the new Market Regimes Feature in QuantShare Trading Software

Create Realtime Quote Sheets with the Watchlist Tool

How To Create and Backtest an S&P 500 Trend Following System

QuantShare Trading Software: New Features in the 3.3.1 Version

3 Items To Get and Trade the News In QuantShare Platform

How to Create a Custom Real-Time Table using QS Trading Software

Let me Show You How to Create Hundreds of Profitable Trading Systems

How to Backtest a Strategy from a Chart

Show All

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object






QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.