ATR Range Pivot LinesDescription:
This Pine Script calculates and plots pivot lines based on ATR (Average True Range) value and closing price. It uses the previous trading day's ATR value to set static pivot levels for the current trading day. These pivot lines help traders identify potential support and resistance levels based on historical volatility. The script includes two main pivot lines—ATR High and ATR Low —and two midpoint lines between them for additional context. Labels are added to show the exact pivot values, with options to customize label positions.
Intended Use:
The script is designed to help traders forecast potential price ranges for the current trading day based on the previous day’s volatility. By adding and subtracting the previous day's ATR from the prior close, the script identifies key levels where price action may encounter support or resistance. It is useful for setting realistic price targets or entry/exit points. Since the ATR-based pivot lines are static for the entire day, they provide a reliable range for intraday trading strategies.
Disclosure:
This script was generated using AI. It is recommended to review and test the script thoroughly before applying it in live trading scenarios.
Entrysignal
Gaussian Filter [BigBeluga]The Gaussian Filter - BigBeluga indicator is a trend-following tool that uses a Gaussian filter to smooth price data and identify directional shifts in the market. It provides dynamic signals for entering and exiting trades based on trend changes, helping traders stay aligned with the market's momentum. What sets this indicator apart is its ability to display precise entry and exit points with real-time tracking of percentage price changes, making it ideal for trend-based strategies.
SP500:
NIFTY50:
🔵 KEY FEATURES & USAGE
◉ Gaussian Filter Trend Line:
//@function GaussianFilter is used for smoothing, reducing noise, and computing derivatives of data.
//@param src (float) The source data (e.g., close price) to be smoothed.
//@param params (GaussianFilterParams) Gaussian filter parameters that include length and sigma.
//@returns (float) The smoothed value from the Gaussian filter.
gaussian_filter(float src, params) =>
var float weights = array.new_float(params.length) // Array to store Gaussian weights
total = 0.0
pi = math.pi
for i = 0 to params.length - 1
weight = math.exp(-0.5 * math.pow((i - params.length / 2) / params.sigma, 2.0))
/ math.sqrt(params.sigma * 2.0 * pi)
weights.set(i, weight)
total := total + weight
for i = 0 to params.length - 1
weights.set(i, weights.get(i) / total)
sum = 0.0
for i = 0 to params.length - 1
sum := sum + src * weights.get(i)
sum
The core functionality of the Gaussian Filter line is to show trend direction. When the trend line increases four times consecutively, it indicates an uptrend signal. Similarly, if it decreases four times in a row, it signals a downtrend. The smoothness of the filter helps traders stay on the right side of the market by filtering out noise and emphasizing the dominant trend direction.
◉ Entry and Exit Levels with Real-Time Price and Performance Data:
Each time the indicator detects a trend change, it plots an entry or exit level on the chart. For an uptrend, an entry level is marked, and for a downtrend, an exit level is plotted. These levels display the price at the time of the signal.
While the trend is ongoing, the indicator tracks the percentage change in price from the initial entry or exit signal to the current bar, updating in real-time. When a trend concludes, it displays the total percentage change from the entry or exit point to the trend's end. This feature provides valuable insights into how much the price has moved during each trend phase and allows traders to monitor the performance of each trade.
◉ Color-Coded Candlestick Representation with Trend Shift Alerts:
In addition to coloring the candlesticks based on the trend direction, the indicator also uses gray candles to highlight potential early trend shifts. For example, if the Gaussian Filter detects a downtrend but the price moves above the filter line, the candles turn gray, signaling a possible reversal or shift in momentum. Similarly, in an uptrend, if the price moves below the Gaussian Filter line, the candles turn gray as an early indication of potential bearish momentum. This visual cue helps traders stay alert to possible faster shifts in market direction, allowing for quicker decision-making.
🔵 CUSTOMIZATION
Length and Sigma for Gaussian Filter:
Adjust the length and sigma parameters to control how the Gaussian Filter smooths the price data. A longer length provides smoother trend lines, while adjusting sigma can fine-tune the level of smoothing applied.
Levels Display and Candle Coloring:
You can toggle the visibility of entry and exit levels as well as enable or disable the dynamic coloring of candlesticks based on the trend direction. The additional gray color setting provides an extra layer of information, allowing you to spot potential trend reversals early.
🔵 CONCLUSION
The Gaussian Filter indicator is a powerful tool for identifying and following market trends. By providing clear entry and exit signals, along with real-time tracking of price changes, it gives traders a structured way to manage trades and monitor performance. The color-coded candles, including gray to highlight possible trend shifts, add another dimension to visualizing market dynamics. The added flexibility of customizing colors and trend levels makes it a versatile indicator suitable for both trend-following and reversal strategies.
Johnny's Moving Average RibbonProps to Madrid for creating the original script: Madrid Moving Average Ribbon.
All I did was upgrade it to pinescript v5 and added a few changes to the script.
Features and Functionality
Moving Average Types: The indicator offers a choice between exponential moving averages (EMAs) and simple moving averages (SMAs), allowing users to select the type that best fits their trading strategy.
Dynamic Color Coding: Each moving average line within the ribbon changes color based on its direction and position relative to a reference moving average, providing visual cues for market sentiment and trend strength.
Lime Green: Indicates an uptrend and potential long positions, shown when a moving average is rising and above the longer-term reference MA.
Maroon: Suggests caution for long positions or potential short reentry points, displayed when a moving average is rising but below the reference MA.
Ruby Red: Represents a downtrend, suitable for short positions, shown when a moving average is falling and below the reference MA.
Green: Signals potential reentry points for downtrends or warnings for uptrend reversals, displayed when a moving average is falling but above the reference MA.
Usage and Application
Trend Identification: Traders can quickly ascertain the market's direction at a glance by observing the predominant color of the ribbon and its orientation.
Trade Entry and Exit Points: The color transitions within the ribbon can signal potential entry or exit points, with changes from green to lime or red to maroon indicating shifts in market momentum.
Customization: Users have the flexibility to toggle between exponential and simple moving averages, allowing for a tailored analytical approach that aligns with their individual trading preferences.
Technical Specifications
The ribbon consists of multiple moving averages calculated over different periods, typically ranging from shorter to longer-term intervals to capture various aspects of market behavior.
The color dynamics are determined by comparing each moving average to a reference point, often a longer-term moving average within the ribbon, to assess the relative trend strength and direction.
Entry FraggerEntry Fragger is a simple buy signal indicator.
It is most suitable for cryptocurrency, especially for altcoins on the 5 minute to daily timeframe and is based on simple volume calculations, in combination with EMA's.
Main Signal Logic explained:
A buy signal is generated by counting candles with an above average sell volume of 130% to 170%, taking into account the candles position below and above the 50 and 200 EMA.
If criteria meet, the first green candle above the 50 EMA's suggests upcoming higher prices.
The indicator has 2 input variables.
"Signal Confirmations (0 - 7):" Changes signal accuracy by a defining an ammount of high sell volume candles necessary below the 50 EMA.
"Volume Calculation Base (9 - 200):" Sets the exponential volume multiplier, this affects candle coloring and the volume calculation inside the candle.
"Style Settings": Turn ON/OFF Signals, Cloud, Bar Coloring, EMA's, etc...
There are no generally suitable default numbers for those 2 inputs, those have to be tested out, depending on cryptocurrency and timeframe.
The calculation is very basic, the underlying idea being, market maker initiating range breakouts through rapid increase of volume above or below the EMA's .
Example settings:
SOLUSDT: Signal Confirmations: 2, Volume Calculation Base 13.
SOLUSDT: Signal Confirmations: 0, Volume Calculation Base 20.
As you can see it affects signals quite a lot, but staying accurate.
Finetune the inputs to your preference.
Risk to Reward, Stoploss, Take Profit, position sizing, etc... is up to the user.
Recommended entry is to wait for following candle closes, entering half of the candle size and setting Stoploss outside the structure, like this:
Or right below the candles open, for safety.
Three-Day Rolling PivotThe three-day rolling pivot is another pivot concept,
which may be used by intermediate positions, for several days or even weeks.
It can be utilized in many ways, such as to determine an entry point or trailing stop.
As the name suggests, this pivot is based on the last three days.
I learned this concept of the book "The logical Trader" by Mark Fisher.
Kudos go to him!
My version of the Three-Day Rolling Pivot uses actual data!
And all similar scripts I have found so far calculate future data and don't take into account the original data.
I hope this script will help some people to do some better decisions.
And I am pleased to get some advice to make this script even better!
Future data vs original data
Pine Script v5 Reference Manual:
Merge strategy for the requested data position... This merge strategy can lead to undesirable effect of getting data from "future" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators.
e2e4 on Stack Overflow said:
Pine v1-v2's security() function is using the lookahead parameter by default, which could be modified in v3-v5...
stackoverflow.com
I haven't found a script which put this into account jet.
I leave this option available for people that wanna more speculated data. But it's disabled by default.
Long/Short Example
You can enter Long when the market cross over the upper line (default color is green) and you should put your trailing stop 1-5 ticks below the lower line (default color is red).
The opposite when Shorting, then the market has to cross down the lower line and your trailing stop should be 1-5 ticks above the upper line.
How does this script work:
First it fetches the highest high of ...
yesterday,
the day before yesterday,
and the day before that.
After that the script looks for the highest high of all three.
Next it does the same for previous lowest low.
Last but not least, it fetches the closing price of the last day.
After that it adds all three prices together and divide them by three.
This result in a three day pivot price.
Then it adds the highest high and lowest low of the three last days and divide it by two.
This gives us the second number we need to calculate the differential.
The differential is the gap between the three day pivot price and the second number.
Sometimes the second number is bigger than the three day pivot price so I took that into account too. Other wise the colors plotted would be on the wrong site.
Finally, the script is rounding the numbers to the nearest minimum tick of that security.
Consolidated IndicatorI have attempted to combine all the parameters to decide on the entry and exit points for stocks. The indicator combines
1) EMAs
2)PSAR
3)ATR
The script also attempts to show the risk-reward
[Old] TL with K/K and CustomizationThe old version of Trap Light before the most recent update. In order to facilitate the table functionality that is currently available for Trap Light, I had to make some values that are used in calculations hard-coded. By request, I'm quickly making this version available.
Trap Light
Description
Trap Light is an indicator that uses the K value of the Stochastic RSI to indicate potential long or short entries. It was designed to operate like a traffic stop light that is displayed near the current candle so that you don't have to look away from the candlesticks while trading.
Kriss/Kross is simply a cross over/under strategy that utilizes the 10 EMA and the 50 EMA .
Signals and Available Alerts:
1. Max Sell (Red Sell Label)
When K is equal to 100.00.
This is the strongest sell signal, remember that you only need to make sure that the trend is reversing before you make an entry, because several of these signals can appear in a row if a strong trend hasn't yet reversed.
2. Sell (Red Sell Label)
When K is equal to or greater than 99.50.
A sell signal.
3. Close to Sell (Red Down Arrow)
When K is equal to or greater than 95.00.
A sell signal may be produced soon.
4. Not Ready (Yellow Circle)
When K is less than 95 and greater than 5.00.
This indicates that neither a sell nor buy signal are close to being produced.
5. Close to Buy (Green Up Arrow)
When K is equal to or less than 5.00.
A buy signal may be produced soon.
6. Buy (Green Buy Label)
When K is equal to or less than 0.50 and greater than 0.00.
A buy signal.
7. Max Buy (Green Buy Label)
When K is equal to 0.00.
Strongest buy signal, remember to make sure that the trend is reversing before making an entry.
8. Kriss (Buy)
A buy signal when the 10 EMA (Blue) crosses above the 50 EMA (Yellow). This is also illustrated by the triggering candle being colored blue.
9. Kross (Sell)
A sell signal when the 10 EMA (Blue) crosses below the 50 EMA (Yellow). This is also illustrated by the triggering candle being colored yellow.
Customization of many different options is available, and the code is open-source for your reference, etc.
Remember to do you own due diligence and feel free to leave a comment with questions, etc.
10 EMA StrategyThis indicator shows you:
- The first bullish candle to close below EMA 10
- The first bearish candle to close above EMA 10.
Optional:
You can enable the exit signals in the setting. This will show you:
- If you are long (bullish), it will signal when the first bullish candle closes below EMA 10
- If you are short (bearish), it will signal when the first bearish candle closes above EMA 10
You can also change the EMA 10, to another length, if you want to try something else.
SNAP BACK 2.0 Strategy
This strategy is designed to allow you to catch the bounce or "SNAP Back" of an equity that has been in a trend.
1) Once the moving averages are in the order of 200SMA > 50 SMA > 34EMA > 20SMA > 8EMA (or reverse for and uptrend), the strategy is setup.
2) Next you wait for a trigger of the closing price crossing the 8EMA, while there is a desired gap size between the 8EMA and the 20SMA (2-10% of stock value preferred).
3) Exit position based on target profit reached (conservative sell half at 34EMA and engage a trailing stop loss for remainder or set static limit) or price crosses 8EMA or stop loss%
*)This code also allows you to determine your desired backtesting date compliments of alanaster
This code is the product of many hours of hard work on the part of the greater tradingview community. The credit goes to everyone in the community who has put code out there for the greater good.
The idea for the coding came from a video I watched on YouTube presented by TradeStation called Snap Back - thank you guys for the inspiration.
UPDATE: I have coded the other side of the strategy to allow you to take advantage of the same set-up in an uptrend for Short plays. You can turn the up or downsides on, off, or both.
The main intent is to catch the bounces of a falling stock. However, I have found that you can do the inverse and catch the drops in a rising stock (the latter is not as reliable). This also tends to work better on less volatile stocks. I have included a large volume of user defined conditions and display entry and exit conditions on the chart to see how your choices are impacting the script.
Forex Scalp Triggersthe triggers only work to tell you go back 5 candles on 5 min, take either lowest or highest plus 3 pips and make entry and go 3 pip over under trigger for stop loss. can take half profit at 1x and move stop to break even and go 1x more for take rest profit, or create a trailing stop loss on Take Profit level 2 and ride the trend.
1 Hour chart has to be over under the emas that are faned out nicely to move to 5 min chart to look for the signals if 1hr chart isnt over under the emas nicely then NO TRADE
ForexSignalTV helped create this strategy, just my first script so learning, want to take it to next level but kind of stuck for now. More knowledge coming...
SSL Crossover + MA choiceThis indicator builds on the SSL channel code by ErwinBeckers @
I have added options for diff MA's to be used in the SSL channel and crossover indicators for buy/sell signals
default MA is set to Arnaud Legaux, but you can set it to whatever you like - original was a Simple Moving Average by ErwinBeckers
The indicator will not repaint as the signals are drawn after close of crossover candles
Let me know if you have any suggestions - happy to add more functionality
Double TRIX CrossoverTRIX is a great indicator to use on zero cross setups.... know what's even better? TRIX CROSS setups!!!
Faster in-and-out on trends, safer entry and exit signals in chop or consolidation. Base setup is 6 & 8 TRIX for longer time frames such as 4hr or 8hr; ideal or FX, Crypto, or volatile instruments. I haven't experimented with using this on lower time charts and adjusting the trix settings; if you do, drop a comment.
Mirror MACD by Trader JayThis is my take on the metatrader indicator, the mirror macd. Works pretty good on Forex, haven't tested on anything else
Enter long after the Blue Line Cross Up the Red Line and EXIT after the Green line Cross Up the Red Line (above the Blue Line).
For the opposite position : ENTER SELL after the Red Line Cross Down.
Generalized SSL by Vts// Generalized SSL:
// This is the very first time the SSL indicator, whose acronym I ignore, is on Tradingview.
// It is based on moving averages of the highs and lows.
// Similar channel indicators can be found, whereas
// this one implements the persistency inside the channel, which is rather tricky.
// The green line is the base line which decides entries and exits, possibly with trailing stops.
// With respect to the original version, here one can play with different moving averages.
// The default settings are (10,SMA)
//
// Vitelot/Yanez/Vts March 2019