Machine Learning: Optimal RSI [YinYangAlgorithms]This Indicator, will rate multiple different lengths of RSIs to determine which RSI to RSI MA cross produced the highest profit within the lookback span. This ‘Optimal RSI’ is then passed back, and if toggled will then be thrown into a Machine Learning calculation. You have the option to Filter RSI and RSI MA’s within the Machine Learning calculation. What this does is, only other Optimal RSI’s which are in the same bullish or bearish direction (is the RSI above or below the RSI MA) will be added to the calculation.
You can either (by default) use a Simple Average; which is essentially just a Mean of all the Optimal RSI’s with a length of Machine Learning. Or, you can opt to use a k-Nearest Neighbour (KNN) calculation which takes a Fast and Slow Speed. We essentially turn the Optimal RSI into a MA with different lengths and then compare the distance between the two within our KNN Function.
RSI may very well be one of the most used Indicators for identifying crucial Overbought and Oversold locations. Not only that but when it crosses its Moving Average (MA) line it may also indicate good locations to Buy and Sell. Many traders simply use the RSI with the standard length (14), however, does that mean this is the best length?
By using the length of the top performing RSI and then applying some Machine Learning logic to it, we hope to create what may be a more accurate, smooth, optimal, RSI.
Tutorial:
This is a pretty zoomed out Perspective of what the Indicator looks like with its default settings (except with Bollinger Bands and Signals disabled). If you look at the Tables above, you’ll notice, currently the Top Performing RSI Length is 13 with an Optimal Profit % of: 1.00054973. On its default settings, what it does is Scan X amount of RSI Lengths and checks for when the RSI and RSI MA cross each other. It then records the profitability of each cross to identify which length produced the overall highest crossing profitability. Whichever length produces the highest profit is then the RSI length that is used in the plots, until another length takes its place. This may result in what we deem to be the ‘Optimal RSI’ as it is an adaptive RSI which changes based on performance.
In our next example, we changed the ‘Optimal RSI Type’ from ‘All Crossings’ to ‘Extremity Crossings’. If you compare the last two examples to each other, you’ll notice some similarities, but overall they’re quite different. The reason why is, the Optimal RSI is calculated differently. When using ‘All Crossings’ everytime the RSI and RSI MA cross, we evaluate it for profit (short and long). However, with ‘Extremity Crossings’, we only evaluate it when the RSI crosses over the RSI MA and RSI <= 40 or RSI crosses under the RSI MA and RSI >= 60. We conclude the crossing when it crosses back on its opposite of the extremity, and that is how it finds its Optimal RSI.
The way we determine the Optimal RSI is crucial to calculating which length is currently optimal.
In this next example we have zoomed in a bit, and have the full default settings on. Now we have signals (which you can set alerts for), for when the RSI and RSI MA cross (green is bullish and red is bearish). We also have our Optimal RSI Bollinger Bands enabled here too. These bands allow you to see where there may be Support and Resistance within the RSI at levels that aren’t static; such as 30 and 70. The length the RSI Bollinger Bands use is the Optimal RSI Length, allowing it to likewise change in correlation to the Optimal RSI.
In the example above, we’ve zoomed out as far as the Optimal RSI Bollinger Bands go. You’ll notice, the Bollinger Bands may act as Support and Resistance locations within and outside of the RSI Mid zone (30-70). In the next example we will highlight these areas so they may be easier to see.
Circled above, you may see how many times the Optimal RSI faced Support and Resistance locations on the Bollinger Bands. These Bollinger Bands may give a second location for Support and Resistance. The key Support and Resistance may still be the 30/50/70, however the Bollinger Bands allows us to have a more adaptive, moving form of Support and Resistance. This helps to show where it may ‘bounce’ if it surpasses any of the static levels (30/50/70).
Due to the fact that this Indicator may take a long time to execute and it can throw errors for such, we have added a Setting called: Adjust Optimal RSI Lookback and RSI Count. This settings will automatically modify the Optimal RSI Lookback Length and the RSI Count based on the Time Frame you are on and the Bar Indexes that are within. For instance, if we switch to the 1 Hour Time Frame, it will adjust the length from 200->90 and RSI Count from 30->20. If this wasn’t adjusted, the Indicator would Timeout.
You may however, change the Setting ‘Adjust Optimal RSI Lookback and RSI Count’ to ‘Manual’ from ‘Auto’. This will give you control over the ‘Optimal RSI Lookback Length’ and ‘RSI Count’ within the Settings. Please note, it will likely take some “fine tuning” to find working settings without the Indicator timing out, but there are definitely times you can find better settings than our ‘Auto’ will create; especially on higher Time Frames. The Minimum our ‘Auto’ will create is:
Optimal RSI Lookback Length: 90
RSI Count: 20
The Maximum it will create is:
Optimal RSI Lookback Length: 200
RSI Count: 30
If there isn’t much bar index history, for instance, if you’re on the 1 Day and the pair is BTC/USDT you’ll get < 4000 Bar Indexes worth of data. For this reason it is possible to manually increase the settings to say:
Optimal RSI Lookback Length: 500
RSI Count: 50
But, please note, if you make it too high, it may also lead to inaccuracies.
We will conclude our Tutorial here, hopefully this has given you some insight as to how calculating our Optimal RSI and then using it within Machine Learning may create a more adaptive RSI.
Settings:
Optimal RSI:
Show Crossing Signals: Display signals where the RSI and RSI Cross.
Show Tables: Display Information Tables to show information like, Optimal RSI Length, Best Profit, New Optimal RSI Lookback Length and New RSI Count.
Show Bollinger Bands: Show RSI Bollinger Bands. These bands work like the TDI Indicator, except its length changes as it uses the current RSI Optimal Length.
Optimal RSI Type: This is how we calculate our Optimal RSI. Do we use all RSI and RSI MA Crossings or just when it crosses within the Extremities.
Adjust Optimal RSI Lookback and RSI Count: Auto means the script will automatically adjust the Optimal RSI Lookback Length and RSI Count based on the current Time Frame and Bar Index's on chart. This will attempt to stop the script from 'Taking too long to Execute'. Manual means you have full control of the Optimal RSI Lookback Length and RSI Count.
Optimal RSI Lookback Length: How far back are we looking to see which RSI length is optimal? Please note the more bars the lower this needs to be. For instance with BTC/USDT you can use 500 here on 1D but only 200 for 15 Minutes; otherwise it will timeout.
RSI Count: How many lengths are we checking? For instance, if our 'RSI Minimum Length' is 4 and this is 30, the valid RSI lengths we check is 4-34.
RSI Minimum Length: What is the RSI length we start our scans at? We are capped with RSI Count otherwise it will cause the Indicator to timeout, so we don't want to waste any processing power on irrelevant lengths.
RSI MA Length: What length are we using to calculate the optimal RSI cross' and likewise plot our RSI MA with?
Extremity Crossings RSI Backup Length: When there is no Optimal RSI (if using Extremity Crossings), which RSI should we use instead?
Machine Learning:
Use Rational Quadratics: Rationalizing our Close may be beneficial for usage within ML calculations.
Filter RSI and RSI MA: Should we filter the RSI's before usage in ML calculations? Essentially should we only use RSI data that are of the same type as our Optimal RSI? For instance if our Optimal RSI is Bullish (RSI > RSI MA), should we only use ML RSI's that are likewise bullish?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Moyennes mobiles
Moving Average TransformThe MAT is essentially a different kind of smoothed moving average. It is made to filter out data sets that deviate from the specified absolute threshold and the result becomes a smoothing function. The goal here, inspired by time series analysis within mathematical study, is to eliminate data anomalies and generate a more accurate trendline.
Functionality:
This script calculates a filtered average by:
Determining the mean of the entire data series.
Initializing sum and count variables.
Iterating through the data to filter values that deviate from the mean beyond the threshold.
Calculating a filtered mean based on the filtered data.
The filtered mean is then passed through a moving average function, where various types of moving averages like SMA, EMA, DEMA, TEMA, and ALMA can be applied. Some popular averages such as the HMA were omitted due to their heavy dependency on weighing specific data points.
Some information from "Time Series Analysis" regarding deviations
Definition of Anomaly: An anomaly or outlier is a data point that differs significantly from other observations in the dataset. It can be caused by various reasons such as measurement errors, data entry errors, or genuine extreme observations.
Impact on Mean: The mean (or average) of a dataset is calculated by summing all the values and dividing by the number of values. Since the mean is sensitive to extreme values, even a single outlier can significantly skew the mean.
Example: Consider a simple time series dataset: . The value "150" is an anomaly in this context. If we calculate the mean with this outlier, it is (10 + 12 + 11 + 9 + 150) / 5 = 38.4. However, if we exclude the outlier, the mean becomes (10 + 12 + 11 + 9) / 4 = 10.5. The presence of the outlier has substantially increased the mean.
Accuracy and Representativeness: While the mean calculated without outliers might be more "accurate" in the sense of being more representative of the central tendency of the bulk of the data, it's essential to note that anomalies might convey important information about the system being studied. Blindly removing or ignoring them might lead to overlooking significant events or phenomena.
Approaches to Handle Anomalies?
Detection and Removal
Robust Statistics
Transformation
2Mars - MA / BB / SuperTrend
The 2Mars strategy is a trading approach that aims to improve trading efficiency by incorporating several simple order opening tactics. These tactics include moving average crossovers, Bollinger Bands, and SuperTrend.
Entering a Position with the 2Mars Strategy:
Moving Average Crossover: This method considers the crossing of moving averages as a signal to enter a position.
Price Crossing Bollinger Bands: If the price crosses either the upper or lower Bollinger Band, it is seen as a signal to enter a position.
Price Crossing Moving Average: If the price crosses the moving average, it is also considered a signal to enter a position.
SuperTrend and Bars confirm:
The SuperTrend indicator is used to provide additional confirmation for entering positions and setting stop loss levels. "Bars confirm" is used only for entry to positions.
Moving Average Crossover Strategy:
A moving average crossover refers to the point on a chart where there is a crossover of the signal or fast moving average, above or below the basis or slow moving average. This strategy also uses moving averages for additional orders #3.
Basis Moving Average Length: Ratio * Multiplier
Signal Moving Average Length: Multiplier
Bollinger Bands:
Bollinger Bands consist of three bands: an upper band, a lower band, and a basis moving average. However, the 2Mars strategy incorporates multiple upper and lower levels for position entry and take profit.
Basis +/- StdDev * 0.618
Basis +/- StdDev * 1.618
Basis +/- StdDev * 2.618
Additional Orders:
Additional Order #1 and #2: closing price crosses above or below the Bollinger Bands.
Additional Order #3: closing price crosses above or below the basis or signal moving average.
Take Profit:
The strategy includes three levels for taking profits, which are based on the Bollinger Bands. Additionally, a percentage of the position can be chosen to close long or short positions.
Limit Orders:
The strategy allows for entering a position using a limit order. The calculation for the limit order involves the Average True Range (ATR) for a specific period.
For long positions: Low price - ATR * Multiplier
For short positions: High price + ATR * Multiplier
Stop Loss:
To manage risk, the strategy recommends using stop loss options. The stop loss is updated with each entry order and take-profit level 3. When using the SuperTrend Confirmation, the stop loss requires confirmation of a trend change. It allows for flexible adjustment of the stop loss when the trend changes.
There are three options for setting the stop loss:
1. ATR (Average True Range):
For long positions: Low price - ATR * Long multiplier
For short positions: High price + ATR * Short multiplier
2. SuperTrend + ATR:
For long positions: SuperTrend - ATR * Long multiplier
For short positions: SuperTrend + ATR * Short multiplier
3. StdDev:
For long positions: StdDev - ATR * Long multiplier
For short positions: StdDev + ATR * Short multiplier
Flexible Stop Loss:
There is also a flexible stop loss option for the ATR and StdDev methods. It is triggered when the SuperTrend or moving average trend changes unfavorably.
For long positions: Stop-loss price + (ATR * Long multiplier) * Multiplier
For short positions: Stop-loss price - (ATR * Short multiplier) * Multiplier
How configure:
Disable SuperTrend, take profit, stop loss, additional orders and begin setting up a strategy.
Pick soucre data
Number of bars for confirm
Pick up the ratio of the base moving average and the signal moving average.
Set up a SuperTrend
Time for set up of the Bollinger Bands and the take profit
And finaly set up of stop loss and limit orders
All done!
For OKX exchange:
t.me
Volume and Price Z-Score [Multi-Asset] - By LeviathanThis script offers in-depth Z-Score analytics on price and volume for 200 symbols. Utilizing visualizations such as scatter plots, histograms, and heatmaps, it enables traders to uncover potential trade opportunities, discern market dynamics, pinpoint outliers, delve into the relationship between price and volume, and much more.
A Z-Score is a statistical measurement indicating the number of standard deviations a data point deviates from the dataset's mean. Essentially, it provides insight into a value's relative position within a group of values (mean).
- A Z-Score of zero means the data point is exactly at the mean.
- A positive Z-Score indicates the data point is above the mean.
- A negative Z-Score indicates the data point is below the mean.
For instance, a Z-Score of 1 indicates that the data point is 1 standard deviation above the mean, while a Z-Score of -1 indicates that the data point is 1 standard deviation below the mean. In simple terms, the more extreme the Z-Score of a data point, the more “unusual” it is within a larger context.
If data is normally distributed, the following properties can be observed:
- About 68% of the data will lie within ±1 standard deviation (z-score between -1 and 1).
- About 95% will lie within ±2 standard deviations (z-score between -2 and 2).
- About 99.7% will lie within ±3 standard deviations (z-score between -3 and 3).
Datasets like price and volume (in this context) are most often not normally distributed. While the interpretation in terms of percentage of data lying within certain ranges of z-scores (like the ones mentioned above) won't hold, the z-score can still be a useful measure of how "unusual" a data point is relative to the mean.
The aim of this indicator is to offer a unique way of screening the market for trading opportunities by conveniently visualizing where current volume and price activity stands in relation to the average. It also offers features to observe the convergent/divergent relationships between asset’s price movement and volume, observe a single symbol’s activity compared to the wider market activity and much more.
Here is an overview of a few important settings.
Z-SCORE TYPE
◽️ Z-Score Type: Current Z-Score
Calculates the z-score by comparing current bar’s price and volume data to the mean (moving average with any custom length, default is 20 bars). This indicates how much the current bar’s price and volume data deviates from the average over the specified period. A positive z-score suggests that the current bar's price or volume is above the mean of the last 20 bars (or the custom length set by the user), while a negative z-score means it's below that mean.
Example: Consider an asset whose current price and volume both show deviations from their 20-bar averages. If the price's Z-Score is +1.5 and the volume's Z-Score is +2.0, it means the asset's price is 1.5 standard deviations above its average, and its trading volume is 2 standard deviations above its average. This might suggest a significant upward move with strong trading activity.
◽️ Z-Score Type: Average Z-Score
Calculates the custom-length average of symbol's z-score. Think of it as a smoothed version of the Current Z-Score. Instead of just looking at the z-score calculated on the latest bar, it considers the average behavior over the last few bars. By doing this, it helps reduce sudden jumps and gives a clearer, steadier view of the market.
Example: Instead of a single bar, imagine the average price and volume of an asset over the last 5 bars. If the price's 5-bar average Z-Score is +1.0 and the volume's is +1.5, it tells us that, over these recent bars, both the price and volume have been consistently above their longer-term averages, indicating sustained increase.
◽️ Z-Score Type: Relative Z-Score
Calculates a relative z-score by comparing symbol’s current bar z-score to the mean (average z-score of all symbols in the group). This is essentially a z-score of a z-score, and it helps in understanding how a particular symbol's activity stands out not just in its own historical context, but also in relation to the broader set of symbols being analyzed. In other words, while the primary z-score tells you how unusual a bar's activity is for that specific symbol, the relative z-score informs you how that "unusualness" ranks when compared to the entire group's deviations. This can be particularly useful in identifying symbols that are outliers even among outliers, indicating exceptionally unique behaviors or opportunities.
Example: If one asset's price Z-Score is +2.5 and volume Z-Score is +3.0, but the group's average Z-Scores are +0.5 for price and +1.0 for volume, this asset’s Relative Z-Score would be high and therefore stand out. This means that asset's price and volume activities are notably high, not just by its own standards, but also when compared to other symbols in the group.
DISPLAY TYPE
◽️ Display Type: Scatter Plot
The Scatter Plot is a visual tool designed to represent values for two variables, in this case the Z-Scores of price and volume for multiple symbols. Each symbol has it's own dot with x and y coordinates:
X-Axis: Represents the Z-Score of price. A symbol further to the right indicates a higher positive deviation in its price from its average, while a symbol to the left indicates a negative deviation.
Y-Axis: Represents the Z-Score of volume. A symbol positioned higher up on the plot suggests a higher positive deviation in its trading volume from its average, while one lower down indicates a negative deviation.
Here are some guideline insights of plot positioning:
- Top-Right Quadrant (High Volume-High Price): Symbols in this quadrant indicate a scenario where both the trading volume and price are higher than their respective mean.
- Top-Left Quadrant (High Volume-Low Price): Symbols here reflect high trading volumes but prices lower than the mean.
- Bottom-Left Quadrant (Low Volume-Low Price): Assets in this quadrant have both low trading volume and price compared to their mean.
- Bottom-Right Quadrant (Low Volume-High Price): Symbols positioned here have prices that are higher than their mean, but the trading volume is low compared to the mean.
The plot also integrates a set of concentric squares which serve as visual guides:
- 1st Square (1SD): Encapsulates symbols that have Z-Scores within ±1 standard deviation for both price and volume. Symbols within this square are typically considered to be displaying normal behavior or within expected range.
- 2nd Square (2SD): Encapsulates those with Z-Scores within ±2 standard deviations. Symbols within this boundary, but outside the 1 SD square, indicate a moderate deviation from the norm.
- 3rd Square (3SD): Represents symbols with Z-Scores within ±3 standard deviations. Any symbol outside this square is deemed to be a significant outlier, exhibiting extreme behavior in terms of either its price, its volume, or both.
By assessing the position of symbols relative to these squares, traders can swiftly identify which assets are behaving typically and which are showing unusual activity. This visualization simplifies the process of spotting potential outliers or unique trading opportunities within the market. The farther a symbol is from the center, the more it deviates from its typical behavior.
◽️ Display Type: Columns
In this visualization, z-scores are represented using columns, where each symbol is presented horizontally. Each symbol has two distinct nodes:
- Left Node: Represents the z-score of volume.
- Right Node: Represents the z-score of price.
The height of these nodes can vary along the y-axis between -4 and 4, based on the z-score value:
- Large Positive Columns: Signify a high or positive z-score, indicating that the price or volume is significantly above its average.
- Large Negative Columns: Represent a low or negative z-score, suggesting that the price or volume is considerably below its average.
- Short Columns Near 0: Indicate that the price or volume is close to its mean, showcasing minimal deviation.
This columnar representation provides a clear, intuitive view of how each symbol's price and volume deviate from their respective averages.
◽️ Display Type: Circles
In this visualization style, z-scores are depicted using circles. Each symbol is horizontally aligned and represented by:
- Solid Circle: Represents the z-score of price.
- Transparent Circle: Represents the z-score of volume.
The vertical position of these circles on the y-axis ranges between -4 and 4, reflecting the z-score value:
- Circles Near the Top: Indicate a high or positive z-score, suggesting the price or volume is well above its average.
- Circles Near the Bottom: Represent a low or negative z-score, pointing to the price or volume being notably below its average.
- Circles Around the Midline (0): Highlight that the price or volume is close to its mean, with minimal deviation.
◽️ Display Type: Delta Columns
There's also an option to utilize Z-Score Delta Columns. For each symbol, a single column is presented, depicting the difference between the z-score of price and the z-score of volume.
The z-score delta essentially captures the disparity between how much the price and volume deviate from their respective mean:
- Positive Delta: Indicates that the z-score of price is greater than the z-score of volume. This suggests that the price has deviated more from its average than the volume has from its own average. Such a scenario could point to price movements being more significant or pronounced compared to the changes in volume.
- Negative Delta: Represents that the z-score of volume is higher than the z-score of price. This might mean that there are substantial volume changes, yet the price hasn't moved as dramatically. This can be indicative of potential build-up in trading interest without an equivalent impact on price.
- Delta Close to 0: Means that the z-scores for price and volume are almost equal, indicating their deviations from the average are in sync.
◽️ Display Type: Z-Volume/Z-Price Heatmap
This visualization offers a heatmap either for volume z-scores or price z-scores across all symbols. Here's how it's presented:
Each symbol is allocated its own horizontal row. Within this row, bar-by-bar data is displayed using a color gradient to represent the z-score values. The heatmap employs a user-defined gradient scale, where a chosen "cold" color represents low z-scores and a chosen "hot" color signifies high z-scores. As the z-score increases or decreases, the colors transition smoothly along this gradient, providing an intuitive visual indication of the z-score's magnitude.
- Cold Colors: Indicate values significantly below the mean (negative z-score)
- Mild Colors: Represent values close to the mean, suggesting minimal deviation.
- Hot Colors: Indicate values significantly above the mean (positive z-score)
This heatmap format provides a rapid, visually impactful means to discern how each symbol's price or volume is behaving relative to its average. The color-coded rows allow you to quickly spot outliers.
VOLUME TYPE
The "Volume Type" input allows you to choose the nature of volume data that will be factored into the volume z-score calculation. The interpretation of indicator’s data changes based on this input. You can opt between:
- Volume (Regular Volume): This is the classic measure of trading volume, which represents the volume traded in a given time period - bar.
- OBV (On-Balance Volume): OBV is a momentum indicator that accumulates volume on up bars and subtracts it on down bars, making it a cumulative indicator that sort of measures buying and selling pressure.
Interpretation Implications:
- For Volume Type: Regular Volume:
Positive Z-Score: Indicates that the trading volume is above its average, meaning there's unusually high trading activity .
Negative Z-Score: Suggests that the trading volume is below its average, signifying unusually low trading activity.
- For Volume Type: OBV:
Positive Z-Score: Signifies that “buying pressure” is above its average.
Negative Z-Score: Signifies that “selling pressure” is above its average.
When comparing Z-Score of OBV to Z-Score of price, we can observe several scenarios. If Z-Price and Z-Volume are convergent (have similar z-scores), we can say that the directional price movement is supported by volume. If Z-Price and Z-Volume are divergent (have very different z-scores or one of them being zero), it suggests a potential misalignment between price movement and volume support, which might hint at possible reversals or weakness.
MTF Moving AveragesThe MTF Moving Averages indicator allows users to plot multiple moving averages on different timeframes within the same chart on TradingView. This indicator supports four different timeframes: daily, weekly, monthly, and intraday.
For each timeframe, users can choose up to four moving averages to plot. They can also select the type of moving average (SMA, EMA, or WMA), the source (e.g., close price), and the length of each moving average. Additionally, users have the option to enable a "Trend Suite" for the second moving average on the daily timeframe. The Trend Suite adds 2 moving averages with source low and high.
In the intraday timeframe, the second moving average is calculated and plotted based on the daily timeframe.
The indicator provides customization options for colors, allowing users to define the colors for each moving average line.
The settings in the indicator are designed in a clear and organized manner.
Have fun
Moving Average with Start LineThis script paints a vertical line on the starting bar of a simple moving average to help anticipate directional changes. The line is the same color as the MA.
Trend Gaussian Channels [DeltaAlgo]This Script Introduces The Use Of The Gaussian Channel Concepts
This indicator consists of three lines: a central line that represents the moving average, and an upper and lower band that represent the volatility of the price movements.
The Gaussian channels is a concept consists of an upper & lower bands along with the basis; the mid band. The use of the Gaussian bands are simple, as described below.👇
Use Case:
There are many ways the Gaussian channel indicator can be used!
1. Look for the price to touch or cross the upper/lower bands of the Gaussian Channel Indicator. This indicates that the price has reached an high level of volatility. a reversal or correction may be imminent.
2. Wait for confirmation of the potential reversal or correction. This can be in the form of a bearish or bullish candlestick pattern, or a signal from another technical indicator.
a. For this reason I have implemented some signals that indicate trend shifts & candle colors to clearly display the switching between a bullish sentiment or bearish.
3. Enter a trade in the direction of the reversal or correction. For example, if the price touches the upper band and a bearish candlestick pattern occurs or if you get a bearish signal, enter a short trade. If the price touches the lower band and indicates bullish candlestick pattern or bullish signal, enter a long trade.
Sometimes this band can act as a support & resistance, THIS is not always the case as it is not meant to be used as support & resistance.
REMA CROSSOVER BY JUGNUThis indicator triggers alerts for long and short positions on DAILY TIME FRAME for SWING trades based on the conditions which described below. This script will generate alerts when the following conditions are met:
LONG POSITION:
RSI(14) above 50.
EMA(5) crosses above EMA(10).
Indicator Triangle Green below price bars
SHORT POSITION:
RSI(14) below 50.
EMA(5) crosses down EMA(10).
Indicator Triangle RED above price bars
This script plots green and red triangles below and above the price bars to indicate long and short alert conditions, respectively. It also triggers alerts when these conditions are met.
Machine Learning: SuperTrend Strategy TP/SL [YinYangAlgorithms]The SuperTrend is a very useful Indicator to display when trends have shifted based on the Average True Range (ATR). Its underlying ideology is to calculate the ATR using a fixed length and then multiply it by a factor to calculate the SuperTrend +/-. When the close crosses the SuperTrend it changes direction.
This Strategy features the Traditional SuperTrend Calculations with Machine Learning (ML) and Take Profit / Stop Loss applied to it. Using ML on the SuperTrend allows for the ability to sort data from previous SuperTrend calculations. We can filter the data so only previous SuperTrends that follow the same direction and are within the distance bounds of our k-Nearest Neighbour (KNN) will be added and then averaged. This average can either be achieved using a Mean or with an Exponential calculation which puts added weight on the initial source. Take Profits and Stop Losses are then added to the ML SuperTrend so it may capitalize on Momentum changes meanwhile remaining in the Trend during consolidation.
By applying Machine Learning logic and adding a Take Profit and Stop Loss to the Traditional SuperTrend, we may enhance its underlying calculations with potential to withhold the trend better. The main purpose of this Strategy is to minimize losses and false trend changes while maximizing gains. This may be achieved by quick reversals of trends where strategic small losses are taken before a large trend occurs with hopes of potentially occurring large gain. Due to this logic, the Win/Loss ratio of this Strategy may be quite poor as it may take many small marginal losses where there is consolidation. However, it may also take large gains and capitalize on strong momentum movements.
Tutorial:
In this example above, we can get an idea of what the default settings may achieve when there is momentum. It focuses on attempting to hit the Trailing Take Profit which moves in accord with the SuperTrend just with a multiplier added. When momentum occurs it helps push the SuperTrend within it, which on its own may act as a smaller Trailing Take Profit of its own accord.
We’ve highlighted some key points from the last example to better emphasize how it works. As you can see, the White Circle is where profit was taken from the ML SuperTrend simply from it attempting to switch to a Bullish (Buy) Trend. However, that was rejected almost immediately and we went back to our Bearish (Sell) Trend that ended up resulting in our Take Profit being hit (Yellow Circle). This Strategy aims to not only capitalize on the small profits from SuperTrend to SuperTrend but to also capitalize when the Momentum is so strong that the price moves X% away from the SuperTrend and is able to hit the Take Profit location. This Take Profit addition to this Strategy is crucial as momentum may change state shortly after such drastic price movements; and if we were to simply wait for it to come back to the SuperTrend, we may lose out on lots of potential profit.
If you refer to the Yellow Circle in this example, you’ll notice what was talked about in the Summary/Overview above. During periods of consolidation when there is little momentum and price movement and we don’t have any Stop Loss activated, you may see ‘Signal Flashing’. Signal Flashing is when there are Buy and Sell signals that keep switching back and forth. During this time you may be taking small losses. This is a normal part of this Strategy. When a signal has finally been confirmed by Momentum, is when this Strategy shines and may produce the profit you desire.
You may be wondering, what causes these jagged like patterns in the SuperTrend? It's due to the ML logic, and it may be a little confusing, but essentially what is happening is the Fast Moving SuperTrend and the Slow Moving SuperTrend are creating KNN Min and Max distances that are extreme due to (usually) parabolic movement. This causes fewer values to be added to and averaged within the ML and causes less smooth and more exponential drastic movements. This is completely normal, and one of the perks of using k-Nearest Neighbor for ML calculations. If you don’t know, the Min and Max Distance allowed is derived from the most recent(0 index of data array) to KNN Length. So only SuperTrend values that exhibit distances within these Min/Max will be allowed into the average.
Since the KNN ML logic can cause these exponential movements in the SuperTrend, they likewise affect its Take Profit. The Take Profit may benefit from this movement like displayed in the example above which helped it claim profit before then exhibiting upwards movement.
By default our Stop Loss Multiplier is kept quite low at 0.0000025. Keeping it low may help to reduce some Signal Flashing while not taking extra losses more so than not using it at all. However, if we increase it even more to say 0.005 like is shown in the example above. It can really help the trend keep momentum. Please note, although previous results don’t imply future results, at 0.0000025 Stop Loss we are currently exhibiting 69.27% profit while at 0.005 Stop Loss we are exhibiting 33.54% profit. This just goes to show that although there may be less Signal Flashing, it may not result in more profit.
We will conclude our Tutorial here. Hopefully this has given you some insight as to how Machine Learning, combined with Trailing Take Profit and Stop Loss may have positive effects on the SuperTrend when turned into a Strategy.
Settings:
SuperTrend:
ATR Length: ATR Length used to create the Original Supertrend.
Factor: Multiplier used to create the Original Supertrend.
Stop Loss Multiplier: 0 = Don't use Stop Loss. Stop loss can be useful for helping to prevent false signals but also may result in more loss when hit and less profit when switching trends.
Take Profit Multiplier: Take Profits can be useful within the Supertrend Strategy to stop the price reverting all the way to the Stop Loss once it's been profitable.
Machine Learning:
Only Factor Same Trend Direction: Very useful for ensuring that data used in KNN is not manipulated by different SuperTrend Directional data. Please note, it doesn't affect KNN Exponential.
Rationalized Source Type: Should we Rationalize only a specific source, All or None?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
Machine Learning Smoothing Type: How should we smooth our Fast and Slow ML Datas to be used in our KNN Distance calculation? SMA, EMA or VWMA?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length?? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length?? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
VAcc (Velocity & Acceleration)VAcc (Velocity & Acceleration) is a momentum indicator published by Scott Cong in Stocks & Commodities V. 41:09 (8–15). It applies concepts from physics, namely velocity and acceleration, to financial markets. VAcc functions similarly to the popular MACD (Moving Average Convergence Divergence) indicator when using a longer lookback period, but produces more responsive results. With shorter periods, VAcc exhibits characteristics reminiscent of the stochastic oscillator.
🟠 Algorithm
The average velocity over the past n periods is defined as
((C - C_n) / n + (C - C_{n-1}) / (n - 1) + … + (C - C_i) / i + (C - C_1) / 1) / n
At its core, the velocity is a weighted average of the rate of change over the past n periods.
The calculation of the acceleration follows a similar process, where it’s defined as
((V - V_n) / n + (V - V_{n - 1}) / (n - 1) + … + (V - V_i) / i + (V - V_1) / 1) / n
🟠 Comparison with MACD
A comparison of VAcc and MACD on the daily Nasdaq 100 (NDX) chart from August 2022 helps demonstrate VAcc's improved sensitivity. Both indicators utilized a lookback period of 26 days and smoothing of 9 periods.
The VAcc histogram clearly shows a divergence forming, with momentum weakening as prices reached new highs. In contrast, the corresponding MACD histogram significantly lagged in confirming the divergence, highlighting VAcc's ability to identify subtle shifts in trend momentum more immediately than the traditional MACD.
Hull WavesThe Hull Waves indicator is based on the Hull Moving Averages (HMA), which are special moving averages that stand out for their ability to filter out market noise and offer a clearer view of price trends. Compared to traditional moving averages, HMAs are more responsive yet smoother, allowing traders to capture significant price movements without getting overwhelmed by short-term fluctuations.
The HMAs integrated into Hull Waves provide two distinct perspectives on the price trend:
8-period HMA: This short-term HMA is extremely reactive and closely follows price changes. It is ideal for capturing short-term trading signals while the medium-term 21-period HMA offers a more balanced view of price trends and identifies medium-term trends.
By crossing HMAs, traders can efficiently identify trend reversal points or strong market continuations.
Another feature of the indicator is the “fan” of dynamic lines, which acts as a visual float for price candles, allowing traders to quickly evaluate trading opportunities.
The "fan" or float of dynamic lines represents a visual representation of the candle's price movements. These lines extend from the start point to the end point, like an open fan. This visual approach makes the market dynamics immediately evident.
Strategy:
Long Entry Signal (Buy):
When the Hull Waves range shows a series of upward sloping lines and the Hull Moving Averages (e.g. 8-period HMA) crosses the 21-period HMA upwards, it is a long entry signal.
Confirmation of the signal can come from an increase in trader volume or other supporting indicators.
Place a buy order at the next closing price.
Short Entry Signal (Sell):
When the Hull Waves range shows a series of downward sloping lines and the Hull Moving Averages (e.g. 8-period HMA) crosses the 21-period HMA downward, it is a short entry signal.
Confirm the signal with an increase in trader volume or other relevant indicators.
Place a sell order at the next closing price.
Exit Signal (Closing a Position):
To close a long position, wait for a signal reversal, such as the Hull Moving Averages crossing downwards or a change in the Hull Waves range.
To close a short position, wait for a signal reversal, such as the Hull Moving Averages crossing higher or a change in the Hull Waves range.
[AIO] Multi Collection Moving Averages 140 MA TypesAll In One Multi Collection Moving Averages.
Since signing up 2 years ago, I have been collecting various Сollections.
I decided to get it into a decent shape and make it one of the biggest collections on TV, and maybe the entire internet.
And now I'm sharing my collection with you.
140 Different Types of Moving Averages are waiting for you.
Specifically :
"
AARMA | Adaptive Autonomous Recursive Moving Average
ADMA | Adjusted Moving Average
ADXMA | Average Directional Moving Average
ADXVMA | Average Directional Volatility Moving Average
AHMA | Ahrens Moving Average
ALF | Ehler Adaptive Laguerre Filter
ALMA | Arnaud Legoux Moving Average
ALSMA | Adaptive Least Squares
ALXMA | Alexander Moving Average
AMA | Adaptive Moving Average
ARI | Unknown
ARSI | Adaptive RSI Moving Average
AUF | Auto Filter
AUTL | Auto-Line
BAMA | Bryant Adaptive Moving Average
BFMA | Blackman Filter Moving Average
CMA | Corrected Moving Average
CORMA | Correlation Moving Average
COVEMA | Coefficient of Variation Weighted Exponential Moving Average
COVNA | Coefficient of Variation Weighted Moving Average
CTI | Coral Trend Indicator
DEC | Ehlers Simple Decycler
DEMA | Double EMA Moving Average
DEVS | Ehlers - Deviation Scaled Moving Average
DONEMA | Donchian Extremum Moving Average
DONMA | Donchian Moving Average
DSEMA | Double Smoothed Exponential Moving Average
DSWF | Damped Sine Wave Weighted Filter
DWMA | Double Weighted Moving Average
E2PBF | Ehlers 2-Pole Butterworth Filter
E2SSF | Ehlers 2-Pole Super Smoother Filter
E3PBF | Ehlers 3-Pole Butterworth Filter
E3SSF | Ehlers 3-Pole Super Smoother Filter
EDMA | Exponentially Deviating Moving Average (MZ EDMA)
EDSMA | Ehlers Dynamic Smoothed Moving Average
EEO | Ehlers Modified Elliptic Filter Optimum
EFRAMA | Ehlers Modified Fractal Adaptive Moving Average
EHMA | Exponential Hull Moving Average
EIT | Ehlers Instantaneous Trendline
ELF | Ehler Laguerre filter
EMA | Exponential Moving Average
EMARSI | EMARSI
EPF | Edge Preserving Filter
EPMA | End Point Moving Average
EREA | Ehlers Reverse Exponential Moving Average
ESSF | Ehlers Super Smoother Filter 2-pole
ETMA | Exponential Triangular Moving Average
EVMA | Elastic Volume Weighted Moving Average
FAMA | Following Adaptive Moving Average
FEMA | Fast Exponential Moving Average
FIBWMA | Fibonacci Weighted Moving Average
FLSMA | Fisher Least Squares Moving Average
FRAMA | Ehlers - Fractal Adaptive Moving Average
FX | Fibonacci X Level
GAUS | Ehlers - Gaussian Filter
GHL | Gann High Low
GMA | Gaussian Moving Average
GMMA | Geometric Mean Moving Average
HCF | Hybrid Convolution Filter
HEMA | Holt Exponential Moving Average
HKAMA | Hilbert based Kaufman Adaptive Moving Average
HMA | Harmonic Moving Average
HSMA | Hirashima Sugita Moving Average
HULL | Hull Moving Average
HULLT | Hull Triple Moving Average
HWMA | Henderson Weighted Moving Average
IE2 | Early T3 by Tim Tilson
IIRF | Infinite Impulse Response Filter
ILRS | Integral of Linear Regression Slope
JMA | Jurik Moving Average
KA | Unknown
KAMA | Kaufman Adaptive Moving Average & Apirine Adaptive MA
KIJUN | KIJUN
KIJUN2 | Kijun v2
LAG | Ehlers - Laguerre Filter
LCLSMA | 1LC-LSMA (1 line code lsma with 3 functions)
LEMA | Leader Exponential Moving Average
LLMA | Low-Lag Moving Average
LMA | Leo Moving Average
LP | Unknown
LRL | Linear Regression Line
LSMA | Least Squares Moving Average / Linear Regression Curve
LTB | Unknown
LWMA | Linear Weighted Moving Average
MAMA | MAMA - MESA Adaptive Moving Average
MAVW | Mavilim Weighted Moving Average
MCGD | McGinley Dynamic Moving Average
MF | Modular Filter
MID | Median Moving Average / Percentile Nearest Rank
MNMA | McNicholl Moving Average
MTMA | Unknown
MVSMA | Minimum Variance SMA
NLMA | Non-lag Moving Average
NWMA | Dürschner 3rd Generation Moving Average (New WMA)
PKF | Parametric Kalman Filter
PWMA | Parabolic Weighted Moving Average
QEMA | Quadruple Exponential Moving Average
QMA | Quick Moving Average
REMA | Regularized Exponential Moving Average
REPMA | Repulsion Moving Average
RGEMA | Range Exponential Moving Average
RMA | Welles Wilders Smoothing Moving Average
RMF | Recursive Median Filter
RMTA | Recursive Moving Trend Average
RSMA | Relative Strength Moving Average - based on RSI
RSRMA | Right Sided Ricker MA
RWMA | Regressively Weighted Moving Average
SAMA | Slope Adaptive Moving Average
SFMA | Smoother Filter Moving Average
SMA | Simple Moving Average
SSB | Senkou Span B
SSF | Ehlers - Super Smoother Filter P2
SSMA | Super Smooth Moving Average
STMA | Unknown
SWMA | Self-Weighted Moving Average
SW_MA | Sine-Weighted Moving Average
TEMA | Triple Exponential Moving Average
THMA | Triple Exponential Hull Moving Average
TL | Unknown
TMA | Triangular Moving Average
TPBF | Three-pole Ehlers Butterworth
TRAMA | Trend Regularity Adaptive Moving Average
TSF | True Strength Force
TT3 | Tilson (3rd Degree) Moving Average
VAMA | Volatility Adjusted Moving Average
VAMAF | Volume Adjusted Moving Average Function
VAR | Vector Autoregression Moving Average
VBMA | Variable Moving Average
VHMA | Vertical Horizontal Moving Average
VIDYA | Variable Index Dynamic Average
VMA | Volume Moving Average
VSO | Unknown
VWMA | Volume Weighted Moving Average
WCD | Unknown
WMA | Weighted Moving Average
XEMA | Optimized Exponential Moving Average
ZEMA | Zero Lag Moving Average
ZLDEMA | Zero-Lag Double Exponential Moving Average
ZLEMA | Ehlers - Zero Lag Exponential Moving Average
ZLTEMA | Zero-Lag Triple Exponential Moving Average
ZSMA | Zero-Lag Simple Moving Average
"
Don't forget that you can use any Moving Average not only for the chart but also for any of your indicators without affecting the code as in my example.
But remember that some MAs are not designed to work with anything other than a chart.
All MA and Code lists are sorted strictly alphabetically by short name (A-Z).
Each MA has its own number (ID) by which you can display the Moving Average you need.
Next to the ID selection there are tooltips with short names and their numbers. Use them.
The panel below will help you to read the Name of the selected MA.
Because of the size of the collection I think this is the optimal and most convenient use. Correct me if this is not the case.
Unknown - Some MAs I collected so long ago that I lost the full real name and couldn't find the authors. If you recognize them, please let me know.
I have deliberately simplified all MAs to input just Source and Length.
Because the collection is so large, it would be quite inconvenient and difficult to customize all MA functions (multipliers, offset, etc.).
If you need or like any MA you will still have to take it from my collection for your code.
I tried to leave the basic MA settings inside function in first strings.
I have tried to list most of the authors, but since the bulk of the collection was created a long time ago and was not intended for public publication I could not find all of them.
Some of the features were created from scratch or may have been slightly modified, so please be careful.
If you would like to improve this collection, please write to me in PM.
Also Credits, Likes, Awards, Loves and Thanks to :
@alexgrover
@allanster
@andre_007
@auroagwei
@blackcat1402
@bsharpe
@cheatcountry
@CrackingCryptocurrency
@Duyck
@ErwinBeckers
@everget
@glaz
@gotbeatz26107
@HPotter
@io72signals
@JacobAmos
@JoshuaMcGowan
@KivancOzbilgic
@LazyBear
@loxx
@LuxAlgo
@MightyZinger
@nemozny
@NGBaltic
@peacefulLizard50262
@RicardoSantos
@StalexBot
@ThiagoSchmitz
@TradingView
— 𝐀𝐧𝐝 𝐎𝐭𝐡𝐞𝐫𝐬 !
So just a Big Thank You to everyone who has ever and anywhere shared their codes.
G Channel with Arrows
1. Channel Calculation:
- The indicator calculates an upper channel ( `UpperBuffer` ) and a lower channel ( `LowerBuffer `) based on the input parameters `ChannelPeriod` .
- The channels are determined by a dynamic calculation that considers the current price ( `src` ) and the previous values of the upper and lower channels (` aBuffer` and `bBuffer` ).
2. Middle Channel:
- The middle channel ( `MiddleBuffer` ) is the average of the upper and lower channels, providing a central reference line.
3. Exponential Moving Average (EMA):
- The script calculates an Exponential Moving Average (`EMAValue`) based on the closing prices with a specified period (`EMAPeriod`).
4. Channel Plots:
- Plots for the upper, lower, and middle channels are displayed on the chart, each with a distinctive color and style.
5. Fill Between Channels:
- The space between the upper and middle channels is filled with a blue color (`#1900ff`), and the space between the lower and middle channels is filled with a red color (`#f70a0a`).
6. EMA Line:
- The EMA line is plotted on the chart in green.
7. Buy and Sell Signals:
- Buy signals ( `buySignal` ) are generated when the EMA crosses above the middle channel.
- Sell signals ( `sellSignal` ) are generated when the EMA crosses below the middle channel.
- Arrows are plotted at the respective locations of buy and sell signals.
8. Breakout Arrows:
- Additional arrows are plotted when the closing price breaks out above the upper channel (green arrow) or below the lower channel (red arrow).
9. User Input Parameters:
- Traders can customize the input parameters such as `ChannelPeriod` and `EMAPeriod` to adjust the sensitivity of the channels and the EMA.
Overall, the indicator provides traders with a visual representation of price channels, an EMA trend reference, and signals for potential buy/sell opportunities and breakout points. It can be used as part of a trading strategy to identify trends, reversals, and potential entry/exit points in the market.
Moving averages & clouds
Hi all!
This is a script that lets you have 3 moving averages (of a user defined type) and maybe have an alternative cloud (fill) between them. The cloud can be customized and turned on/off in the "style" tab for the indicator.
Alerts can be configured to fire on up/down/all crosses and are activated when the whole candle has crossed the morning average.
A higher time frame can be configured for the moving averages.
You can hide the moving average, but show the cloud:
You can have multiple clouds:
You can have moving averages from a higher time frame (here from weekly time frame on a daily chart):
Best of trading luck!
Fiboborsa+BistTitle: "Fiboborsa+Bist Indicator for TradingView"
Description: The "Fiboborsa+Bist" indicator is a powerful tool designed for TradingView users. This indicator offers a comprehensive set of technical indicators to assist you in your technical analysis and trading decisions.
Features:
Simple Moving Averages (SMA): You can enable or disable SMA with different periods (20, 50, 100, 200) to observe different timeframes and trends.
SMA Strategy: Use SMA crossovers to determine trends. Watch for the 20-period SMA crossing above the 50-period SMA for a bullish signal. For a bearish signal, observe the 50-period SMA crossing below the 100-period SMA.
Exponential Moving Averages (EMA): Similar to SMA, you can enable or disable EMA with different periods (5, 8, 14, 21, 34, 55, 89, 144, 233) for more precise trend analysis.
EMA Strategy: Use EMA crossovers and crossunders for short-term trend changes. A buy signal may occur when the 5-period EMA crosses above the 14-period EMA, while a crossunder suggests a selling opportunity.
Weighted Moving Averages (WMA): Customize WMA settings with various periods (5, 13, 21, 34, 89, 144, 233, 377, 610, 987) to suit your trading style.
WMA Strategy: Use WMA crossovers to verify trends. When the 13-period WMA crosses above the 34-period WMA, it may indicate an uptrend.
Buy and Sell Signals: The indicator provides buy and sell signals based on EMA crossovers and crossunders. Strong signals are also highlighted.
EMA Buy and Sell Strategy: Make informed trading decisions using buy and sell signals generated by EMA crossovers and crossunders.
Ichimoku Cloud: You can enable the Ichimoku Cloud for a clear visual representation of support and resistance levels.
Ichimoku Strategy: Use the Ichimoku Cloud to determine trend direction. Entering long positions is common when the price is above the cloud and considering short positions when it's below the cloud. Verify the trend with the Chikou Span.
Bollinger Bands: Easily visualize price volatility by enabling the Bollinger Bands feature.
Bollinger Bands Strategy: Bollinger Bands help you visualize price volatility. Look for potential reversal points when the price touches or crosses the upper or lower bands.
Use the "Fiboborsa+Bist" indicator to enhance your trading strategies and make informed decisions in the dynamic world of financial markets.
Additional Information:
Bollinger Bands: Bollinger Bands are a technical analysis tool used to monitor price volatility and determine overbought or oversold conditions. This indicator consists of three components:
Middle Moving Average (SMA): Typically, a 20-day SMA is used.
Upper Band: Calculated by adding two times the standard deviation to the SMA.
Lower Band: Calculated by subtracting two times the standard deviation from the SMA.
As the price moves between these two bands, it becomes possible to identify potential buying or selling points by comparing its height or low with these bands.
Ichimoku Cloud: The Ichimoku Cloud is a comprehensive indicator used for trend identification, defining support and resistance levels, and measuring trend strength. The Ichimoku Cloud comprises five key components:
Tenkan Sen (Conversion Line): Used to identify short-term trends.
Kijun Sen (Base Line): Used to identify medium-term trends.
Senkou Span A (Leading Span A): Calculated as (Tenkan Sen + Kijun Sen) / 2 and shows future support and resistance levels.
Senkou Span B (Leading Span B): Calculated as (highest high + lowest low) / 2 and indicates future support and resistance levels.
Chikou Span (Lagging Line): Enables tracking the price backward.
The Ichimoku Cloud interprets a price above the cloud as an uptrend and below the cloud as a downtrend. The Chikou Span assists in verifying the current trend.
ADDITIONAL STRATEGY WITH RSI AND MACD INDICATORS
**Strategy: Two-Stage Trading Strategy Using RSI, MACD, and Fiboborsa+Bist Indicators**
**Stage 1: Determining the Trend and Selecting the Trading Direction**
1. **Trend Identification with Fiboborsa+Bist Indicator:**
- Analyze the simple moving averages (SMA), exponential moving averages (EMA), and weighted moving averages (WMA) used with the Fiboborsa+Bist indicator. These indicators will provide information about the direction of the market trend.
2. **Identifying Overbought and Oversold Conditions with RSI:**
- Use the RSI indicator to identify overbought (70 and above) and oversold (30 and below) conditions. This helps in measuring the strength of the trend. If RSI enters the overbought zone, a downward correction is likely. If RSI enters the oversold zone, an upward correction is probable.
3. **Evaluating Momentum with MACD:**
- Examine price momentum using the MACD indicator. When the MACD line crosses above the signal line, it may indicate an increasing upward momentum. Conversely, a downward cross can suggest an increasing downward momentum.
**Stage 2: Generating Buy and Sell Signals**
4. **Combining RSI, MACD, and Fiboborsa+Bist Indicators:**
- To generate a buy signal, wait for RSI to move out of the oversold region into an uptrend and for the MACD line to cross above the signal line.
- To generate a sell signal, wait for RSI to move out of the overbought region into a downtrend and for the MACD line to cross below the signal line.
5. **Confirmation with Fiboborsa+Bist Indicator:**
- When you receive a buy or sell signal, use the Fiboborsa+Bist indicator to confirm the market trend. Confirming the trend can strengthen your trade signals.
6. **Setting Stop-Loss and Take-Profit Levels:**
- Remember to manage risk when opening buy or sell positions. Set stop-loss and take-profit levels to limit your risk.
7. **Monitor and Adjust Your Trades:**
- Continuously monitor your trade positions and adjust your strategy as per market conditions.
This two-stage trading strategy offers the ability to determine trends and generate trade signals using different indicators. However, every trading strategy involves risks, so risk management and practical application are essential. Also, it's recommended to test this strategy in a demo account before using it in a real trading account.
TMA Bands with Break Arrow @ClearTradingMind
The "TMA Bands with Break Arrow" indicator, developed by ClearTradingMind, is designed to provide traders with insights into potential trend reversals based on the movement of price within a channel defined by the Triangular Moving Average (TMA) and its bands. The TMA is a smoothed moving average, and this indicator adds upper and lower bands to visualize potential breakouts.
Key Components:
1. TMA Bands: The indicator plots the upper and lower bands of the TMA channel. These bands represent potential overbought (upper band) and oversold (lower band) conditions.
2. Break Arrows: The indicator generates buy (green triangle up) and sell (red triangle down) arrows when the closing price breaks above the upper band or below the lower band, indicating a potential trend reversal.
3. Background Color: The background color dynamically changes based on the last generated signal. A blue background suggests a recent buy signal, while a red background indicates a recent sell signal. This provides a quick visual reference for the prevailing market sentiment.
Usage:
1. Trend Reversals: Traders can use the buy and sell arrows as signals for potential trend reversals. A buy signal suggests a possible upward trend, while a sell signal suggests a potential downward trend.
2. Channel Breakouts: Watch for price breaking above the upper band (buy signal) or below the lower band (sell signal). These breakouts may indicate the start of a new trend.
3. Volatility Analysis: The width of the TMA channel represents volatility. A widening channel suggests increased volatility, while a narrowing channel suggests decreasing volatility.
4. Background Color: The background color provides additional context. A blue background indicates recent bullish sentiment, while a red background suggests recent bearish sentiment.
Parameters:
- TMA Period: The number of bars used to calculate the Triangular Moving Average.
- ATR Period: The number of bars used to calculate the Average True Range (ATR) for determining the width of the TMA channel.
- ATR Multiplier: A multiplier applied to the ATR to determine the width of the TMA channel.
Note: This indicator is a tool to assist traders in their analysis, and it is recommended to use it in conjunction with other technical and fundamental analysis methods for more comprehensive decision-making.
Disclaimer: Trading involves risk, and this indicator does not guarantee profit. Users should conduct thorough analysis and risk management before making trading decisions.
Crossover EMMMCrossover EMMM is an indicator that displays the Madrid Moving Averages (EMMM) and detects crossovers (upward crossings) and crossunders (downward crossings) between two moving averages. It uses two input parameters to define the fast and slow EMMM lengths. The script calculates the EMMM values, their changes, and assigns colors based on the change direction. The fast EMMM is plotted in green or red, and the slow EMMM is plotted in blue or red, depending on the change direction. The script also displays triangle shapes below or above the bars to indicate crossovers and crossunders.
The "Madrid Moving Average" (EMMMM) is a type of moving average used in technical analysis to smooth price fluctuations of financial assets, such as stocks or currency pairs. Unlike the Simple Moving Average (SMA), which treats all data equally, the EMMM gives more weight to recent data. This results in the EMMM responding more swiftly to price changes, making it well-suited for identifying short-term trends.
TTP Pair Slope/HedgePair slope/hedge uses linear regression to calculate the hedge ratio (slope) between the two assets within a period.
It allows you to specify a "from" and a "to" candle.
Example:
"A regression from 1000 candles back in time and ignore the last 100 candles. This would result in making a regression of 900 candles in total."
The formula used to perform the regression with the assts X and Y is:
Hedge =
mean( (X-mean(X))^2 )
——————————————————
mean( (X-mean(X)) * (Y-mean(Y)) )
You can later use the hedge in a chart of X - Hedge * Y
(Confirm with 1 / hedge )
If the plot is stationary the period tested should look like stationary.
If you cross an imaginary horizontal line across all the values in the period used it should look like a flat channel with values crossing above and below the line.
The purpose of this indicator is to help finding the linear regression test used for conintegration analysis. Conintegration assets is one of the requirements to consider assets for pair and hedge trading.
Highlight BarHighlight bars in the past. I use this to show the start of moving average calculations - very helpful to anticipate the change in slope of moving averages. You can change color as well as how far back in time to highlight. The defaults are 20, 50 and 200.
I learned of the idea from Brian Shannon - thanks!
9-20 sma multi timeframe indicatorThis is an indicator to help visualizing the 9 and the 20 sma on 3 different timeframes.
When they cross, you will see a cross on the band representing the timeframe.
When a trade is favorable the band will color in green for up trend and in red for downtrend:
- Conditions in uptrend: Start after the first green candle closed above the 9 sma, Stop after the first red candle closed under the 9 sma
- Conditions in downtrend: Start after the first red candle closed below the 9 sma, Stop after the first green candle closed above the 9 sma
Machine Learning: Trend Lines [YinYangAlgorithms]Trend lines have always been a key indicator that may help predict many different types of price movements. They have been well known to create different types of formations such as: Pennants, Channels, Flags and Wedges. The type of formation they create is based on how the formation was created and the angle it was created. For instance, if there was a strong price increase and then there is a Wedge where both end points meet, this is considered a Bull Pennant. The formations Trend Lines create may be powerful tools that can help predict current Support and Resistance and also Future Momentum changes. However, not all Trend Lines will create formations, and alone they may stand as strong Support and Resistance locations on the Vertical.
The purpose of this Indicator is to apply Machine Learning logic to a Traditional Trend Line Calculation, and therefore allowing a new approach to a modern indicator of high usage. The results of such are quite interesting and goes to show the impacts a simple KNN Machine Learning model can have on Traditional Indicators.
Tutorial:
There are a few different settings within this Indicator. Many will greatly impact the results and if any are changed, lots will need ‘Fine Tuning’. So let's discuss the main toggles that have great effects and what they do before discussing the lengths. Currently in this example above we have the Indicator at its Default Settings. In this example, you can see how the Trend Lines act as key Support and Resistance locations. Due note, Support and Resistance are a relative term, as is their color. What starts off as Support or Resistance may change when the price crosses over / under them.
In the example above we have zoomed in and circled locations that exhibited markers of Support and Resistance along the Trend Lines. These Trend Lines are all created using the Default Settings. As you can see from the example above; just because it is a Green Upwards Trend Line, doesn’t mean it’s a Support Line. Support and Resistance is always shifting on Trend Lines based on the prices location relative to them.
We won’t go through all the Formations Trend Lines make, but the example above, we can see the Trend Lines formed a Downward Channel. Channels are when there are two parallel downwards Trend Lines that are at a relatively similar angle. This means that they won’t ever meet. What may happen when the price is within these channels, is it may bounce between the upper and lower bounds. These Channels may drive the price upwards or downwards, depending on if it is in an Upwards or Downwards Channel.
If you refer to the example above, you’ll notice that the Trend Lines are formed like traditional Trend Lines. They don’t stem from current Highs and Lows but rather Machine Learning Highs and Lows. More often than not, the Machine Learning approach to Trend Lines cause their start point and angle to be quite different than a Traditional Trend Line. Due to this, it may help predict Support and Resistance locations at are more uncommon and therefore can be quite useful.
In the example above we have turned off the toggle in Settings ‘Use Exponential Data Average’. This Settings uses a custom Exponential Data Average of the KNN rather than simply averaging the KNN. By Default it is enabled, but as you can see when it is disabled it may create some pretty strong lasting Trend Lines. This is why we advise you ZOOM OUT AS FAR AS YOU CAN. Trend Lines are only displayed when you’ve zoomed out far enough that their Start Point is visible.
As you can see in this example above, there were 3 major Upward Trend Lines created in 2020 that have had a major impact on Support and Resistance Locations within the last year. Lets zoom in and get a closer look.
We have zoomed in for this example above, and circled some of the major Support and Resistance locations that these Upward Trend Lines may have had a major impact on.
Please note, these Machine Learning Trend Lines aren’t a ‘One Size Fits All’ kind of thing. They are completely customizable within the Settings, so that you can get a tailored experience based on what Pair and Time Frame you are trading on.
When any values are changed within the Settings, you’ll likely need to ‘Fine Tune’ the rest of the settings until your desired result is met. By default the modifiable lengths within the Settings are:
Machine Learning Length: 50
KNN Length:5
Fast ML Data Length: 5
Slow ML Data Length: 30
For example, let's toggle ‘Use Exponential Data Averages’ back on and change ‘Fast ML Data Length’ from 5 to 20 and ‘Slow ML Data Length’ from 30 to 50.
As you can in the example above, all of the lines have changed. Although there are still some strong Support Locations created by the Upwards Trend Lines.
We will conclude our Tutorial here. Hopefully you’ve learned how to use Machine Learning Trend Lines and will be able to now see some more unorthodox Support and Resistance locations on the Vertical.
Settings:
Use Machine Learning Sources: If disabled Traditional Trend line sources (High and Low) will be used rather than Rational Quadratics.
Use KNN Distance Sorting: You can disable this if you wish to not have the Machine Learning Data sorted using KNN. If disabled trend line logic will be Traditional.
Use Exponential Data Average: This Settings uses a custom Exponential Data Average of the KNN rather than simply averaging the KNN.
Machine Learning Length: How strong is our Machine Learning Memory? Please note, when this value is too high the data is almost 'too' much and can lead to poor results.
K-Nearest Neighbour (KNN) Length: How many K-Nearest Neighbours are allowed with our Distance Clustering? Please note, too high or too low may lead to poor results.
Fast ML Data Length: Fast and Slow speed needs to be adjusted properly to see results. 3/5/7 all seem to work well for Fast.
Slow ML Data Length: Fast and Slow speed needs to be adjusted properly to see results. 20 - 50 all seem to work well for Slow.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
LBR-Volatility Breakout BarsThe originator of this script is Linda Raschke of LBR Group.
This Pine Script code is the version 5 of LBR Paintbars for TradingView, called "LBR-Bars." It was originally coded for TradingView in version 3 by LazyBear. It is a complex indicator that combines various features such as coloring bars based on different conditions, displaying Keltner channels, and showing volatility lines.
Let me break down the key components and explain how it works:
1. Inputs Section: This section defines various input parameters that users can adjust when adding the indicator to their charts. These parameters allow users to customize the behavior and appearance of the indicator. Here are some of the key input parameters:
- Users can control whether to color bars under different conditions. For example,
they can choose to color LBR bars, color bars above/below Kelts, or color non-LBR
bars.
- Users can choose whether to show volatility lines or shade Keltner channels' area
with the Mid being the moving average on the chart.
- In the calculation of Keltner channels, users can set the length of the moving
average that the Keltner channels use as the mid and then set the Keltner multiplier.
If users want to use "True Range" to determine calculations, they can turn it on or
off; it defaults to off.
- Users can change the calculation of volatility lines and set the length for finding the
lowest and highest prices. The user sets the ATR length and multiplier for the ATR.
2. Calculation Section: This section defines the calculation of the upper and lower standard deviation bands based on the input parameters. It uses Exponential Moving Averages (EMAs) and optionally True Range to calculate these bands if turned on. These bands are used in the Keltner channel calculation.
3. Keltner Channel Section: This section calculates the upper, middle, and lower lines of the Keltner channels. It also plots these lines on the chart. The colors and visibility of these lines are controlled by user inputs.
4. Volatility Lines Section: This section calculates the upper and lower volatility lines based on the lowest and highest prices over a specified period and the ATR. It also checks whether the current close price is above or below these lines accordingly. The colors and visibility of these lines are controlled by user inputs.
5. Bar Colors Section: This section determines the color of the bars on the chart based on various conditions. It checks whether the current bar meets conditions like being an LBR bar, being above or below volatility lines, or being in "No Man's Land." The color of the bars is set accordingly based on user inputs.
This Pine Script creates an indicator that provides visual cues on the chart based on Keltner channels, volatility lines, and other customizable conditions. Users can adjust the input parameters to tailor the indicator's behavior and appearance to their trading preferences.
Grospector DCA V.4This is system for DCA with strategy and can trade on trend technique "CDC Action Zone".
We upgrade Grospector DCA V.3 by minimizing unnecessary components and it is not error price predictions.
This has 5 zone Extreme high , high , normal , low , Extreme low. You can dynamic set min - max percent every zone.
Extreme zone is derivative short and long which It change Extreme zone to Normal zone all position will be closed.
Every Zone is splitted 10 channel. and this strategy calculate contribution.
and now can predict price in future.
Idea : Everything has average in its life. For bitcoin use 4 years for halving. I think it will be interesting price.
Default : I set MA is 365*4 days and average it again with 365 days.
Input :
len: This input represents the length of the moving average.
strongLen: This input represents the length of the moving average used to calculate the strong buy and strong sell zone.
shortMulti: This input represents the multiplier * moveing average used to calculate the short zone.
strongSellMulti: This input represents the multiplier used to calculate the strong sell signal.
sellMulti: This input represents the multiplier * moveing average used to calculate the sell zone.
strongBuyMulti: This input represents the multiplier used to calculate the strong sell signal.
longMulti: This input represents the multiplier * moveing average used to calculate the long zone.
*Diff sellMulti and strongBuyMulti which is normal zone.
useDerivative: This input is a boolean flag that determines whether to use the derivative display zone. If set to true, the derivative display zone will be used, otherwise it will be hidden.
zoneSwitch: This input determines where to display the channel signals. A value of 1 will display the signals in all zones, a value of 2 will display the signals in the chart pane, a value of 3 will display the signals in the data window, and a value of 4 will hide the signals.
price: Defines the price source used for the indicator calculations. The user can select from various options, with the default being the closing price.
labelSwitch: Defines whether to display assistive text on the chart. The user can select a boolean value (true/false), with the default being true.
zoneSwitch: Defines which areas of the chart to display assistive zones. The user can select from four options: 1 = all, 2 = chart only, 3 = data only, 4 = none. The default value is 2.
predictFuturePrice: Defines whether to display predicted future prices on the chart. The user can select a boolean value (true/false), with the default being true.
DCA: Defines the dollar amount to use for dollar-cost averaging (DCA) trades. The user can input an integer value, with a default value of 5.
WaitingDCA: Defines the amount of time to wait before executing a DCA trade. The user can input a float value, with a default value of 0.
Invested: Defines the amount of money invested in the asset. The user can input an integer value, with a default value of 0.
strategySwitch: Defines whether to turn on the trading strategy. The user can select a boolean value (true/false), with the default being true.
seperateDayOfMonth: Defines a specific day of the month on which to execute trades. The user can input an integer value from 1-31, with the default being 28.
useReserve: Defines whether to use a reserve amount for trading. The user can select a boolean value (true/false), with the default being true.
useDerivative: Defines whether to use derivative data for the indicator calculations. The user can select a boolean value (true/false), with the default being true.
useHalving: Defines whether to use halving data for the indicator calculations. The user can select a boolean value (true/false), with the default being true.
extendHalfOfHalving: Defines the amount of time to extend the halving date. The user can input an integer value, with the default being 200.
Every Zone: It calculate percent from top to bottom which every zone will be splited 10 step.
To effectively make the DCA plan, I recommend adopting a comprehensive strategy that takes into consideration your mindset as the best indicator of the optimal approach. By leveraging your mindset, the task can be made more manageable and adaptable to any market
Dollar-cost averaging (DCA) is a suitable investment strategy for sound money and growth assets which It is Bitcoin, as it allows for consistent and disciplined investment over time, minimizing the impact of market volatility and potential risks associated with market timing