TradingView
chhagansinghmeena
31 de May. de 2023 11:28

Machine Learning : Cosine Similarity & Euclidean Distance 

Nifty Bank IndexNSE

Descripción

Introduction:
This script implements a comprehensive trading strategy that adheres to the established rules and guidelines of housing trading. It leverages advanced machine learning techniques and incorporates customised moving averages, including the Conceptive Price Moving Average (CPMA), to provide accurate signals for informed trading decisions in the housing market. Additionally, signal processing techniques such as Lorentzian, Euclidean distance, Cosine similarity, Know sure thing, Rational Quadratic, and sigmoid transformation are utilised to enhance the signal quality and improve trading accuracy.

Features:

Market Analysis: The script utilizes advanced machine learning methods such as Lorentzian, Euclidean distance, and Cosine similarity to analyse market conditions. These techniques measure the similarity and distance between data points, enabling more precise signal identification and enhancing trading decisions.

Cosine similarity:
Cosine similarity is a measure used to determine the similarity between two vectors, typically in a high-dimensional space. It calculates the cosine of the angle between the vectors, indicating the degree of similarity or dissimilarity.
In the context of trading or signal processing, cosine similarity can be employed to compare the similarity between different data points or signals. The vectors in this case represent the numerical representations of the data points or signals.
Cosine similarity ranges from -1 to 1, with 1 indicating perfect similarity, 0 indicating no similarity, and -1 indicating perfect dissimilarity. A higher cosine similarity value suggests a closer match between the vectors, implying that the signals or data points share similar characteristics.

Lorentzian Classification:
Lorentzian classification is a machine learning algorithm used for classification tasks. It is based on the Lorentzian distance metric, which measures the similarity or dissimilarity between two data points. The Lorentzian distance takes into account the shape of the data distribution and can handle outliers better than other distance metrics.

Euclidean Distance:
Euclidean distance is a distance metric widely used in mathematics and machine learning. It calculates the straight-line distance between two points in Euclidean space. In two-dimensional space, the Euclidean distance between two points (x1, y1) and (x2, y2) is calculated using the formula sqrt((x2 - x1)^2 + (y2 - y1)^2).

Dynamic Time Windows: The script incorporates a dynamic time window function that allows users to define specific time ranges for trading. It checks if the current time falls within the specified window to execute the relevant trading signals.

Custom Moving Averages: The script includes the CPMA, a powerful moving average calculation. Unlike traditional moving averages, the CPMA provides improved support and resistance levels by considering multiple price types and employing a combination of Exponential Moving Averages (EMAs) and Simple Moving Averages (SMAs). Its adaptive nature ensures responsiveness to changes in price trends.

Signal Processing Techniques: The script applies signal processing techniques such as Know sure thing, Rational Quadratic, and sigmoid transformation to enhance the quality of the generated signals. These techniques improve the accuracy and reliability of the trading signals, aiding in making well-informed trading decisions.

Trade Statistics and Metrics: The script provides comprehensive trade statistics and metrics, including total wins, losses, win rate, win-loss ratio, and early signal flips. These metrics offer valuable insights into the performance and effectiveness of the trading strategy.

Usage:

Configuring Time Windows: Users can customize the time windows by specifying the start and finish time ranges according to their trading preferences and local market conditions.

Signal Interpretation: The script generates long and short signals based on the analysis, custom moving averages, and signal processing techniques. Users should pay attention to these signals and take appropriate action, such as entering or exiting trades, depending on their trading strategies.

Trade Statistics: The script continuously tracks and updates trade statistics, providing users with a clear overview of their trading performance. These statistics help users assess the effectiveness of the strategy and make informed decisions.

Conclusion:
With its adherence to housing trading rules, advanced machine learning methods, customized moving averages like the CPMA, and signal processing techniques such as Lorentzian, Euclidean distance, Cosine similarity, Know sure thing, Rational Quadratic, and sigmoid transformation, this script offers users a powerful tool for housing market analysis and trading. By leveraging the provided signals, time windows, and trade statistics, users can enhance their trading strategies and improve their overall trading performance.

Disclaimer:
Please note that while this script incorporates established tradingview housing rules, advanced machine learning techniques, customized moving averages, and signal processing techniques, it should be used for informational purposes only. Users are advised to conduct their own analysis and exercise caution when making trading decisions. The script's performance may vary based on market conditions, user settings, and the accuracy of the machine learning methods and signal processing techniques. The trading platform and developers are not responsible for any financial losses incurred while using this script.

By publishing this script on the platform, traders can benefit from its professional presentation, clear instructions, and the utilisation of advanced machine learning techniques, customised moving averages, and signal processing techniques for enhanced trading signals and accuracy.

I extend my gratitude to TradingView, LUX ALGO, and JDEHORTY for their invaluable contributions to the trading community. Their innovative scripts, meticulous coding patterns, and insightful ideas have profoundly enriched traders' strategies, including my own.

Notas de prensa

We have resolved the VWAP issue for NSE BankNifty and Nifty50 for higher time frames. Now, traders can use our indicator on time frames such as 1 hour and beyond to generate reliable signals and make informed trading decisions."

