Description: This strategy uses a classic machine learning algorithm - k Nearest Neighbours (kNN) - to let you find a prediction for the next (tomorrow's, next month's, etc.) market move. Being an unsupervised machine learning algorithm, kNN is one of the most simple learning algorithms.
To do a prediction of the next market move, the kNN algorithm uses the historic data, collected in 3 arrays - feature1, feature2 and directions, - and finds the k-nearest neighbours of the current indicator(s) values.
The two dimensional kNN algorithm just has a look on what has happened in the past when the two indicators had a similar level. It then looks at the k nearest neighbours, sees their state and thus classifies the current point.
The kNN algorithm offers a framework to test all kinds of indicators easily to see if they have got any *predictive value*. One can easily add cog, wpr and others. Note: TradingViews's playback feature helps to see this strategy in action. Warning: Signals ARE repainting.
Style tags: Trend Following, Trend Analysis Asset class: Equities, Futures, ETFs, Currencies and Commodities Dataset: FX Minutes/Hours+++/Days
Информация о релизе
Added alerts.
Информация о релизе
An upgrade to Pinescript v.5.
Информация о релизе
Major Fix. Changedthe signal filter application point and corrected the class label calculation.
Информация о релизе
Major fix. Added bars count for clear condition variable. Replaced endLongTrade and endShortTrade variables with clear_condition
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.