Machine Learning: kNN-based Strategy (update)

kNN-based Strategy (FX and Crypto)


This update to the popular kNN-based strategy features:
improvements in the business logic,
an adjustible k value for the kNN model,
one more feature (MOM),
a streamlined signal filter and
some other minor fixes.

Now this script works in all timeframes !

I intentionally decided to publish this script separately
in order for the users to see the differences.
Phát hành các Ghi chú: Major fix: added scaling function for the mom feature. Mom requires scaling to the range of .
Mã nguồn mở

Với tinh thần của TradingView, tác giả đã xuất bản tập lệnh theo mã nguồn mở, vì thế trader có thể dễ dàng hiểu và tùy chỉnh được. Bạn có thể sử dụng miễn phí, hoặc tùy chỉnh lại mã đã được cấp phép bởi Quy tắc Chung. Bạn có thể sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Bình luận

Why is this not drawing the last few indicators? For me, it seems to not draw the indicators in realtime, as if it cuts off the last few predictions.
+8 Phản hồi
JokingPips bluiska
@bluiska, i second this. @capissimo do we need to wait for a few close candles for it to calculate or is there something wrong?
Phản hồi
First of all thanks for that great script and the awesome content you are producing for this community!

I would like to ask if this updated version is still repainting?
+4 Phản hồi
capissimo walfgott
@walfgott, unfortunately, yes. Hopefully, this community will find the proper way.
Phản hồi
Perhaps you should turn it into a strategy and wait for the signal to be triggered on the bar close after the signal condition has been met. On the exits then you could use a strategy.exit to exit in that precise moment instead. but these are just my 2cents.
+1 Phản hồi
capissimo Minimal_Est
@Minimal_Est, I prefer not to and leave it to the users. You propose to use a black box magic.
+1 Phản hồi
Minimal_Est capissimo
@capissimo, black box magic ?
Phản hồi
capissimo Minimal_Est
+1 Phản hồi
Hi guys,
I tested the script with Fast Period = 23 , Slow Period = 32 and Dataset = Low and the winrate changes to 72% for BTC M5!! Does anyone change the properties to get better results?
Phản hồi
Thanks for the awesome update on your KNN AI script. A couple of questions on this script:
1. It appears to me that the tthres input should be a number between 0 - 1, and not 0.1 - 100 because the variable barlife is a ratio of tcurr/tbase which appears to be a ratio of 0 - 1 for each bar. So I am confused why the input for tthres goes up to 100 instead of 1.0?

2. Could you explain the holding period input and how the input values are used and how they effect the functioning of the script? Thx GF
Phản hồi