Vigilant Asset Allocation G4 Backtesting EngineThis script was based off of an idea that @CubanEmissary had so the description and some of the code that @CubanEmissary built on TradingView was used.
Vigilant Asset Allocation G4 (VAA G4) is a dual-momentum based investment strategy that aggressively monitors the market and reallocates portfolio funds based on the relative momentums of user-defined risk assets and safety assets. It was created by Wouter Keller and JW Keuning, based on their paper "Breadth Momentum and Vigilant Asset Allocation." In contrast to traditional dual momentum strategies, VAA G4 monitors the market itself through the two asset types. When all risk assets have positive momentum, the portfolio is allocated entirely into the risk asset with the strongest momentum At any other time, the portfolio is allocated entirely into the safety asset with the strongest momentum. The combination of breadth momentum with a very defensive reallocation trigger results in a strategy which captures alpha consistently.
The Strategy Rules:
1. Calculate each asset's momentum score on each monthly close:
momentumScore = (12*(currentMonthlyClose/lastMonthlyClose))+(4*(currentMonthlyClose/thirdLastMonthlyClose))+(2*(currentMonthlyClose/sixthLastMonthlyClose))+(currentMonthlyClose/twelvethLastMonthlyClose)-19
2. If all risk asset momentums are positive, allocate entire portfolio to the risk asset with the strongest momentum.
3. If any risk asset's momentum is negative, allocate entire portfolio to the safety asset with the strongest momentum.
4. Reevaluate at the end of each month.
Caveats:
1. It seems like TradingView only has limited price data for these tickers that are listed in the strategy. So it is best to start the strategy when they all have ample data (~ June 2nd, 2008)
2. This backtesting engine is basic and doesn't account for slippage and trading fees. So I implemented a basic "trading fee" input that will subtract a trading fee whenever the strategy makes a trade at the end of the month.
3. It is assumed in this engine that the trades will be made the exact second a new monthly bar opens up.
4. MUST USE ON MONTHLY CHART. It is hard-coded to work on monthly chart, if you open it on a daily chart , the Sharpe, Sortino, & CAGR calculations might not be right as well as the momentum score
In den Scripts nach "12月4号是什么星座" suchen
MACD & RSI Overlay (Expo)█  Overview 
 The MACD & RSI Overlay (Expo)  trading indicator is a technical analysis tool that combines two popular indicators, the Relative Strength Index (RSI  ) and the Moving Average Convergence Divergence (MACD  ), and overlays them onto the price chart. The indicator oscillates relative to price, so it plots the RSI and MACD around price while still displaying the same insights as the regular MACD and RSI indicators. This feature gives traders a unique perspective, allowing them to see the relationship between price, momentum, and trend in a single chart.
This indicator is a valuable addition to any trader's technical analysis toolkit, whether they are a beginner or an experienced trader.
█  MACD 
  
█  RSI 
The RSI comes with overbought and oversold areas, which can be set by the trader.
  
█  MACD & RSI 
  
█  Trend Feature 
What sets the MACD & RSI Overlay indicator apart is its ability to factor in the underlying trend. This feature makes the indicator more useful than ever before, as traders can use it to filter trades in the direction of the trend. By considering the underlying trend, traders can gain valuable insights into market trends. 
  
