TradingView
Zeiierman
22 אוג׳ 2023 11:33

AI Moving Average (Expo) 

GoldOANDA

תיאור

Overview
The AI Moving Average indicator is a trading tool that uses an AI-based K-nearest neighbors (KNN) algorithm to analyze and interpret patterns in price data. It combines the logic of a traditional moving average with artificial intelligence, creating an adaptive and robust indicator that can identify strong trends and key market levels.




How It Works
The algorithm collects data points and applies a KNN-weighted approach to classify price movement as either bullish or bearish. For each data point, the algorithm checks if the price is above or below the calculated moving average. If the price is above the moving average, it's labeled as bullish (1), and if it's below, it's labeled as bearish (0). The K-Nearest Neighbors (KNN) is an instance-based learning algorithm used in classification and regression tasks. It works on a principle of voting, where a new data point is classified based on the majority label of its 'k' nearest neighbors.

The algorithm's use of a KNN-weighted approach adds a layer of intelligence to the traditional moving average analysis. By considering not just the price relative to a moving average but also taking into account the relationships and similarities between different data points, it offers a nuanced and robust classification of price movements.
This combination of data collection, labeling, and KNN-weighted classification turns the AI Moving Average (Expo) Indicator into a dynamic tool that can adapt to changing market conditions, making it suitable for various trading strategies and market environments.


How to Use
Dynamic Trend Recognition
The color-coded moving average line helps traders quickly identify market trends. Green represents bullish, red for bearish, and blue for neutrality.



Trend Strength
By adjusting certain settings within the AI Moving Average (Expo) Indicator, such as using a higher 'k' value and increasing the number of data points, traders can gain real-time insights into strong trends. A higher 'k' value makes the prediction model more resilient to noise, emphasizing pronounced trends, while more data points provide a comprehensive view of the market direction. Together, these adjustments enable the indicator to display only robust trends on the chart, allowing traders to focus exclusively on significant market movements and strong trends.



Key SR Levels
Traders can utilize the indicator to identify key support and resistance levels that are derived from the prevailing trend movement. The derived support and resistance levels are not just based on historical data but are dynamically adjusted with the current trend, making them highly responsive to market changes.




Settings
  • k (Neighbors): Number of neighbors in the KNN algorithm. Increasing 'k' makes predictions more resilient to noise but may decrease sensitivity to local variations.
  • n (DataPoints): Number of data points considered in AI analysis. This affects how the AI interprets patterns in the price data.
  • maType (Select MA): Type of moving average applied. Options allow for different smoothing techniques to emphasize or dampen aspects of price movement.
  • length: Length of the moving average. A greater length creates a smoother curve but might lag recent price changes.
  • dataToClassify: Source data for classifying price as bullish or bearish. It can be adjusted to consider different aspects of price information
  • dataForMovingAverage: Source data for calculating the moving average. Different selections may emphasize different aspects of price movement.



-----------------
Disclaimer

The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.

All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.

My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!

הערות שחרור

Improvements!

  • Two new AI moving averages have been added.
תגובות
iOX369
Awesome! Adaptive is the keyword. I've been testing it the past few hours on my MA/ trend-based strategies. So far, it has beaten every other alternative in my indicator toolbox. Well done @Zeiierman. And thanks for making it free.
Zeiierman
@iOX369, Thank you so much for the kind words! Always happy to contribute to the community. Let me know if you have any suggestions or questions in the future!
ashishdesai197
Sir, the indicator is amazing and working very well for Indian stocks & indices. Can you pl look into additing "Alert" to "Trend Recognition"? for this indicator, as like in your other successful indicators. It would be great help & it will add value to the indicator.
shivanjalikn
very nice script sir.
Zeiierman
@shivanjalikn, Thank you mate!
rodrigoabadi
Hi dear,

Nice job with all those scripts!!
I have a doubt with the script AI Moving Average (Expo) SMA, how do i put a alert for when the indicator AI(1) Box Shape goes to 0 ? i allready try same attempts here and nothing...could you help me??
Regards.

Rodrigo Abadi
Mindspirit
I am loving the update! the line is cleaner and the function is much better than before. Currently the KNN AI Coloring works very well, but it is entirely short biased haha. Uptrend colors never gets affected and won't show the tad bid earlier way that Downtrend does, but the very fact that the short bias is there is fantastic as a big improvement. Thanks for the great update
Mindspirit
I'm liking this improvement a lot. I noticed that the AI Coloring with KNN algorithm is pretty unique, it does a great job of showing a downtrend early, however it doesn't do anything for attempting to shift an uptrend color early. Would love to see a fix for that, but the way it is currently is great.
Zen_Sammy
Thank you for this awesome script, can you please help me with labeling the boxes in the positive and negative zone, and the same for the Bullish Trend and Bearish Trend plot, some Alerts would be usefull.
rpkcrypto
Zeiierman
Saw the update. How to make use of the newly added Moving Average? I am a little confused by seeing the plot. Can you elaborate a little bit?
עוד