Dual Strategy Selector V2 - CryptogyaniOverview:
This script provides traders with a dual-strategy system that they can toggle between using a simple dropdown menu in the input settings. It is designed to cater to different trading styles and needs, offering both simplicity and advanced filtering techniques. The strategies are built around moving average crossovers, enhanced by configurable risk management tools like take profit levels, trailing stops, and ATR-based stop-loss.
Key Features:
Two Strategies in One Script:
Strategy 1: A classic moving average crossover strategy for identifying entry signals based on trend reversals. Includes user-defined take profit and trailing stop-loss options for profit locking.
Strategy 2: An advanced trend-following system that incorporates:
A higher timeframe trend filter to confirm entry signals.
ATR-based stop-loss for dynamic risk management.
Configurable partial take profit to secure gains while letting the trade run.
Highly Customizable:
All key parameters such as SMA lengths, take profit levels, ATR multiplier, and timeframe for the trend filter are adjustable via the input settings.
Dynamic Toggle:
Traders can switch between Strategy 1 and Strategy 2 with a single dropdown, allowing them to adapt the strategy to market conditions.
How It Works:
Strategy 1:
Entry Logic: A long trade is triggered when the fast SMA crosses above the slow SMA.
Exit Logic: The trade exits at either a user-defined take profit level (percentage or pips) or via an optional trailing stop that dynamically adjusts based on price movement.
Strategy 2:
Entry Logic: Builds on the SMA crossover logic but adds a higher timeframe trend filter to align trades with the broader market direction.
Risk Management:
ATR-Based Stop-Loss: Protects against adverse moves with a volatility-adjusted stop-loss.
Partial Take Profit: Allows traders to secure a percentage of gains while keeping some exposure for extended trends.
How to Use:
Select Your Strategy:
Use the dropdown in the input settings to choose Strategy 1 or Strategy 2.
Configure Parameters:
Adjust SMA lengths, take profit, and risk management settings to align with your trading style.
For Strategy 2, specify the higher timeframe for trend filtering.
Deploy and Monitor:
Apply the script to your preferred asset and timeframe.
Use the backtest results to fine-tune settings for optimal performance.
Why Choose This Script?:
This script stands out due to its dual-strategy flexibility and enhanced features:
For beginners: Strategy 1 provides a simple yet effective trend-following system with minimal setup.
For advanced traders: Strategy 2 includes powerful tools like trend filters and ATR-based stop-loss, making it ideal for challenging market conditions.
By combining simplicity with advanced features, this script offers something for everyone while maintaining full transparency and user customization.
Default Settings:
Strategy 1:
Fast SMA: 21, Slow SMA: 49
Take Profit: 7% or 50 pips
Trailing Stop: Optional (disabled by default)
Strategy 2:
Fast SMA: 20, Slow SMA: 50
ATR Multiplier: 1.5
Partial Take Profit: 50%
Higher Timeframe: 1 Day (1D)
Simplemovingaverages
Simple Moving Average with Regime Detection by iGrey.TradingThis indicator helps traders identify market regimes using the powerful combination of 50 and 200 SMAs. It provides clear visual signals and detailed metrics for trend-following strategies.
Key Features:
- Dual SMA System (50/200) for regime identification
- Colour-coded candles for easy trend visualisation
- Metrics dashboard
Core Signals:
- Bullish Regime: Price < 200 SMA
- Bearish Regime: Price > 200 SMA
- Additional confirmation: 50 SMA Cross-over or Cross-under (golden cross or death cross)
Metrics Dashboard:
- Current Regime Status (Bull/Bear)
- SMA Distance (% from price to 50 SMA)
- Regime Distance (% from price to 200 SMA)
- Regime Duration (bars in current regime)
Usage Instructions:
1. Apply the indicator to your chart
2. Configure the SMA lengths if desired (default: 50/200)
3. Monitor the color-coded candles:
- Green: Bullish regime
- Red: Bearish regime
4. Use the metrics dashboard for detailed analysis
Settings Guide:
- Length: Short-term SMA period (default: 50)
- Source: Price calculation source (default: close)
- Regime Filter Length: Long-term SMA period (default: 200)
- Regime Filter Source: Price source for regime calculation (default: close)
Trading Tips:
- Use bullish regimes for long positions
- Use bearish regimes for capital preservation or short positions
- Consider regime duration for trend strength
- Monitor distance metrics for potential reversals
- Combine with other systems for confluence
#trend-following #moving average #regime #sma #momentum
Risk Management:
- Not a standalone trading system
- Should be used with proper position sizing
- Consider market conditions and volatility
- Always use stop losses
Best Practices:
- Monitor multiple timeframes
- Use with other confirmation tools
- Consider fundamental factors
Version: 1.0
Created by: iGREY.Trading
Release Notes
// v1.1 Allows table overlay customisation
// v1.2 Update to v6 pinescript
S&P Short-Range Oscillator**SHOULD BE USED ON THE S&P 500 ONLY**
The S&P Short-Range Oscillator (SRO), inspired by the principles of Jim Cramer's oscillator, is a technical analysis tool designed to help traders identify potential buy and sell signals in the stock market, specifically for the S&P 500 index. The SRO combines several market indicators to provide a normalized measure of market sentiment, assisting traders in making informed decisions.
The SRO utilizes two simple moving averages (SMAs) of different lengths: a 5-day SMA and a 10-day SMA. It also incorporates the daily price change and market breadth (the net change of closing prices). The 5-day and 10-day SMAs are calculated based on the closing prices. The daily price change is determined by subtracting the opening price from the closing price. Market breadth is calculated as the difference between the current closing price and the previous closing price.
The raw value of the oscillator, referred to as SRO Raw, is the sum of the daily price change, the 5-day SMA, the 10-day SMA, and the market breadth. This raw value is then normalized using its mean and standard deviation over a 20-day period, ensuring that the oscillator is centered and maintains a consistent scale. Finally, the normalized value is scaled to fit within the range of -15 to 15.
When interpreting the SRO, a value below -5 indicates that the market is potentially oversold, suggesting it might be a good time to start buying stocks as the market could be poised for a rebound. Conversely, a value above 5 suggests that the market is potentially overbought. In this situation, it may be prudent to hold on to existing positions or consider selling if you have substantial gains.
The SRO is visually represented as a blue line on a chart, making it easy to track its movements. Red and green horizontal lines mark the overbought (5) and oversold (-5) levels, respectively. Additionally, the background color changes to light red when the oscillator is overbought and light green when it is oversold, providing a clear visual cue.
By incorporating the S&P Short-Range Oscillator into your trading strategy, you can gain valuable insights into market conditions and make more informed decisions about when to buy, sell, or hold your stocks. However, always consider other market factors and perform your own analysis before making any trading decisions.
The S&P Short-Range Oscillator is a powerful tool for traders looking to gain insights into market sentiment. It provides clear buy and sell signals through its combination of multiple indicators and normalization process. However, traders should be aware of its lagging nature and potential complexity, and use it in conjunction with other analysis methods for the best results.
Disclaimer
The S&P Short-Range Oscillator is for informational purposes only and should not be considered financial advice. Trading involves risk, and you should conduct your own research or consult a financial advisor before making investment decisions. The author is not responsible for any losses incurred from using this indicator. Use at your own risk.
Multiple Instrument Automation ScreenerI have developed a Pine Script indicator on TradingView designed to demonstrate how to automate execution for ten instruments. This example utilizes a straightforward, Simple Moving Average (SMA) indicator. You can use it as a template, but use your indicator.
The indicator computes long/short signals based on the crossing of the SMA using the security function
It acts as a screener, presenting calculation results in an organized table format.
Utilizing the varip variable, the indicator sends alerts for multiple instruments sequentially rather than simultaneously.
For every generated signal, the indicator builds and sends a JSON execution command to a third-party tool, ensuring seamless integration and automation. You can use your own format.
Sent alerts look like this:
{"ticker": "DOGEBTC","action": "buy","price": "0.00000199","time": "1719754620658"}
Details and Limitations
Instrument Limit: The example is configured for ten instruments for simplicity. However, it can be expanded to handle up to 40 instruments.
Alert Rate Limit: There is a rate limit of 15 alerts in 3 minutes. Exceeding this limit may cause some alerts to be stopped. This can be managed by tracking the alert times and delaying some alerts, though this may affect the entry prices.
Timing of Signal Generation : The indicator processes signals at the bar close to the active instrument. Due to its computational complexity, there is a slight delay in collecting all records, potentially causing signals to reflect a few seconds before the bar closes. Care should be taken when executing based on these signals.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Market Average TrendThis indicator aims to be complimentary to SPDR Tracker , but I've adjusted the name as I've been able to utilize the "INDEX" data provider to support essentially every US market.
This is a breadth market internal indicator that allows quick review of strength given the 5, 20, 50, 100, 150 and 200 simple moving averages. Each can be toggled to build whatever combinations are desired, I recommend reviewing classic combinations such as 5 & 20 as well as 50 & 200.
It's entirely possible that I've missed some markets that "INDEX" provides data for, if you find any feel free to drop a comment and I'll add support for them in an update.
Markets currently supported:
S&P 100
S&P 500
S&P ENERGIES
S&P INFO TECH
S&P MATERIALS
S&P UTILITIES
S&P FINANCIALS
S&P REAL ESTATE
S&P CON STAPLES
S&P HEALTH CARE
S&P INDUSTRIALS
S&P TELECOM SRVS
S&P CONSUMER DISC
S&P GROWTH
NAS 100
NAS COMP
DOW INDUSTRIAL
DOW COMP
DOW UTILITIES
DOW TRANSPORTATION
RUSSELL 1000
RUSSELL 2000
RUSSELL 3000
You can utilize this to watch stocks for dip buys or potential trend continuation entries, short entries, swing exits or numerous other portfolio management strategies.
If using it with stocks, it's advisable to ensure the stock often follows the index, otherwise obviously it's great to use with major indexes and determine holdings sentiment.
Important!
The "INDEX" data provider only supplies updates to all of the various data feeds at the end of day, I've noticed quite some delays even after market close and not taken time to review their actual update schedule (if even published). Therefore, it's strongly recommended to mostly ignore the last value in the series until it's the day after.
Only works on daily timeframes and above, please don't comment that it's not working if on other timeframes lower than daily :)
Feedback and suggestions are always welcome, enjoy!
3x MTF MACD v3.0MACD's on 3 different Time Frames
Indicator Information
- Each Time Frame shows start of Trend and end of trend of the MACD vs the Signal Cross
- They are labled 1,2,3 with respective up or down triangle for possible direction.
User Inputs
- configure the indicator by specifying various inputs. These inputs include colors for bullish
and bearish conditions, the time frame to use, whether to show a Simple Moving Average
(SMA) line, and other parameters.
- Users can choose time frames for analysis (like 30 minutes, 1 hour, etc.)
but they must be in mintues.
- The code also allows users to customize how the indicator looks on the chart by providing
options for position and color.
Main Calculations
- The script calculates the Simple Moving Average (SMA) based on the user-defined time
frame.
- It then determines the color of the plot (line) based on certain conditions, such as whether
the SMA is rising or falling. These conditions help users quickly identify market trends.
Label Creation
- The code creates labels that can be displayed on the chart.
These labels indicate whether there's a bullish or bearish signal.
Level Detection
- The script determines and labels key levels or points of interest in the chart based on
certain conditions.
- It can show labels like "①" and "▲" for bullish conditions and "▼" for bearish conditions.
Table Display
- There's an option to show a table on the chart that displays information about the MACD
indicator Chosen and the NUmber Bubble assocated with that time frame
- The table can include information like which time frame is being analyzed, whether the SMA
line is shown, and other relevant data.
Plotting on the Chart
- The script plots the Simple Moving Average (SMA) on the chart. The color of this line
changes based on the calculated trend conditions.
ATR (Average True Range)
- The script also plots the Average True Range (ATR) on the chart. ATR is used to measure
market volatility.
"In essence, this script is a highly customizable MACD and SMA indicator for traders. It assists traders in comprehending market trends, offering insights into different MACD cycles concerning various timeframes.
Users can configure it to match their trading strategies, and it presents information in a user-friendly manner with colors, labels, and tables.
This simplifies market analysis, allowing traders to make more informed decisions without the distraction of multiple indicators."
Average Range LinesThis Average Range Lines indicator identifies high and low price levels based on a chosen time period (day, week, month, etc.) and then uses a simple moving average over the length of the lookback period chosen to project support and resistance levels, otherwise referred to as average range. The calculation of these levels are slightly different than Average True Range and I have found this to be more accurate for intraday price bounces.
Lines are plotted and labeled on the chart based on the following methodology:
+3.0: 3x the average high over the chosen timeframe and lookback period.
+2.5: 2.5x the average high over the chosen timeframe and lookback period.
+2.0: 2x the average high over the chosen timeframe and lookback period.
+1.5: 1.5x the average high over the chosen timeframe and lookback period.
+1.0: The average high over the chosen timeframe and lookback period.
+0.5: One-half the average high over the chosen timeframe and lookback period.
Open: Opening price for the chosen time period.
-0.5: One-half the average low over the chosen timeframe and lookback period.
-1.0: The average low over the chosen timeframe and lookback period.
-1.5: 1.5x the average low over the chosen timeframe and lookback period.
-2.0: 2x the average low over the chosen timeframe and lookback period.
-2.5: 2.5x the average low over the chosen timeframe and lookback period.
-3.0: 3x the average low over the chosen timeframe and lookback period.
Look for price to find support or resistance at these levels for either entries or to take profit. When price crosses the +/- 2.0 or beyond, the likelihood of a reversal is very high, especially if set to weekly and monthly levels.
This indicator can be used/viewed on any timeframe. For intraday trading and viewing on a 15 minute or less timeframe, I recommend using the 4 hour, 1 day, and/or 1 week levels. For swing trading and viewing on a 30 minute or higher timeframe, I recommend using the 1 week, 1 month, or longer timeframes. I don’t believe this would be useful on a 1 hour or less timeframe, but let me know if the comments if you find otherwise.
Based on my testing, recommended lookback periods by timeframe include:
Timeframe: 4 hour; Lookback period: 60 (recommend viewing on a 5 minute or less timeframe)
Timeframe: 1 day; Lookback period: 10 (also check out 25 if your chart doesn’t show good support/resistance at 10 days lookback – I have found 25 to be useful on charts like SPX)
Timeframe: 1 week; Lookback period: 14
Timeframe: 1 month; Lookback period: 10
The line style and colors are all editable. You can apply a global coloring scheme in the event you want to add this indicator to your chart multiple times with different time frames like I do for the weekly and monthly.
I appreciate your comments/feedback on this indicator to improve. Also let me know if you find this useful, and what settings/ticker you find it works best with!
Also check out my profile for more indicators!
MultiMovesCombines 3 different moving averages together with the linear regression. The moving averages are the HMA, EMA, and SMA. The script makes use of two different lengths to allow the end user to utilize common crossovers in order to determine entry into a trade. The edge of each "cloud" is where each of the moving averages actually are. The bar color is the average of the shorter length combined moving averages.
-The Hull Moving Average (HMA), developed by Alan Hull, is an extremely fast and smooth moving average. In fact, the HMA almost eliminates lag altogether and manages to improve smoothing at the same time. A longer period HMA may be used to identify trend.
-The exponential moving average (EMA) is a technical chart indicator that tracks the price of an investment (like a stock or commodity) over time. The EMA is a type of weighted moving average (WMA) that gives more weighting or importance to recent price data.
-A simple moving average (SMA) is an arithmetic moving average calculated by adding recent prices and then dividing that figure by the number of time periods in the calculation average.
-The Linear Regression Indicator plots the ending value of a Linear Regression Line for a specified number of bars; showing, statistically, where the price is expected to be. Instead of plotting an average of past price action, it is plotting where a Linear Regression Line would expect the price to be, making the Linear Regression Indicator more responsive than a moving average.
The lighter colors = default 50 MA
The darker colors = default 200 MA
Trade Pro - Rejection Zone IndicatorThe Rejection Zone Indicator can be used to help trend following traders know when to buy dips in up trends, and when to sell pull backs in down trends.
The Rejection Zone Indicator is made up of the 20 and 50 period Exponential Moving Averages. This indicator has colored shading in between these two EMAs, which acts as a nice visual. When the 20 period Exponential Moving Average is below the 50 period Exponential Moving Average, the shaded cloud will be red, and when the 20 EMA is over the 50 EMA the cloud will be green. It is called the Rejection Zone indicator, because often in trends when price pulls back to the colored cloud, it will act as an area of support or resistance.
The suggested use of the Rejection Zone Indicator is to look for long trades when the cloud is green, and once price has pulled back into the green cloud. If the cloud is red one can look for short trading opportunity when price pulls back into the red cloud.
EMA ON MA SETSOORY FOR MY EINGLISH
ITS NOT MY NATIVE AND IM NOT GOING TO GOOGLE TRANSLATE THIS
this is a beuaitful indicator that plot EMA that gat is calc from another ma and length for your choise so you will get an = 'ema on ma '
it can plot you more beautiful results and more smoothing results
i added golden/death cross for all ma
enjoy !
היי חברים זה בעצם אינדיקטור של ממוצע נע על ממוצע נע לנוחיכותכם
הפלט הראשי הוא EMA
הוא לוקח את החישוב שלו ממוצע אחר והאורך שתגדירו
נותן תוצאה יותר חלקה של ממוצעים נעים
הוספתי חתיוכים בין ההמוצעים
תהנו.
Chirag Strategy SMA with StopLossThe Moving Average Crossover trading strategy is possibly the most popular trading strategy in the world of trading. This strategy is a good example of so-called traditional strategies. Traditional strategies are always long or short. That means they are never out of the market. The concept of having a strategy that is always long or short may be scary, particularly in today’s market where you don’t know what is going to happen as far as risk on any one market. But a lot of traders believe that the concept is still valid, especially for those of traders who do their own research or their own discretionary trading.
This version uses crossover of simple moving averages of length 10 and 13. This strategy is best suitable for NIFTY and BANKNIFTY under 15min candlestick for intraday and 1hour candlestick for long-term.
Bogdan Ciocoiu - CoordinatorDescription
The Coordinator is an indicator developed on the back of the RSI algorithm, modified substantially to form a cloud. In addition, the Coordinator uses EMA/SMA to compare the location of the RSI cloud with the chosen moving averages (EMA vs SMA).
This indicator is helpful as it confirms when a trader should enter a position or exit based on the proximity of the RSI cloud to the relevant MA.
Uniqueness
The Coordinator provides unique benefits, including:
It shows the strength of the RSI in the shape of the RSI cloud, using two sets of dimensions (one more long term and one more short-term oriented).
It indicates the positioning of the RSI cloud in conjunction with the relevant moving averages to help traders remain in positions for longer.
It shows the RSI 14 (useful when spotting divergences aligned with the price action).
Open-source
The Coordinator uses the following open-source scripts:
www.tradingview.com
Multiple Moving AveragesThis script plots up to five Moving Averages , either Simple or Exponential (9, 20, 50, 100 and 200 days period by default).