█  Benefits 
One of the primary benefits of having the MACD and RSI plotted directly on the price chart is that it provides a more intuitive understanding of the relationship between price, momentum, and trend. Traders can quickly identify the direction of the trend by observing the price movement relative to the MACD and RSI lines. In addition, by having these indicators plotted on the chart, traders can quickly identify potential buy and sell signals and develop new trading strategies.
█  How to use 
One of the most popular strategies is to use the MACD & RSI Overlay indicator to look for crossings. A crossing occurs when the MACD and RSI lines cross over each other or when they cross over the signal line. These crossings can signal potential trend reversals and momentum shifts. For example, if the MACD line crosses over the signal line from below, it could indicate a bullish signal, while a cross from above could indicate a bearish signal.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Advanced Price Direction AlgorithmPrices can go up or down or falter in their movement.
This code evaluates this by looking at two consecutive bars or sets of bars.
If you put the set size to 1, the current and previous bar is evaluated.
If put to 2, the last2 and the 2 before these are evaluated.
Default is 12 because this seems to coincide with trend changes.
This code provides an advanced way to evaluate what the price does in a sort of three-value Boolean with the values up, down or falter.
I use this code in indicators I develop where price direction is taken into account.
The simple output makes it possible to use it as an indicator on its own.
[Uhokang] Bollinger Band BB EMA SMMA SMA Multy timeframeYou can view indicators from the specified upper timeframe together.
( Bollinger Bands, SMMA, EMA, SMA )
If it is based on a 1-hour bar, you can see indicators for 4-hour bars and 1-day bars at the same time.
  =>   =>  