"Now script not only excels on lower time frames but also delivers signals on higher time frames, including intraday and swing trading strategies. Whether you're a short-term trader or a long-term investor, our indicator adapts to your preferred time frame."
Comentarios
richlabz
Great indicator, can you tell me the settings to alert me when there is a buy or sell signal... my alerts doesn't seem to be working
GAURAVCHAUDHARYFRX
does it repaint ?
crypto_tycho
What is the logic of calculating the win/loss trades?
Would please add a field to set the profit and loss % which will calculate the win/loss %?

Thanks
vmeltrozo
I have a doubt, when I put your indicator in the EURUSD at 1D, the table tells me that It made 22 trades, of which 21 ended in TP and 1 SL. The issue is that when I see the amount of buys and sells that are in the chart, these exceed the 22 trades very easily, besides not having at all that hit ratio the table indicates. Am I seeing or interpreting something wrong?
chhagansinghmeena
@vmeltrozo, Thank you for bringing up your concern. I understand the confusion you're experiencing. The discrepancy you're observing might be due to the way the table counts the trades and the presence of multiple signals on the chart.

Please note that the table includes the total number of trades made by the indicator over the specified period, which includes both closed and open trades. It also takes into account the number of bars in the chart. As a result, the count may exceed the actual closed trades you see on the chart.

To get a more accurate representation of the indicator's hit ratio, I recommend focusing on the closed trades only. By considering the trades that have been completed (either hitting the take profit or stop loss), you can assess the true hit ratio.

If you're still experiencing any issues or have further questions, please feel free to provide additional details, and I'll be glad to assist you further. Thank you for your understanding.
vmeltrozo
@chhagansinghmeena, you mean that not all the red and green arrows that the indicator marks are trades? if so, how do I identify which arrow is a trade and which is not? how can I know where the SL and TP of each trade is marked? I only see arrows but I don't see closings or TP and SL marks.
chhagansinghmeena
@vmeltrozo, Thank you for your follow-up comment. I apologize for any confusion caused. Let me clarify the issue regarding the red and green arrows and the trade identification.

The red and green arrows marked by the indicator do represent potential trade signals, indicating points of entry based on the indicator's algorithm. However, it's important to note that not all arrows result in actual executed trades. The indicator highlights possible trade opportunities, but it doesn't directly place trades or manage positions.

To identify the specific trades and their associated stop loss (SL) and take profit (TP) levels, you'll need to manually analyze the chart and apply your own trading strategy or method. The indicator's arrows provide you with potential entry points, but the management of trades, including SL and TP levels, is left to the user's discretion.

Regarding the bug you mentioned, I appreciate your effort in investigating it. It appears that the trade count is currently based on the number of favorable or opposite bars, which may lead to inaccurate results. I apologize for this issue, and I'm actively working on resolving it to improve the accuracy of the indicator's trade count.

Please keep in mind that this indicator is intended to be used as a tool to assist traders in identifying potential trade setups, but it's important to apply your own analysis and risk management when executing trades.

Thank you for your understanding, and I'm committed to addressing the bug and enhancing the indicator's functionality. If you have any further questions or suggestions, please don't hesitate to let me know. Your feedback is valuable and helps me improve the script for all users.
vmeltrozo
@chhagansinghmeena, i'm not saying that i'm waiting for the indicator to do everything for me, i just don't understand where the indicator gets the data for the chart. moreover, according to the chart of this indicator, it says it has a hit of 80% - 90% (i mean "winrate"), something that is not reflected at all in the graph, and if it says it has that hit, it means that it must be simulating entries and that it also provides a SL and a TP...either the table is useless or it is lying.
chhagansinghmeena
@vmeltrozo, Thank you for your further clarification. I apologize for any confusion caused. Allow me to address your concerns and provide more information about the indicator's data source and the displayed win rate.

The indicator retrieves its data from the price chart itself, analyzing the historical price movements to identify potential trade signals. The arrows on the chart indicate potential entry points based on the indicator's algorithm. However, it's important to note that the indicator doesn't directly provide specific data for each trade, such as SL and TP levels.

Regarding the displayed win rate, please understand that the win rate shown in the indicator's description or table is based on historical data and backtesting results. It represents the percentage of winning trades out of the total trades taken during the tested period. However, it's important to remember that past performance may not necessarily guarantee future results.

I apologize if the displayed win rate has caused confusion or set unrealistic expectations. I understand your concern about the disparity between the win rate and the actual chart representation. It's crucial to interpret the win rate as an indication of the indicator's historical performance, but individual trade outcomes may vary depending on various factors, including market conditions and personal trading decisions.

I genuinely appreciate your feedback and understand your perspective. It's my intention to provide accurate and helpful information to traders. I will take your observations into consideration and work on improving the clarity of the indicator's presentation, including providing better explanations regarding the win rate calculation.

If you have any further questions or suggestions, please feel free to let me know. I value your input and will continue to enhance the indicator based on user feedback.

Thank you for your understanding and support.
Godkoka
Beautiful .Keep it up👍
Más