Minutes
1 => 5 => 30
2 => 10 => 60 
3 => 15 => 90
4 => 20 => 120 
5 => 30 => 120
6 => 30 => 120
10 => 60 => 240
15 => 60 => 240 
30 => 120 => 480
45 => 180 => 450
over Hours
1 => 4 => D
2 => 8 => 2D
3 => 12 => 3D
4 => D => W 
D => W => M
W => M => Y
[-_-] DictionaryThe script shows an example implementation of dictionary-like data type which can store key:value pairs (Python style). Both keys and values can have any of the following type:
• string
• integer
• float
• boolean
• color
You can add items of different types to the same dictionary (e.g. key = 12 and value = "value" stored in the same dictionary with key = "key" and value = 0.23). 
Under the hood dictionary is a custom Object (see www.tradingview.com), that has two array fields (one for storing keys, another for storing values). Keys and values of different types are converted into a string representation when adding a new item to the dictionary. The value is then converted back to certain type (bool/color/etc.) from that string representation when being retrieved. Script also utilises the new Methods (see www.tradingview.com).
The following methods are implemented:
• init() -> initialises the array fields of dictionary (without this the script throws an error "Array methods can't be called when ID of array is na"
• set(key, value) -> add a new item to dictionary; if an item for given key already exists - change it to new value
• getS(key) -> get value of string type
• getI(key) -> get value of integer type
• getF(key) -> get value of float type
• getB(key) -> get value of boolean type
• getC(key) -> get value of color type
• remove(key) -> removes item from dictionary
• len() -> get length of dictionary (the number of keys)
 I could not make just one "get" function that returns any type of value (color/string/etc.), so instead I created a get function for each value type. Example usage:
• you add a string item: dictionary.set(2, "string here")
• you add a float item: dictionary.set(3, 24.56)
• to retrieve first value (key=2) do this: dictionary.getS(2)
• to retrieve second value (key=3) do this: dictionary.getF(3)
Super 6x: RSI, MACD, Stoch, Loxxer, CCI, & Velocity [Loxx]Super 6x: RSI , MACD , Stoch , Loxxer, CCI , & Velocity is a combination of 6 indicators into one histogram. This includes the option to allow repainting. 
 What is MACD? 
Moving average convergence divergence ( MACD ) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period exponential moving average ( EMA ) from the 12-period EMA .
 What is CCI? 
The Commodity Channel Index ( CCI ) measures the current price level relative to an average price level over a given period of time. CCI is relatively high when prices are far above their average. CCI is relatively low when prices are far below their average. Using this method, CCI can be used to identify overbought and oversold levels.
 What is RSI? 
The relative strength index is a technical indicator used in the analysis of financial markets. It is intended to chart the current and historical strength or weakness of a stock or market based on the closing prices of a recent trading period. The indicator should not be confused with relative strength .
 What is Stochastic? 
The stochastic oscillator, also known as stochastic indicator, is a popular trading indicator that is useful for predicting trend reversals. It also focuses on price momentum and can be used to identify overbought and oversold levels in shares, indices, currencies and many other investment assets.
 What is Loxxer? 
The Loxxer  indicator is a technical analysis tool that compares the most recent maximum and minimum prices to the previous period's equivalent price to measure the demand of the underlying asset.
 What is Velocity? 
In simple words, velocity is the speed at which something moves in a particular direction. For example as the speed of a car travelling north on a highway, or the speed a rocket travels after launching.
 How to use 
Long signal: All 4 indicators turn green
Short signal: All 4 indicators turn red
 Included 
Bar coloring
Alerts
Zazzamira 50-25-25 Trend System Alerts OnlyPublishing my trading system script. It consist of several conditions to happen in order to open a trade. Work best on ES/MES 5 minute timeframe.
I like to use it with this settings:
- UTC -6 (don't tick Exchange Timezone)
and rest as default
To enter a trade, the following conditions must be met: Entry 1: the opening range (8:30AM - 9:15AM UTC-6) must be defined and the price must close above or below the opening range on the 5-minute timeframe. This entry condition defines the trade direction (above = long / below = short). Once the opening range is defined, the Trend-Based Fib Extension is applied from the range high to the range low (and vice versa). Fib levels are required for Exit conditions. Entry 2: the 8 - 27 - 67 - 97 EMAs must be defined. If the EMAs value order is 8 > 27 > 67 > 97, long-only trades are allowed. If the EMAs value order is 8 < 27 < 67 < 97, short-only trades are allowed. This entry condition filters fake breakouts of Entry 1. Entry 3: no trades are allowed after 12:59 UTC-6 (2PM EST). Entry 4: if Entry 1, Entry 2, and Entry 3 conditions are valid and the price hasn't reached the 23.6% Fib line, an entry order can be set at the range high/long with 4 contracts. To exit a trade, the following conditions must be met: Exit 1 (Stop loss): set a trailing stop based on 2.1x ATR (14) from entry. Exit 2: take 50% profits at the 23.6% Fib and leave trailing stop untouched. Exit 3: if Exit 2 triggers, take 50% (25% of total entry) off at 61.8% Fib, leaving Exit 2 trailing stop values valid. Exit 4: exit the full position at the FIB 100% value. Exit 5: all trades must be closed at 3pm UTC-6 (4PM EST). So basically Take Profit are 50%-25%-25% of position.
Code has been written by © Hiubris_Indicators who has been an amazing coder and gave me the possibility to make this script public so a really big shoutout to him.
This indicator only works for alerts, please check version without alerts to backtest or tweaks. This indicator is meant to be used to automate the system via webhooks
Expected Move Plotter [CHE]Expected Move Plotter  
"There is magic in everything new."
Introduction:
This script is an indicator for financial trading that plots the expected movement of a security based on the average range over the last five periods. The script is written in Pine Script, a high-level programming language used for creating technical indicators, strategies, and other trading tools for the TradingView platform.
Inputs:
Percentage of Open and Close: This input specifies the percentage of the open and close price to use for the expected movement.
Time Periods: The script takes the different time periods into account and translates them to either 60 seconds, 240 seconds, 1 day, 3 days, 7 days, 1 month, 3 months or 12 months.
Calculation:
The script uses the "Open" and "High"/"Low" values of the last 5 periods to calculate the average range and plots the expected movement above and below the current open price. The plot is either green or red depending on whether the expected move is above or below the current close.
Code Breakdown:
The script starts by defining three integer constants: MS_IN_MIN, MS_IN_HOUR, and MS_IN_DAY, which represent the number of milliseconds in a minute, hour, and day, respectively.
The function timeStep_translate() returns a string that represents the timeframe for a chart based on the current timeframe. The function first converts the chart's timeframe to milliseconds and then uses a switch statement to determine the string value to be returned based on the number of milliseconds in the timeframe.
The script then retrieves the data for the open, high, and low values for the last five periods. The high and low values are used to calculate the average range, which is then used to plot the expected movement above and below the current open price.
Conclusion:
This script provides traders with a visual representation of the expected movement of a security based on the average range over the last five periods. It takes different time periods into account and provides a clear indication of whether the expected move is above or below the current close. The script is easy to use and provides a useful tool for traders looking to make informed trading decisions.
Best regards Chervolino
Strategy Myth-Busting #12 - OSGFC+SuperTrend - [MYN]This is part of a new series we are calling "Strategy Myth-Busting" where we take open public manual trading strategies and automate them. The goal is to not only validate the authenticity of the claims but to provide an automated version for traders who wish to trade autonomously.
Our 12th one is an automated version of the "The Most Powerful Tradingview Buy Sell Signal Indicator " strategy from "Power of Trading" who doesn't make any official claims but watching how he trades with this, it on the surface looked promising. The strategy author uses this on the 15 min strategy on mostly FOREX. Unfortunately as indicated by the backtest results below, we were not able to substantiate any good positive trading metrics from this, be it Profit, Markdown, Num Of Trades etc. This does seem to do okay with some entries but perhaps adding another indicator to this to filter out more noise might make it better. At least how this strategy is presented now, this is not something I recommend anyone use.
This strategy uses a combination of 2 open-source public indicators:
SuperTrend by TradingView Internal
One-Sided Gaussian Filter w/ Channels By Loxx
The SuperTrend indicator and the One-Sided Gaussian Filter complement each other by providing a more complete and accurate picture of market trends. The SuperTrend indicator is used to identify trends. It does this by calculating a moving average of the underlying securities price and then comparing the current price to the moving average. When the current price is above the moving average, the trend is considered bullish, and when it is below, the trend is considered bearish.
The One-Sided Gaussian Filter is a mathematical tool that is used to smooth out fluctuations in financial data. It does this by removing random noise from the data, making it easier to identify patterns and trends.
When the SuperTrend indicator is used in conjunction with the One-Sided Gaussian Filter, the smoothed price data generated by the filter is used as the input for the SuperTrend calculation. This provides a more accurate representation of market trends and helps to eliminate false signals generated by short-term price movements. As a result, the SuperTrend indicator is able to more accurately identify the underlying trend in the market and provide traders with a cleaner and more reliable signal to act upon.
In summary, the SuperTrend indicator and the One-Sided Gaussian Filter complement each other by providing a more accurate and reliable representation of market trends, resulting in improved performance for traders.
If you know of or have a strategy you want to see myth-busted or just have an idea for one, please feel free to message me.
Trading Rules
15 min candles
FOREX or Crypto
Stop loss at swing high/low | 1.5 risk/ratio
Long Condition
SuperTrend and OSGFC generate buy signal
Close Buy on Gaussian generating a sell signal
Short Condition
SuperTrend and OSGFC generate sell signal
Close Buy on Gaussian generating a buy signal
Arron Meter With Alerts [Skiploss]Arron Meter With Alerts is an indicator to identify the trend, and a meter shows the percentage of AroonUP and AroonDown.
Alert Settings
It will be part of a display of bullish  and bearish signals by using the condition of the upper line cross lower line and HMA 200 cross under/over EMA 12, and also upper/lower line must be higher than 70%
Stock Relative Strength Power IndexAs always, this is not financial advice and use at your own risk. Trading is risky and can cost you significant sums of money if you are not careful. Make sure you always have a proper entry and exit plan that includes defining your risk before you enter a trade. 
This idea recently came out of some discussions I stumbled across in a trading group I am a part of regarding Relative Strength and Relative Weakness (shortened to RS and RW from here on out).  The whole mechanism behind this trading system is to filter out underperforming securities relative to the current market direction to be in only the strongest or weakest stocks when the market is currently experiencing a bullish or bearish cycle.  The idea behind this is there is no point in parking your money into a stock that is treading water or even going down if the market is making strong moves upwards.  At that point, you are at worst losing money, and at best trading equal to the index/ETF, in which case the argument is why are you not just trading the index/ETF instead?  RS or RW will filter out these sector laggards and allow you to position yourself into strong (or the strongest) stocks at any given time to help improve portfolio performance.  Further, not only does it protect your position should the market shift against you briefly, it also often sees exceptional performance in the same cycle.  For example, if $SPY makes a 5% move over the course of a month, a stock with RS/RW may make a 10% move, or more, allowing you to see increased profit potential.
RS/RW is based on the idea of performance, that is the raw percent change of a security over a given time period relative to a benchmark.  This benchmark is often the S&P500 (ES/SPX/SPY and their derivatives).  I have to stress that this is not beta, which measures the volatility of a stock over a given period (i.e. if $SPY moves $1, $NVDA will often move $1.74).  This is a measurement of the market (i.e. $SPY) has moved 1% over the course of a day, $NVDA has moved 8% over the course of the day.  This is very often used as a signal of institutional interest as apart from some very unique moments, retail traders cannot and will not provide enough market pressure to move a market outside of a stock's normal trading range, nor will they outperform the sector or market as a whole consistently over time without some big money to make them move.  The problem with running strict performance analysis (i.e. % change from period T ago to period T + n at present) is that while it gives us a baseline of how much the stock has moved, it doesn't overall mean much.  For instance, if a $100 stock has moved 5% today, but has been experiencing a period of increased volatility and it's Average True Range (ATR) (the amount a stock will move over X number of periods, on average) is $7, performance seems impressive but is actually generally fairly weak to what the stock has been doing recently.  Conversely, if we take a second stock, this time worth $20, and it too has moved 5% in one day but has an ATR of only $0.25, that stock has made an exceptional move and we want to be part of that. 
Here, I have created an indicator called the Stock Relative Strength Power Index.  This takes the stock's rate of change (ROC) (the % move it has made over X number of periods), the stock's normalized ATR (the ATR represented as a percentage instead of a raw value), and compares these to one another to get the "Power Rating": a representation of the true strength of a stock over X number of periods.  The indicator does two things. First, the raw ROC is divided by the stock's normalized ATR to assess whether the stock is moving outside of its normal range of variation or not.  Second, since we are interested in trading only stocks with exceptional RS/RW to the market, I have also applied this same calculation to the S&P500 ($SPY) and the various SPDR sector indexes.  These comparisons allow for a rapid and accurate assessment of the true strength of a stock at any given time on any given time frame.  To cycle back above to our examples, the $100 stock has a Power Rating of only 0.71 (i.e. it is trading less than its current average), while our $20 stock has a Power Rating of 5.  If we then compare these to both the market as a whole and the sector that the stock is a part of, we get a much clearer indication of the true buying or selling pressure imposed on the stock at any given time.
Use:
The indicator has 3 lines.  The blue line is the security of interest, the red line is the market baseline (i.e. the sector ETF $SPY), and the white line is the sector index.  I have given an example above on the semiconductor/tech stock $NVDA on a 30min timeframe.  You can see that since the start of 2023, $NVDA has generally been strong to the market and its own sector since the blue line is greater than both the red and white lines over many days.  This would have provided some nice day trading opportunities, or even some nice short term swing trades. The values themselves are generally meaningless outside of either the 1 or -1 value lines.  All that matters is that the current ticker is surpassing both the market and the sector while being > 1.0 for a long trade or less than -1.0 for a short trade.  However, I must stress this indicator gives no trade signals on its own, it is purely a confirmation indicator.  An example of a trade would be if you had a trade signal given by either an indicator or by price action suggesting to buy some $NVDA for a trade to the upside, the Power Rating indicator would confirm this by showing if $NVDA was actually showing true strength by being both greater than 1 (the cutoff for it surpassing its ATR) and being above both the red and white lines.  Further, you can see $NVDA has been stronger than the market when using the comparison function as well, but the has fluxed in and out of strength intraday when using the actual indicator vs. the static performance ratio chart (plotted as line graphs on the chart).
 I have made it possible to change the colour of the plots and the line levels.  The adjustment of the line levels gives the trader the flexibility to change their target breakout level (i.e. only trading stocks that have a Power Rating > 2, for example, meaning they are trading at least 2X their normal trading range).  The third security comparison is flexible and can be used to compare to the sector ETF (initial intention) or it can be used to compare to other tickers within the same sector, for example.  The trader should select the appropriate ETF for the given security of interest to avoid false confirmation if they want to use an ETF as their third input.  The proper sector should be readily available on most online websites and accessible in a matter of seconds meaning that the delay is minimal, at worst.  If a trader wishes to add additional functionality, such as a crypto trader using BTCUSD as the benchmark instead of $SPY, I encourage them to copy and paste this script and modify as needed since I have made this open source.  
This indicator works on all timeframes.  The lookback period can be changed, so a day trader who may use a 5min chart (and use a period of 12 to get the hourly Power Rating) will find this equally useful as someone who may be a core trader who wants to look at the performance over the course of years and may use a 60 period on a monthly chart.
Happy trading and I hope this helps!  
[E5 Trading] Moving AveragesMoving Averages 
 
 Plot up to 12 moving averages and customize colors directly on the inputs tab.
 Select from any of one of eight (8) moving averages types from the drop-down menu including 'EMA', 'HMA', 'LINREG', 'SWMA', 'SINE', 'SMA', 'VWMA', and 'WMA'.
 Default 'SMA' for Plots 1 through 6, and default 'EMA' for plots 7 through 12.
 Use this indicator to quickly transition between your favorite moving average combinations.
 This indicator can also be used to create the Guppy Multiple Moving Average: www.investopedia.com
 
 Definitions 
 
 'EMA' = Exponential Moving Average
 'HMA' = Hull Moving Average
 'LINREG' = Linear Regression Curve
 'SWMA' = Symmetrically Weighted Moving Average
 'SINE' = Sine Weighted Moving Average
 'SMA' = Simple Moving Average
 'VWMA' = Volume Weighted Moving Average
 'WMA' = Weighted Moving Average
Zazzamira 50-25-25 Trend SystemPublishing my trading system script. It consist of several conditions to happen in order to open a trade. Work best on ES/MES 5 minute timeframe. 
I like to use it with this settings:
- UTC -6 (don't tick Exchange Timezone)
and rest as default
To enter a trade, the following conditions must be met: Entry 1: the opening range (8:30AM - 9:15AM UTC-6) must be defined and the price must close above or below the opening range on the 5-minute timeframe. This entry condition defines the trade direction (above = long / below = short). Once the opening range is defined, the Trend-Based Fib Extension is applied from the range high to the range low (and vice versa). Fib levels are required for Exit conditions. Entry 2: the 8 - 27 - 67 - 97 EMAs must be defined. If the EMAs value order is 8 > 27 > 67 > 97, long-only trades are allowed. If the EMAs value order is 8 < 27 < 67 < 97, short-only trades are allowed. This entry condition filters fake breakouts of Entry 1. Entry 3: no trades are allowed after 12:59 UTC-6 (2PM EST). Entry 4: if Entry 1, Entry 2, and Entry 3 conditions are valid and the price hasn't reached the 23.6% Fib line, an entry order can be set at the range high/long with 4 contracts. To exit a trade, the following conditions must be met: Exit 1 (Stop loss): set a trailing stop based on 2.1x ATR (14) from entry. Exit 2: take 50% profits at the 23.6% Fib and leave trailing stop untouched. Exit 3: if Exit 2 triggers, take 50% (25% of total entry) off at 61.8% Fib, leaving Exit 2 trailing stop values valid. Exit 4: exit the full position at the FIB 100% value. Exit 5: all trades must be closed at 3pm UTC-6 (4PM EST). So basically Take Profit are 50%-25%-25% of position. 
Code has been written by © Hiubris_Indicators who has been an amazing coder and gave me the possibility to make this script public so a really big shoutout to him. 
Nifty36ScannerThis code is written for traders to be able to automatically scan 36 stocks of their choice for MACD , EMA200 + SuperTrend and Half Trend . Traders can be on any chart, and if they keep this scanner/indicator on , it will start displaying stocks meeting scanning criteria on the same window without having to go to Screener section and running it again and again. It will save time for traders and give them real time signals.  
Indicators for scanning stocks are:
 
 MACD
 EMA200
 Supertrend
 
HalfTrend - originally developed by EVERGET
Combination of EMA200 crossover/under and MACD crossover/under has worked well for me for long time, so using this combination as one of the criteria to
Scan the stocks. Using Everget's Half Trend method confirms the signal given by MACD , EMA200 and Supertrend Crossover.
I have added 36 of my favourite stocks from Nifty 50 lot. Users of this script can use the same stocks or change it by going into the settings of this scanner.
 The Code is divided into 3 Sections 
Section 1: Accepting input from users  as boolean so that  they can  scan on the basis of one of the criteria or any combination of the criteria.
Section 2: "Screener function" to calculate Buy/ Sell on the basis of scanning criteria selected y the user.
 screener=> 
           = ta.supertrend(2.5,10)
         Buy/Sell on the basis of Supertrend crossing Close of the candle
         
         //using ta.macd function to calculate MACD and Signal 
           =  ta.macd(close, 12, 26, 9)
        using HalfTrend indicator to calculate Buy/Sell signals , removed all the plotting  functions from the code of Half Trend
       Bringing Stock Symbols in S series variables 
      s1=input.symbol('NSE:NIFTY1!', title='Symbol1', group="Nifty50List", inline='0')
     
       Assigning Bull/Bear ( Buy/Sell) signals to each stocks selected  
      =request.security(s1, tf, screener())
     
      Assign BUY to all the stocks showing Buy signals using  
     buy_label1:= c1?buy_label1+str.tostring(s1)+'\n': buy_label1
Follow the same process for SELL Signals
        
Section 3: Plotting labels for the BUY/SELL  result on the in terms of label for any stocks meeting the criteria with deletion of any previous signals to avoid clutter on the chart with so many signals generated in each candle 
     Display Buy siganaling stocks in teh form of label using Label.new function with parameters as follows: 
    barindex
    close as series
     color
     textcolor
     style as label_up, 
     yloc =price
     textalign=left
    
    Delete all the previous labels 
         label.delete(lab_buy ) 
           
 STOCKS SELECTION 
We have given range f 36 stocks from NIFTY 50 that can be selected at anytime,. User can chose their own 36 stocks using setting button.
 INDICATORS SELECTION 
1. MACD: It i sone of the most reliable trading strategy  with  39.3%  Success rate with 1.187 as profit factor for NIFTY Index on Daily time frame
2. EAM200 + Super trend : Combination of EMA200 crossover and Super trend removes any false positives and considered a very reliable way of scanning for Buy/Sell signals
3. HALF TREND: Originally developed as an indicator by  Everget and modified as strategy by AlgoMojo, it generates Buy/Sell signals with 40.2% success rate with 1.469 as profit faction, on 15 minutes timeframe. 
 
ICT Killzones [LuxAlgo]This script highlights ICT Killzones on the chart along with Fibonacci retracements constructed from each Killzone's price range, allowing traders to find more optimal entries.
 Settings 
 Killzone Retracements 
 
 Show Retracements: Determines whether Fibonacci retracements are displayed on the chart.
 Extend: Determines if the retracements are extended outside the Killzone.
 Reverse: Switches the maximum and minimum levels for the calculation of the retracements.
 
Other settings allow disabling as well as changing the retracement value and color.
 Usage 
  
Killzones are introduced by forex trader ICT and represent different time intervals that aims at offering optimal trade entries. Killzones include:
 
 New York Killzone (7:9 ET)
 London Open Killzone (2:5 ET)
 London Close Killzone (10:12 ET)
 Asian Killzone (20:00 ET)
 
 Note that using timeframes superior to 1h can highlight incorrect intervals 
  
Fibonacci retracements on an active Killzone are subject to changes, if no Killzones are active then the associated Fibonacci retracements will stay at their current level.
  
Disabling specific Killzones while having extended retracements will allow them to extend further. In the image above the New York and Asian Killzones are disabled.
FOREX MASTER PATTERN Value Lines by nnamThe Forex Master Pattern is form of technical analysis that provides a framework for spotting hidden price patterns that reveal the true movement of the market. The Forex Master Pattern Value Lines Indicator helps to identify this Phase 1 contraction of the Forex Master Pattern cycle.
 HOW THIS INDICATOR WORKS 
This indicator looks for a sustained contraction in price initially indicated by TWO contraction bars in a row, thus detecting a contraction point and a potential new master pattern origin point. 
  
Once a contraction point is detected, a blue box will appear on the chart with a thick solid blue line projecting from its center. These are potential "Points of Origin" and "Value Lines" that institutional traders use to balance their books.
  
As shown above, when price begins to move (detected by engulfing and/or expansion candles), an Arrow is plotted to the chart identifying a possible expansion.
  
As shown above, previous Value Lines typically serve as future support / resistance points, however, due to the unique location of these lines, they are not typically identified as support or resistance levels on standard S/R indicators.
  
Color Coded Candles assist the user in quickly identifying contraction and expansion areas as well as trends away from the value-line. The expansion candles, Up/Down candles, and contraction BARS are all inspired by the STRAT (Rob Smith) and are specifically incorporated into this indicator to assist the user in finding potential reversals during the expansion phase. This helps to avoid the whiplash typically associated with the first phase of Forex Master Pattern.
 USER DEFINED SETTINGS 
 - Line Settings Section -  
 #Max Lines to Show 
This limits or extends the total number of lines shown on the chart. The Default is 12 (minimum is 1, maximum is 499).
 #Show Lines on Chart 
This setting turns all lines ON or OFF on the chart
 #Show Value-Lines on Chart 
This setting turns the Value Lines ON or OFF on the chart
 #Set Value-Line Width 
This setting sets the width of the value-line displayed on the chart
 #Only show last value-line on the chart 
This setting removes all but the most recent value-line from the chart
 - Box Settings Section - 
 #Show Last Box Only 
This setting turns OFF all previous boxes and only shows the most recent contraction box on the chart
 - Expansion Area Settings Section - 
 #Show Expansion Area 
This setting turns ON or OFF the expansion area fill
 #Show Expansion Guidelines on Chart 
This setting turns ON or OFF the guidelines that show the current direction of the price via an extended line.
 - Candle Colors Section - 
 #Color Code the Candles 
This setting turns on Color Coding for the Candles which changes the colors of each candle type:
 
 1. Contraction Candle
 2. Expansion Candle
 3. Up Candle
 4. Down Candle
 5. Engulfing Candles (engulfing candles override other candle settings if turned ON)
 
 - Engulfing Patterns Section - 
 #Show Engulfing Patterns 
This setting turns ON or OFF engulfing candle plots globally
 #Show Bullish Engulfing Candles 
This setting allows the user to turn Bullish Engulfing signals ON or OFF
 #Show Bearish Engulfing Candles 
This setting allows the user to turn Bearish Engulfing signals ON or OFF
I hope you enjoy this indicator and that it provides some value. Please reach out to me with any suggestions or need training on the indicator.















