Wyckoff Range StrategyThe Wyckoff Range Strategy is a trading strategy that aims to identify potential accumulation and distribution phases in the market using the principles of Wyckoff analysis. It also incorporates the detection of spring and upthrust patterns.
Here's a step-by-step explanation of how to use this strategy:
Understanding Accumulation and Distribution Phases:
Accumulation Phase: This is a period where smart money (large institutional traders) accumulates a particular asset at lower prices. It is characterized by a sideways or consolidating price action.
Distribution Phase: This is a period where smart money distributes or sells a particular asset at higher prices. It is also characterized by a sideways or consolidating price action.
Input Variables:
crossOverLength: This variable determines the length of the moving average crossover used to identify accumulation and distribution phases. You can adjust this value based on the market you are trading and the time frame you are analyzing.
stopPercentage: This variable determines the percentage used to calculate the stop loss level. It helps you define a predefined level at which you would exit a trade if the price moves against your position.
Strategy Conditions:
Enter Long: The strategy looks for a crossover of the close price above the SMA of the close price with a length of crossOverLength and a crossover of the low price above the SMA of the low price with a length of 20. This combination suggests the start of an accumulation phase and a potential buying opportunity.
Exit Long: The strategy looks for a crossunder of the close price below the SMA of the close price with a length of crossOverLength or a crossunder of the high price below the SMA of the high price with a length of 20. This combination suggests the end of an accumulation phase and a potential exit signal for long positions.
Enter Short: The strategy looks for a crossunder of the close price below the SMA of the close price with a length of crossOverLength and a crossunder of the high price below the SMA of the high price with a length of 20. This combination suggests the start of a distribution phase and a potential selling opportunity.
Exit Short: The strategy looks for a crossover of the close price above the SMA of the close price with a length of crossOverLength or a crossover of the low price above the SMA of the low price with a length of 20. This combination suggests the end of a distribution phase and a potential exit signal for short positions.
Stop Loss:
The strategy sets a stop loss level for both long and short positions. The stop loss level is calculated based on the stopPercentage variable, which represents the percentage of the current close price. If the price reaches the stop loss level, the strategy will automatically exit the position.
Plotting Wyckoff Schematics:
The strategy plots different shapes on the chart to indicate the identified phases and patterns. Green and red labels indicate the accumulation and distribution phases, respectively. Blue triangles indicate spring patterns, and orange triangles indicate upthrust patterns.
To use this strategy, you can follow these steps:
Jim Forte — Anatomy of a Trading Range
robertbrain.com/Bull...+a+Trading+Range.pdf
Moving Averages
Pure Morning 2.0 - Candlestick Pattern Doji StrategyThe new "Pure Morning 2.0 - Candlestick Pattern Doji Strategy" is a trend-following, intraday cryptocurrency trading system authored by devil_machine.
The system identifies Doji and Morning Doji Star candlestick formations above the EMA60 as entry points for long trades.
For best results we recommend to use on 15-minute, 30-minute, or 1-hour timeframes, and are ideal for high-volatility markets.
The strategy also utilizes a profit target or trailing stop for exits, with stop loss set at the lowest low of the last 100 candles. The strategy's configuration details, such as Doji tolerance, and exit configurations are adjustable.
In this new version 2.0, we've incorporated a new selectable filter. Since the stop loss is set at the lowest low, this filter ensures that this value isn't too far from the entry price, thereby optimizing the Risk-Reward ratio.
In the specific case of ALPINE, a 9% Take-Profit and and Stop-Loss at Lowest Low of the last 100 candles were set, with an activated trailing-stop percentage, Max Loss Filter is not active.
Name : Pure Morning 2.0 - Candlestick Pattern Doji Strategy
Author : @devil_machine
Category : Trend Follower based on candlestick patterns.
Operating mode : Spot or Futures (only long).
Trades duration : Intraday
Timeframe : 15m, 30m, 1H
Market : Crypto
Suggested usage : Short-term trading, when the market is in trend and it is showing high volatility .
Entry : When a Doji or Morning Doji Star formation occurs above the EMA60.
Exit : Profit target or Trailing stop, Stop loss on the lowest low of the last 100 candles.
Configuration :
- Doji Settings (tolerances) for Entry Condition
- Max Loss Filter (Lowest Low filter)
- Exit Long configuration
- Trailing stop
Backtesting :
⁃ Exchange: BINANCE
⁃ Pair: ALPINEUSDT
⁃ Timeframe: 30m
⁃ Fee: 0.075%
⁃ Slippage: 1
- Initial Capital: 10000 USDT
- Position sizing: 10% of Equity
- Start: 2022-02-28 (Out Of Sample from 2022-12-23)
- Bar magnifier: on
Disclaimer : Risk Management is crucial, so adjust stop loss to your comfort level. A tight stop loss can help minimise potential losses. Use at your own risk.
How you or we can improve? Source code is open so share your ideas!
Leave a comment and smash the boost button!
Thanks for your attention, happy to support the TradingView community.
Chandelier Exit ZLSMA StrategyIntroducing a Powerful Trading Indicator: Chandelier Exit with ZLSMA
If you're a trader, you know the importance of having the right tools and indicators to make informed decisions. That's why we're excited to introduce a powerful new trading indicator that combines the Chandelier Exit and ZLSMA: two widely-used and effective indicators for technical analysis.
The Chandelier Exit (CE) is a popular trailing stop-loss indicator developed by Chuck LeBeau. It's designed to follow the price trend of a security and provide an exit signal when the price crosses below the CE line. The CE line is based on the Average True Range (ATR), which is a measure of volatility. This means that the CE line adjusts to the volatility of the security, making it a reliable indicator for trailing stop-losses.
The ZLEMA (Zero Lag Exponential Moving Average) is a type of exponential moving average that's designed to reduce lag and improve signal accuracy. The ZLSMA takes into account not only the current price but also past prices, using a weighted formula to calculate the moving average. This makes it a smoother indicator than traditional moving averages, and less prone to giving false signals.
When combined, the CE and ZLSMA create a powerful indicator that can help traders identify trend changes and make more informed trading decisions. The CE provides the trailing stop-loss signal, while the ZLSMA provides a smoother trend line to help identify potential entry and exit points.
In our indicator, the CE and ZLSMA are plotted together on the chart, making it easy to see both the trailing stop-loss and the trend line at the same time. The CE line is displayed as a dotted line, while the ZLSMA line is displayed as a solid line.
Using this indicator, traders can set their stop-loss levels based on the CE line, while also using the ZLSMA line to identify potential entry and exit points. The combination of these two indicators can help traders reduce their risk and improve their trading performance.
In conclusion, the Chandelier Exit with ZLSMA is a powerful trading indicator that combines two effective technical analysis tools. By using this indicator, traders can identify trend changes, set stop-loss levels, and make more informed trading decisions. Try it out for yourself and see how it can improve your trading performance.
Warning: The results in the backtest are from a repainting strategy. Don't take them seriously. You need to do a dry live test in order to test it for its useability.
-
Here is a description of each input field in the provided source code:
length: An integer input used as the period for the ATR (Average True Range) calculation. Default value is 1.
mult: A float input used as a multiplier for the ATR value. Default value is 2.
showLabels: A boolean input that determines whether to display buy/sell labels on the chart. Default value is false.
isSignalLabelEnabled: A boolean input that determines whether to display signal labels on the chart. Default value is true.
useClose: A boolean input that determines whether to use the close price for extrema calculations. Default value is true.
zcolorchange: A boolean input that determines whether to enable rising/decreasing highlighting for the ZLSMA (Zero-Lag Exponential Moving Average) line. Default value is false.
zlsmaLength: An integer input used as the length for the ZLSMA calculation. Default value is 50.
offset: An integer input used as an offset for the ZLSMA calculation. Default value is 0.
-
Ty for checking this out and good luck on your trading journey! Likes and comments are appreciated. 👍
--
Credits to:
▪ @everget – Chandelier Exit (CE)
▪ @netweaver2022 – ZLSMA
X48 - Strategy | ADAPTIVE CONSECUTIVE + TP/SL | V.1Thanks For Tradingview Built-in Script :: << Original From Consecutive Strategy Built-in Script >>
================== Read This First Before Use This Strategy ==============
Please be aware that this strategy is not a guarantee of success and may lead to losses.
Trading involves risk and you should always do your own research before making any decisions.
This Strategy Just an Idea For Help Your Decision For Open Position.
You Must Be Search and Make Your Self Understand What You Doing In This Strategy.
Example :: This Strategy and Indicator Find The Consecutive Bars And You, You Are Reading Must Be Decision Up to You !!
For Backtest Show It's That For a Newbie 100$ Portfolio and 16.333$ Per Order Size
>>>> Read Me First !! <<<<<
========== Detailed and meaningful description =========
How It's Work : This Strategy are Following Green or Red Candle :: example 3 Green Candle To OpenLong Position
Can Set TP/SL if you want :: Just Fine The Best Value of Asset as you want
Fast Trend = MA FAST LINE
SLOW Trend = MA SLOW LINE
MID-TERM TREND = MA MID-TERM
LONG-TERM TREND = MA LONG-TERM
=========== Condition And Statement ===========
Long Condition Statement :: Candles Consecutive Bars Up and close > golden_line and fast_line > golden_line
Short Condition Statement :: Candles Consecutive Bars Down and close < golden_line and fast_line < golden_line
AutoCloseLong Condition :: Candles ConsecutiveBarsDownStop and close > golden_line and close < death_line and close < death_line and close < death_line or fastUpdeath
AutoCloseShort Condition :: Candles ConsecutiveBarsUpStop and close < golden_line and close > death_line and close > death_line and close > death_line or fastUpdeath
====== For ADAPTIVE you can customize your ALL MA For Your Statement
/////////For Example Hook Alert Command ////////////
Just Easy Command >> :: {{strategy.order.alert_message}}
Or Other Json You Should Edit Command Like This Example
{"ex":"'bnfuture'","side": "AutoLong", "$16.333", "symbol": "{{ticker}}", "passphrase": "1234","leverage":"10", "tp" : "5", "sl" : "2", "tl" : "2", "callback" : "1"}
{"ex":"'bnfuture'","side": "AutoShort", "$16.333", "symbol": "{{ticker}}", "passphrase": "1234","leverage":"10", "tp" : "5", "sl" : "2", "tl" : "2", "callback" : "1"}
FRAMA & CPMA Strategy [CSM]The script is an advanced technical analysis tool specifically designed for trading in financial markets, with a particular focus on the BankNifty market. It utilizes two powerful indicators: the Fractal Adaptive Moving Average (FRAMA) and the CPMA (Conceptive Price Moving Average), which is similar to the well-known Chande Momentum Oscillator (CMO) with Center of Gravity (COG) bands.
The FRAMA is a dynamic moving average that adapts to changing market conditions, providing traders with a more precise representation of price movements. The CMO is an oscillator that measures momentum in the market, helping traders identify potential entry and exit points. The COG bands are a technical indicator used to identify potential support and resistance levels in the market.
Custom functions are included in the script to calculate the FRAMA and CSM_CPMA indicators, with the FRAMA function calculating the value of the FRAMA indicator based on user-specified parameters of length and multiplier, while the CSM_CPMA function calculates the value of the CMO with COG bands indicator based on the user-specified parameters of length and various price types.
The script also includes trailing profit and stop loss functions, which while not meeting expectations, have been backtested with a success rate of over 90%, making the script a valuable tool for traders.
Overall, the script provides traders with a comprehensive technical analysis tool for analyzing cryptocurrency markets and making informed trading decisions. Traders can improve their success rate and overall profitability by using smaller targets with trailing profit and minimizing losses. Feedback is always welcome, and the script can be improved for future use. Special thanks go to Tradingview for providing inbuilt functions that are utilized in the script.
Stochastic RSI Strategy (with SMA and VWAP Filters)The strategy is designed to trade on the Stochastic RSI indicator crossover signals.
Below are all of the trading conditions:
-When the Stochastic RSI crosses above 30, a long position is entered.
-When the Stochastic RSI crosses below 70, a short position is entered.
-The strategy also includes two additional conditions for entry:
-Long entries must have a positive spread value between the 9 period simple moving average and the 21 period simple moving average.
-Short entries must have a negative spread value between the 9 period simple moving average and the 21 period simple moving average.
-Long entries must also be below the volume-weighted average price.
-Short entries must also be above the volume-weighted average price.
-The strategy includes stop loss and take profit orders for risk management:
-A stop loss of 20 ticks is placed for both long and short trades.
-A take profit of 25 ticks is placed for both long and short trades.
JS-TechTrading: Supertrend-Strategy_Basic versionAre you looking for a reliable and profitable algorithmic trading strategy for TradingView? If so, you might be interested in our Supertrend basic strategy, which is based on three powerful indicators: Supertrend (ATR), RSI and EMA.
Supertrend is a trend-following indicator that helps you identify the direction and strength of the market. It also gives you clear signals for entry and exit points based on price movements.
RSI is a momentum indicator that measures the speed and change of price movements. It helps you filter out false signals and avoid overbought or oversold conditions.
EMA is a moving average indicator that smooths out price fluctuations and shows you the long-term trend of the market. It helps you confirm the validity of your trades and avoid trading against the trend.
Our Supertrend basic strategy combines these three indicators to give you a simple yet effective way to trade any market. Here's how it works:
- For long trades, you enter when the price is above Supertrend and pulls back below it (the low of the candle crosses Supertrend) and then rebounds above it (the high of the next candle goes above the pullback candle). You exit when the price closes below Supertrend or when you reach your target profit or stop loss.
- For short trades, you enter when the price is below Supertrend and pulls back above it (the high of the candle crosses Supertrend) and then drops below it (the low of the next candle goes below the pullback candle). You exit when the price closes above Supertrend or when you reach your target profit or stop loss.
- You can also use RSI and EMA filters to improve your results. For long trades, you only enter if RSI is above 50 and price is above 200 EMA. For short trades, you only enter if RSI is below 50 and price is below 200 EMA.
- You can set your stop loss and target profit as a percentage of your entry price or based on other criteria. You can also adjust the parameters of each indicator according to your preferences and risk tolerance.
Our Supertrend basic strategy is easy to use and has been tested on various markets and time frames. It can help you capture consistent profits while minimizing your losses.
FTR, WMA, OBV & RSI StrategyThis Pine Script code is a trading strategy that uses several indicators such as Fisher Transform (FTR), On-Balance Volume (OBV), Relative Strength Index (RSI), and a Weighted Moving Average (WMA). The strategy generates buy and sell signals based on the conditions of these indicators.
The Fisher Transform function is a technical indicator that uses past prices to determine whether the current market is bullish or bearish. The Fisher Transform function takes in four multipliers and a length parameter. The four multipliers are used to calculate four Fisher Transform values, and these values are used in combination to determine if the market is bullish or bearish.
The Weighted Moving Average (WMA) is a technical indicator that smooths out the price data by giving more weight to the most recent prices.
The Relative Strength Index (RSI) is a momentum indicator that measures the strength of a security's price action. The RSI ranges from 0 to 100 and is typically used to identify overbought or oversold conditions in the market.
The On-Balance Volume (OBV) is a technical indicator that uses volume to predict changes in the stock price. OBV values are calculated by adding volume on up days and subtracting volume on down days.
The strategy uses the Fisher Transform values to generate buy and sell signals when all four Fisher Transform values change color. It also uses the WMA to determine if the trend is bullish or bearish, the OBV to confirm the trend, and the RSI to filter out false signals.
The red and green triangular arrows attempt to indicate that the trend is bullish or bearish and should not be traded against in the opposite direction. This helps with my FOMO :)
All comments welcome!
The script should not be relied upon alone, there are no stop loss or take profit filters. The best results have been back-tested using Tradingview on the 45m - 3 hour timeframes.
Optimized Zhaocaijinbao strategyIntroduction:
The Optimized Zhaocaijinbao strategy is a mid and long-term quantitative trading strategy that combines momentum and trend factors. It generates buy and sell signals by using a combination of exponential moving averages, moving averages, volume and slope indicators. It generates buy signals when the stock is above the 35-day moving average, the trading volume is higher than the 20-day moving average, and the stock is in an upward trend on a weekly timeframe."招财进宝" is a Chinese phrase that can be translated to "Attract Wealth and Bring in Treasure" in English. It is a common expression used to wish for good luck and prosperity in various contexts, such as in business or personal finances.
Highlights:
The strategy has several special optimizations that make it unique.
Firstly, the strategy is optimized for T+1 trading in the Chinese stock market and is only suitable for long positions. The optimizations are also applicable to international stock markets.
Secondly, the trend strategy is optimized to only show indicators on the right side and oscillations. This helps to prevent false signals in choppy markets.
Thirdly, the strategy uses a risk factor for dynamic position sizing to ensure position sizes are adjusted according to the current net asset value and risk preferences. This helps to lower drawdown risks.
The strategy has good resilience even without using stop loss modules in backtesting, making it suitable for trading hourly, 2-hourly, and daily K-line charts (depending on the stock being traded). We recommend experimenting with backtesting using SSE 1-hour or 2-hour or daily Kline charts.
Backtesting outcomes:
The strategy was backtested over the period from October 13th, 2005 to April 14th, 2023, using daily candlestick charts for the commodity code SSE:600763, with a currency of CNY and tick size of 0.01. The strategy used an initial capital of 1,000,000 CNY, with order sizes set to 10% equity and a pyramid of 1 order. The strategy also had a Max Position Size of 0.01 and a Risk Factor of 2.
Here is a summary of the performance of the trading strategy:
Total net profit: 288,577.32 CNY, representing a return of 128.86%
Total number of closed trades: 61
Winning trades: 37, representing a win rate of 60.66%
Profit factor: 2.415
Largest losing trade: 222,021.46 CNY, representing a loss of 14.08%
Average trade: 21,124.22 CNY, representing a return of 3.1%
Average holding period for all trades: 12 days
Conclusion:
In conclusion, the Optimized Zhaocaijinbao strategy is a mid and long-term quantitative trading strategy that combines momentum and trend factors. It is suitable for both Chinese stocks and global stocks. While the Optimized Zhaocaijinbao strategy has performed well in backtesting, it is important to note that past performance is not a guarantee of future results. Traders should conduct their own research and analysis and exercise caution when using any trading strategy.
LowFinder_PyraMider_V2This strategy is a result of an exploration to experiment with other ways to detect lows / dips in the price movement, to try out alternative ways to exit and stop positions and a dive into risk management. It uses a combination of different indicators to detect and filter the potential lows and opens multiple positions to spread the risk and opportunities for unrealized losses or profits. This script combines code developed by fellow Tradingview community_members.
LowFinder
The lows in the price movement are detected by the Low finder script by RafaelZioni . It finds the potential lows based on the difference between RSI and EMA RSI. The MTF RSI formula is part of the MTFindicators library developed by Peter_O and is integrated in the Low finder code to give the option to use the RSI of higher timeframes. The sensitivity of the LowFinder is controlled by the MA length. When potential lows are detected, a Moving Average, a MTF Stochastic (based the the MTFindiicators by Peter_O) and the average price level filter out the weak lows. In the settings the minimal percentage needed for a low to be detected below the average price can be specified.
Order Sizing and Pyramiding
Pyramiding, or spreading multiple positions, is at the heart of this strategy and what makes it so powerful. The order size is calculated based on the max number of orders and portfolio percentage specified in the input settings. There are two order size modes. The ‘base’ mode uses the same base quantity for each order it opens, the ‘multiply’ mode multiplies the quantity with each order number. For example, when Long 3 is opened, the quantity is multiplied by 3. So, the more orders the bigger the consecutive order sizes. When using ‘multiply’ mode the sizes of the first orders are considerably lower to make up for the later bigger order sizes. There is an option to manually set a fixed order size but use this with caution as it bypasses all the risk calculations.
Stop Level, Take Profit, Trailing Stop
The one indicator that controls the exits is the Stop Level. When close crosses over the Stop Level, the complete position is closed and all orders are exited. The Stop Level is calculated based on the highest high given a specified candle lookback (settings). There is an option to deviate above this level with a specified percentage to tweak for better results. You can activate a Take Profit / Trailing Stop. When activated and close crosses the specified percentage, the Stop Level logic changes to a trailing stop to gain more profits. Another option is to use the percentage as a take profit, either when the stop level crosses over the take profit or close. With this option active, you can make this strategy more conservative. It is active by default.
And finally there is an option to Take Profit per open order. If hit, the separate orders close. In the current settings this option is not used as the percentage is 10%.
Stop Loss
I published an earlier version of this script a couple of weeks ago, but it got hidden by the moderators. Looking back, it makes sense because I didn’t pay any attention to risk management and save order sizing. This resulted in unrealistic results. So, in this script update I added a Stop Loss option. There are two modes. The ‘average price’ mode calculates the stop loss level based on a given percentage below the average price of the total position. The ‘equity’ mode calculates the stop loss level based on a given percentage of your equity you want to lose. By default, the ‘equity’ mode is active. By tweaking the percentage of the portfolio size and the stop loss equity mode, you can achieve a quite low risk strategy set up.
Variables in comments
To sent alerts to my exchange I use a webhook server. This works with a sending the information in the form of a comment. To be able to send messages with different quantities, a variable is added to the comment. This makes it possible to open different positions on the exchange with increasing quantities. To test this the quantities are printed in the comment and the quantities are switched off in the style settings.
This code is a result of a study and not intended for use as a worked out and full functioning strategy. Use it at your own risk. To make the code understandable for users that are not so much introduced into pine script (like me), every step in the code is commented to explain what it does. Hopefully it helps.
Enjoy!
VWAP+15EMA with RSIVWAP+EMA+RSI Strategy for the group MelléCasH
This strategy will enter a long position when the closing price is above both the VWAP and the 15 EMA, and the RSI is above the specified overbought level. It will exit the position when the price falls by the specified stop loss percentage, rises by the specified take profit percentage, or when the trailing stop loss (which trails the highest price achieved after the position was entered by the specified percentage) is hit. The VWAP, EMA, and RSI indicators are also plotted on the chart for reference.
Moving Average Trap Strategy by D. BrigagliaThis is a strategy that follows the 200 periods moving average and fades the cross of ma3, ma5 and ma8. It is designed for profiting by mean reversion while at the same time respecting long term trend. It is designed for long term trending markets such as stocks and stock indices.
In this backtest, the strategy shows the ability to beat the S&P500 index with an average slippage set to 2 ticks. The number of trades is good (350), the profit factor is acceptable (1.67). The drawdowns are also reduced compared to the underlying asset.
Nothing of my content is financial advice.
Grospector DCA V.3This is system for DCA with strategy.
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
Kitchen [ilovealgotrading]
OVERVIEW:
Kitchen is a strategy that aims to trade in the direction of the trend by using supertrend and stochRsi data by calculating at different time values.
IMPLEMENTATION DETAILS – SETTINGS:
First of all, let's understand the supertrend and stocrsi indicators.
How do you read and use Super Trend for trading ?
The price is often going upwards when it breaks the super trend line while keeping its position above the indication level.
When the market is in a bullish trend, the indicator becomes green. The indicator level will act as trendline support in such a scenario. The color of the indicator changes to red to indicate a negative trend once the price crosses the support line. The price uses the super trend level as a trendline resistance during a bearish move.
In our strategy, if our 1-hour and 4-hour supertrend lines show the up or down train in the same direction at the same time, we can assume that a train is forming here.
Why do I use the time of 1 hour and 4 hours ?
When I did a backtest from the past to the present, I discovered that the most accurate and consistent time zones are the 1 hour and 4 hour time zones.
By the way we can change our short term timeframe(1H) and long term timeframe(4H) from settings panel.
How do you read and use the Stoch-RSI Indicator?
This indicator analyzes price dynamics automatically to detect overbought and oversold locations.
The indicator includes:
- The primary line, which typically has values between 0 and 100;
- Two dynamic levels for overbought and oversold conditions.
IF our stoch-rsi indicator value has fallen below our lower boundary line, the oversold event has been observed in the price, if our stoch-rsi value breaks up our bottom line after becoming oversold, we think that the price will start the recovery phase.(The case is also true for the opposite.)
However, this does not always apply and we need additional approvals, Therefore, our 1H and 4H supertrrend indicator provides us with additional confirmation.
Buy Condition:
Our 1H(short term) and 4H(long term) supertrrend indicator, has given the buy signal(green line and yellow line), and if our stochrsi indicator has broken our oversold line up on the past 15 bars, the buy signal is formed here.
Sell Condition:
Our 1H(short term) and 4H(long term) supertrrend indicator, has given the sell signal(red line and orange line), and if our stochrsi indicator has broken our overbuy line down on the past 15 bars, the sell signal is formed here.
Stop Loss or Take Profit Conditions:
Exit Long Senerio:
All conditions are completed, the buy signal has arrived and we have entered a LONG trade, the 1-hour supertrend line follows the price rise(yellow line), if the price breaks below the 1-hour super trend line and a sell condition occurs for 1H timeframe for supertrend indcator, LONG trade will exit here.
Exit Short Senerio:
All conditions are completed, the Sell signal has arrived and we have entered a SHORT trade, the 1-hour supertrend line follows the price down(orange line), if the price breaks up the 1-hour super trend line and a buy condition occurs for 1H timeframe for supertrend indcator, SHORT trade will exit here.
What can you change in the settings panel?
1-We can set Start and End date for backtest and future alarms
2-We can set ATR length and Factor for supertrend indicator
3-We can set our short term and long term timeframe value
4-We can set StochRsi Up and Low limit to confirm buy and sell conditions
5-We can set stochrsi retroactive approval length
6-We can set stochrsi values or the length
7-We can set Dollar cost for per position
8- We can choose the direction of our positions, we can set only LONG, only SHORT or both directions.
9-IF you want to place automatic buy and sell orders with this strategy, you can paste your codes into the Long open-close or Short open-close message sections.
For example
IF you write your alert window this code {{strategy.order.alert_message}}.
When trigger Long signal you will get dynamically what you pasted here for Long Open Message
ALSO:
Please do not open trades without properly managing your risk and psychology!!!
If you have any ideas what to add to my work to add more sources or make calculations cooler, suggest in DM .
Mean Reversion and TrendfollowingTitle: Mean Reversion and Trendfollowing
Introduction:
This script presents a hybrid trading strategy that combines mean reversion and trend following techniques. The strategy aims to capitalize on short-term price corrections during a downtrend (mean reversion) as well as ride the momentum of a trending market (trend following). It uses a 200-period Simple Moving Average (SMA) and a 2-period Relative Strength Index (RSI) to generate buy and sell signals.
Key Features:
Combines mean reversion and trend following techniques
Utilizes 200-period SMA and 2-period RSI
Customizable starting date
Allows for enabling/disabling mean reversion or trend following modes
Adjustable position sizing for trend following and mean reversion
Script Description:
The script implements a trading strategy that combines mean reversion and trend following techniques. Users can enable or disable either of these techniques through the input options. The strategy uses a 200-period Simple Moving Average (SMA) and a 2-period Relative Strength Index (RSI) to generate buy and sell signals.
The mean reversion mode is active when the price is below the SMA200, while the trend following mode is active when the price is above the SMA200. The script generates buy signals when the RSI is below 20 (oversold) in mean reversion mode or when the price is above the SMA200 in trend following mode. The script generates sell signals when the RSI is above 80 (overbought) in mean reversion mode or when the price falls below 95% of the SMA200 in trend following mode.
Users can adjust the position sizing for both trend following and mean reversion modes using the input options.
To use this script on TradingView, follow these steps:
Open TradingView and load your preferred chart.
Click on the 'Pine Editor' tab located at the bottom of the screen.
Paste the provided script into the Pine Editor.
Click 'Add to Chart' to apply the strategy to your chart.
Please note that the past performance of any trading system or methodology is not necessarily indicative of future results. Always use proper risk management and consult a financial advisor before making any investment decisions.
------
The following is a summary of the underlying whitepaper (onlinelibrary.wiley.com) for this strategy:
This paper proposes a theory of securities market under- and overreactions based on two psychological biases: investor overconfidence about the precision of private information and biased self-attribution, which causes asymmetric shifts in investors' confidence as a function of their investment outcomes. The authors show that overconfidence implies negative long-lag autocorrelations, excess volatility, and public-event-based return predictability. Biased self-attribution adds positive short-lag autocorrelations (momentum), short-run earnings "drift," and negative correlation between future returns and long-term past stock market and accounting performance.
The paper explains that there is empirical evidence challenging the traditional view that securities are rationally priced to reflect all publicly available information. Some of these anomalies include event-based return predictability, short-term momentum, long-term reversal, high volatility of asset prices relative to fundamentals, and short-run post-earnings announcement stock price "drift."
The authors argue that investor overconfidence can lead to stock prices overreacting to private information signals and underreacting to public signals. This overreaction-correction pattern is consistent with long-run negative autocorrelation in stock returns, excess volatility, and further implications for volatility conditional on the type of signal. The market's tendency to over- or underreact to different types of information allows the authors to address the pattern that average announcement date returns in virtually all event studies are of the same sign as the average post-event abnormal returns.
Biased self-attribution implies short-run momentum and long-term reversals in security prices. The dynamic analysis based on biased self-attribution can also lead to a lag-dependent response to corporate events. Cash flow or earnings surprises at first tend to reinforce confidence, causing a same-direction average stock price trend. Later reversal of overreaction can lead to an opposing stock price trend.
The paper concludes by summarizing the findings, relating the analysis to the literature on exogenous noise trading, and discussing issues related to the survival of overconfident traders in financial markets.
The Flash-Strategy (Momentum-RSI, EMA-crossover, ATR)The Flash-Strategy (Momentum-RSI, EMA-crossover, ATR)
Are you tired of manually analyzing charts and trying to find profitable trading opportunities? Look no further! Our algorithmic trading strategy, "Flash," is here to simplify your trading process and maximize your profits.
Flash is an advanced trading algorithm that combines three powerful indicators to generate highly selective and accurate trading signals. The Momentum-RSI, Super-Trend Analysis and EMA-Strategy indicators are used to identify the strength and direction of the underlying trend.
The Momentum-RSI signals the strength of the trend and only generates trading signals in confirmed upward or downward trends. The Super-Trend Analysis confirms the trend direction and generates signals when the price breaks through the super-trend line. The EMA-Strategy is used as a qualifier for the generation of trading signals, where buy signals are generated when the EMA crosses relevant trend lines.
Flash is highly selective, as it only generates trading signals when all three indicators align. This ensures that only the highest probability trades are taken, resulting in maximum profits.
Our trading strategy also comes with two profit management options. Option 1 uses the so-called supertrend-indicator which uses the dynamic ATR as a key input, while option 2 applies pre-defined, fixed SL and TP levels.
The settings for each indicator can be customized, allowing you to adjust the length, limit value, factor, and source value to suit your preferences. You can also set the time period in which you want to run the backtest and how many dollar trades you want to open in each position for fully automated trading.
Choose your preferred trade direction and stop-loss/take-profit settings, and let Flash do the rest. Say goodbye to manual chart analysis and hello to consistent profits with Flash. Try it now!
General Comments
This Flash Strategy has been developed in cooperation between Baby_whale_to_moon and JS-TechTrading. Cudos to Baby_whale_to_moon for doing a great job in transforming sophisticated trading ideas into pine scripts.
Detailed Description
The “Flash” script considers the following indicators for the generation of trading signals:
1. Momentum-RSI
2. ‘Super-Trend’-Analysis
3. EMA-Strategy
1. Momentum-RSI
• This indicator signals the strength of the underlying upward- or downward-trend.
• The signal range of this indicator is from 0 to 100. Values > 60 indicate a confirmed upward- or downward-trend.
• The strategy will only generate trading signals in case the stock (or any other financial security) is in a confirmed upward- (long entry signals) or downward-trend (short entry signals).
• This indicator provides information with regards to the strength of the underlying trend and it does not give any insight with regard to the direction of the trend. Therefore, this strategy also considers other indicators which provide technical confirmation with regards to the direction of the underlying trend.
Graph 1 shows this concept:
• The Momentum-RSI indicator gives lower readings during consolidation phases and no trading signals are generated during these periods.
Example (graph 2):
2. Super-Trend Analysis
• The red line in the graph below represents the so-called super-trend-line. Trading signals are only generated in case the price action breaks through this super-trend-line indicating a new confirmed upward-trend (or downward-trend, respectively).
• If that happens, the super trend-line changes its color from red to green, giving confirmation that the trend changed from bearish to bullish and long-entries can be considered.
• The vice-versa approach can be considered for short entries.
Graph 3 explains this concept:
3. Exponential Moving Average / EMA-Strategy
The functionality of this EMA-element of the strategy has been programmed as follows:
• The exponential moving average and two other trend lines are being used as qualifiers for the generation of trading-signals.
• Buy-signals for long-entries are only considered in case the EMA (yellow line in the graph below) crosses the red line.
• Sell-signals for short-entries are only considered in case the EMA (yellow line in the graph below) crosses the green line.
An example is shown in graph 4 below:
We use this indicator to determine the new trend direction that may occur by using the data of the price's past movement.
4. Bringing it all together
This section describes in detail, how this strategy combines the Momentum-RSI, the super-trend analysis and the EMA-strategy.
The strategy only generates trading-signals in case all of the following conditions and qualifiers are being met:
1. Momentum-RSI is higher than the set value of this strategy. The standard and recommended value is 60 (graph 5):
2. The super-trend analysis needs to indicate a confirmed upward-trend (for long-entry signals) or a confirmed downward-trend (for short-entry signals), respectively.
3. The EMA-strategy needs to indicate that the stock or financial security is in a confirmed upward-trend (long-entries) or downward-trend (short-entries), respectively.
The strategy will only generate trading signals if all three qualifiers are being met. This makes this strategy highly selective and is the key secret for its success.
Example for Long-Entry (graph 6):
When these conditions are met, our Long position is opened.
Example for Short-Entry (graph 7):
Trade Management Options (graph 8)
Option 1
In this dynamic version, the so-called supertrend-indicator is being used for the trade exit management. This supertrend-indicator is a sophisticated and optimized methodology which uses the dynamic ATR as one of its key input parameters.
The following settings of the supertrend-indicator can be changed and optimized (graph 9):
The dynamic SL/TP-lines of the supertrend-indicator are shown in the charts. The ATR-length and the supertrend-factor result in a multiplier value which can be used to fine-tune and optimize this strategy based on the financial security, timeframe and overall market environment.
Option 2 (graph 10):
Option 2 applies pre-defined, fixed SL and TP levels which will appear as straight horizontal lines in the chart.
Settings options (graph 11):
The following settings can be changed for the three elements of this strategy:
1. (Length Mom-Rsi): Length of our Mom-RSI indicator.
2. Mom-RSI Limit Val: the higher this number, the more momentum of the underlying trend is required before the strategy will start creating trading signals.
3. The length and factor values of the super trend indicator can be adjusted:ATR Length SuperTrend and Factor Super Trend
4. You can set the source value used by the ema trend indicator to determine the ema line: Source Ema Ind
5. You can set the EMA length and the percentage value to follow the price: Length Ema Ind and Percent Ema Ind
6. The backtesting period can be adjusted: Start and End time of BackTest
7. Dollar cost per position: this is relevant for 100% fully automated trading.
8. Trade direction can be adjusted: LONG, SHORT or BOTH
9. As we explained above, we can determine our stop-loss and take-profit levels dynamically or statically. (Version 1 or Version 2 )
Display options on the charts graph 12):
1. Show horizontal lines for the Stop-Loss and Take-profit levels on the charts.
2. Display relevant Trend Lines, including color setting options for the supertrend functionality. In the example below, green lines indicate a confirmed uptrend, red lines indicate a confirmed downtrend.
Other comments
• This indicator has been optimized to be applied for 1 hour-charts. However, the underlying principles of this strategy are supply and demand in the financial markets and the strategy can be applied to all timeframes. Daytraders can use the 1min- or 5min charts, swing-traders can use the daily charts.
• This strategy has been designed to identify the most promising, highest probability entries and trades for each stock or other financial security.
• The combination of the qualifiers results in a highly selective strategy which only considers the most promising swing-trading entries. As a result, you will normally only find a low number of trades for each stock or other financial security per year in case you apply this strategy for the daily charts. Shorter timeframes will result in a higher number of trades / year.
• Consequently, traders need to apply this strategy for a full watchlist rather than just one financial security.
Advanced VWAP_Pullback Strategy_Trend-Template QualifierGeneral Description and Unique Features of this Script
Introducing the Advanced VWAP Momentum-Pullback Strategy (long-only) that offers several unique features:
1. Our script/strategy utilizes Mark Minervini's Trend-Template as a qualifier for identifying stocks and other financial securities in confirmed uptrends. Mark Minervini, a 2x US Investment Champion, developed the Trend-Template, which covers eight different and independent characteristics that can be adjusted and optimized in this trend-following strategy to ensure the best results. The strategy will only trigger buy-signals in case the optimized qualifiers are being met.
2. Our strategy is based on the supply/demand balance in the market, making it timeless and effective across all timeframes. Whether you are day trading using 1- or 5-min charts or swing-trading using daily charts, this strategy can be applied and works very well.
3. We have also integrated technical indicators such as the RSI and the MA / VWAP crossover into this strategy to identify low-risk pullback entries in the context of confirmed uptrends. By doing so, the risk profile of this strategy and drawdowns are being reduced to an absolute minimum.
Minervini’s Trend-Template and the ‘Stage-Analysis’ of the Markets
This strategy is a so-called 'long-only' strategy. This means that we only take long positions, short positions are not considered.
The best market environment for such strategies are periods of stable upward trends in the so-called stage 2 - uptrend.
In stable upward trends, we increase our market exposure and risk.
In sideways markets and downward trends or bear markets, we reduce our exposure very quickly or go 100% to cash and wait for the markets to recover and improve. This allows us to avoid major losses and drawdowns.
This simple rule gives us a significant advantage over most undisciplined traders and amateurs!
'The Trend is your Friend'. This is a very old but true quote.
What's behind it???
• 98% of stocks made their biggest gains in a Phase 2 upward trend.
• If a stock is in a stable uptrend, this is evidence that larger institutions are buying the stock sustainably.
• By focusing on stocks that are in a stable uptrend, the chances of profit are significantly increased.
• In a stable uptrend, investors know exactly what to expect from further price developments. This makes it possible to locate low-risk entry points.
The goal is not to buy at the lowest price – the goal is to buy at the right price!
Each stock goes through the same maturity cycle – it starts at stage 1 and ends at stage 4
Stage 1 – Neglect Phase – Consolidation
Stage 2 – Progressive Phase – Accumulation
Stage 3 – Topping Phase – Distribution
Stage 4 – Downtrend – Capitulation
This strategy focuses on identifying stocks in confirmed stage 2 uptrends. This in itself gives us an advantage over long-term investors and less professional traders.
By focusing on stocks in a stage 2 uptrend, we avoid losses in downtrends (stage 4) or less profitable consolidation phases (stages 1 and 3). We are fully invested and put our money to work for us, and we are fully invested when stocks are in their stage 2 uptrends.
But how can we use technical chart analysis to find stocks that are in a stable stage 2 uptrend?
Mark Minervini has developed the so-called 'trend template' for this purpose. This is an essential part of our JS-TechTrading pullback strategy. For our watchlists, only those individual values that meet the tough requirements of Minervini's trend template are eligible.
The Trend Template
• 200d MA increasing over a period of at least 1 month, better 4-5 months or longer
• 150d MA above 200d MA
• 50d MA above 150d MA and 200d MA
• Course above 50d MA, 150d MA and 200d MA
• Ideally, the 50d MA is increasing over at least 1 month
• Price at least 25% above the 52w low
• Price within 25% of 52w high
• High relative strength according to IBD.
NOTE: In this basic version of the script, the Trend-Template has to be used as a separate indicator on TradingView (Public Trend-Template indicators are available in TradingView – community scripts). It is recommended to only execute buy signals in case the stock or financial security is in a stage 2 uptrend, which means that the criteria of the trend-template are fulfilled.
This strategy can be applied to all timeframes from 5 min to daily.
The VWAP Momentum-Pullback Strategy
For the JS-TechTrading VWAP Momentum-Pullback Strategy, only stocks and other financial instruments that meet the selected criteria of Mark Minervini's trend template are recommended for algorithmic trading with this startegy.
A further prerequisite for generating a buy signals is that the individual value is in a short-term oversold state (RSI).
When the selling pressure is over and the continuation of the uptrend can be confirmed by the MA / VWAP crossover after reaching a price low, a buy signal is issued by this strategy.
Stop-loss limits and profit targets can be set variably. You also have the option to make use of the trailing stop exit strategy.
Relative Strength Index (RSI)
The Relative Strength Index (RSI) is a technical indicator developed by Welles Wilder in 1978. The RSI is used to perform a market value analysis and identify the strength of a trend as well as overbought and oversold conditions. The indicator is calculated on a scale from 0 to 100 and shows how much an asset has risen or fallen relative to its own price in recent periods.
The RSI is calculated as the ratio of average profits to average losses over a certain period of time. A high value of the RSI indicates an overbought situation, while a low value indicates an oversold situation. Typically, a value > 70 is considered an overbought threshold and a value < 30 is considered an oversold threshold. A value above 70 signals that a single value may be overvalued and a decrease in price is likely , while a value below 30 signals that a single value may be undervalued and an increase in price is likely.
For example, let's say you're watching a stock XYZ. After a prolonged falling movement, the RSI value of this stock has fallen to 26. This means that the stock is oversold and that it is time for a potential recovery. Therefore, a trader might decide to buy this stock in the hope that it will rise again soon.
The MA / VWAP Crossover Trading Strategy
This strategy combines two popular technical indicators: the Moving Average (MA) and the Volume Weighted Average Price (VWAP). The MA VWAP crossover strategy is used to identify potential trend reversals and entry/exit points in the market.
The VWAP is calculated by taking the average price of an asset for a given period, weighted by the volume traded at each price level. The MA, on the other hand, is calculated by taking the average price of an asset over a specified number of periods. When the MA crosses above the VWAP, it suggests that buying pressure is increasing, and it may be a good time to enter a long position. When the MA crosses below the VWAP, it suggests that selling pressure is increasing, and it may be a good time to exit a long position or enter a short position.
Traders typically use the MA VWAP crossover strategy in conjunction with other technical indicators and fundamental analysis to make more informed trading decisions. As with any trading strategy, it is important to carefully consider the risks and potential rewards before making any trades.
This strategy is applicable to all timeframes and the relevant parameters for the underlying indicators (RSI and MA/VWAP) can be adjusted and optimized as needed.
Backtesting
Backtesting gives outstanding results on all timeframes and drawdowns can be reduced to a minimum level. In this example, the hourly chart for MCFT has been used.
Settings for backtesting are:
- Period from Jan 2020 until March 2023
- Starting capital 100k USD
- Position size = 25% of equity
- 0.01% commission = USD 2.50.- per Trade
- Slippage = 2 ticks
Other comments
- This strategy has been designed to identify the most promising, highest probability entries and trades for each stock or other financial security.
- The combination of the Trend-Template and the RSI qualifiers results in a highly selective strategy which only considers the most promising swing-trading entries. As a result, you will normally only find a low number of trades for each stock or other financial security per year in case you apply this strategy for the daily charts. Shorter timeframes will result in a higher number of trades / year.
- Consequently, traders need to apply this strategy for a full watchlist rather than just one financial security.
Cycle Position TradingTitle: Cycle Position Trading Strategy v1.0
Description: Cycle Position Trading Strategy is a simple yet effective trading strategy based on a 200-day Simple Moving Average (SMA). Users can select between two modes, "Buy Uptrend" and "Buy Downtrend," to customize the strategy according to their trading preferences. The strategy allows users to set their own stop loss (SL) and take profit (TP) levels, providing more flexibility and control over their trades.
Features:
Choose between two trading modes: "Buy Uptrend" and "Buy Downtrend."
Customize your stop loss (SL) and take profit (TP) levels.
Clear visual representation of the 200-day Simple Moving Average (SMA) on the chart.
How to use:
Add the strategy to your chart by searching for "Cycle Position Trading Strategy" in the TradingView "Indicators & Strategies" section.
Configure the strategy settings according to your preferences:
Select the trading mode from the dropdown menu. "Buy Uptrend" will open long positions when the closing price is above the 200-day SMA. "Buy Downtrend" will open long positions when the closing price is below the 200-day SMA.
Set your desired stop loss (SL) and take profit (TP) levels. The default values are 0.9 (10% below the entry price) for the stop loss and 1.1 (10% above the entry price) for the take profit.
Monitor the chart for trade signals based on the chosen mode and settings. The strategy will enter and exit trades automatically based on the selected mode and the configured stop loss and take profit levels.
Analyze the performance of the strategy by checking the TradingView strategy performance summary or by viewing individual trades in the "Trades" list.
Disclaimer: This strategy is intended for educational and illustrative purposes only. Use it at your own risk. Past performance is not indicative of future results. Trading stocks, cryptocurrencies, or any other financial instrument involves significant risk and may result in the loss of capital.
Version: v1.0
Release date: 2023-03-25
Author: I11L
License: Mozilla Public License 2.0 (mozilla.org)
Daily Investments Index ScalpThis strategy is based on the DIDI index with our own confirmations and calculated SL/TP .
You can change every setting if you want it to use for another pair, but this is fine tuned for NATURALGAS
The entries are taken when:
Long:
- Buy signal from the DIDI indicator
- Long EMA is underneath the Short EMA
- Price must be Above the Long EMA
- TP1 (default) - ATR based first TP is ATR * 1.2 Multiplier
- TP2 (default) - ATR based first TP is ATR * 2 Multiplier
- TP2 SL is the strategy entry price when we hit the first TP
- SL (default) - Latest swing low with a look back of 17 candles
Short:
- Sell signal from the DIDI indicator
- Long EMA is Above the Short EMA
- Price must be Below the Long EMA
- TP1 (default) - ATR based first TP is ATR * 1.2 Multiplier
- TP2 (default) - ATR based first TP is ATR * 2 Multiplier
- TP2 SL is the strategy entry price when we hit the first TP
- SL (default) - Latest swing low with a look back of 17 candles
It's fairly simple, and i think you can use this base so extend your own strategy
Good luck :)
If you have any questions, feel free to comment
JS-TechTrading: VWAP Momentum_Pullback StrategyGeneral Description and Unique Features of this Script
Introducing the VWAP Momentum-Pullback Strategy (long-only) that offers several unique features:
1. Our script/strategy utilizes Mark Minervini's Trend-Template as a qualifier for identifying stocks and other financial securities in confirmed uptrends.
NOTE: In this basic version of the script, the Trend-Template has to be used as a separate indicator on TradingView (Public Trend-Template indicators are available on TradingView – community scripts). It is recommended to only execute buy signals in case the stock or financial security is in a stage 2 uptrend, which means that the criteria of the trend-template are fulfilled.
2. Our strategy is based on the supply/demand balance in the market, making it timeless and effective across all timeframes. Whether you are day trading using 1- or 5-min charts or swing-trading using daily charts, this strategy can be applied and works very well.
3. We have also integrated technical indicators such as the RSI and the MA / VWAP crossover into this strategy to identify low-risk pullback entries in the context of confirmed uptrends. By doing so, the risk profile of this strategy and drawdowns are being reduced to an absolute minimum.
Minervini’s Trend-Template and the ‘Stage-Analysis’ of the Markets
This strategy is a so-called 'long-only' strategy. This means that we only take long positions, short positions are not considered.
The best market environment for such strategies are periods of stable upward trends in the so-called stage 2 - uptrend.
In stable upward trends, we increase our market exposure and risk.
In sideways markets and downward trends or bear markets, we reduce our exposure very quickly or go 100% to cash and wait for the markets to recover and improve. This allows us to avoid major losses and drawdowns.
This simple rule gives us a significant advantage over most undisciplined traders and amateurs!
'The Trend is your Friend'. This is a very old but true quote.
What's behind it???
• 98% of stocks made their biggest gains in a Phase 2 upward trend.
• If a stock is in a stable uptrend, this is evidence that larger institutions are buying the stock sustainably.
• By focusing on stocks that are in a stable uptrend, the chances of profit are significantly increased.
• In a stable uptrend, investors know exactly what to expect from further price developments. This makes it possible to locate low-risk entry points.
The goal is not to buy at the lowest price – the goal is to buy at the right price!
Each stock goes through the same maturity cycle – it starts at stage 1 and ends at stage 4
Stage 1 – Neglect Phase – Consolidation
Stage 2 – Progressive Phase – Accumulation
Stage 3 – Topping Phase – Distribution
Stage 4 – Downtrend – Capitulation
This strategy focuses on identifying stocks in confirmed stage 2 uptrends. This in itself gives us an advantage over long-term investors and less professional traders.
By focusing on stocks in a stage 2 uptrend, we avoid losses in downtrends (stage 4) or less profitable consolidation phases (stages 1 and 3). We are fully invested and put our money to work for us, and we are fully invested when stocks are in their stage 2 uptrends.
But how can we use technical chart analysis to find stocks that are in a stable stage 2 uptrend?
Mark Minervini has developed the so-called 'trend template' for this purpose. This is an essential part of our JS-TechTrading pullback strategy. For our watchlists, only those individual values that meet the tough requirements of Minervini's trend template are eligible.
The Trend Template
• 200d MA increasing over a period of at least 1 month, better 4-5 months or longer
• 150d MA above 200d MA
• 50d MA above 150d MA and 200d MA
• Course above 50d MA, 150d MA and 200d MA
• Ideally, the 50d MA is increasing over at least 1 month
• Price at least 25% above the 52w low
• Price within 25% of 52w high
• High relative strength according to IBD.
NOTE: In this basic version of the script, the Trend-Template has to be used as a separate indicator on TradingView (Public Trend-Template indicators are available in TradingView – community scripts). It is recommended to only execute buy signals in case the stock or financial security is in a stage 2 uptrend, which means that the criteria of the trend-template are fulfilled.
This strategy can be applied to all timeframes from 5 min to daily.
The VWAP Momentum-Pullback Strateg y
For the JS-TechTrading VWAP Momentum-Pullback Strategy, only stocks and other financial instruments that meet the selected criteria of Mark Minervini's trend template are recommended for algorithmic trading with this startegy.
A further prerequisite for generating a buy signals is that the individual value is in a short-term oversold state (RSI).
When the selling pressure is over and the continuation of the uptrend can be confirmed by the MA / VWAP crossover after reaching a price low, a buy signal is issued by this strategy.
Stop-loss limits and profit targets can be set variably.
Relative Strength Index (RSI)
The Relative Strength Index (RSI) is a technical indicator developed by Welles Wilder in 1978. The RSI is used to perform a market value analysis and identify the strength of a trend as well as overbought and oversold conditions. The indicator is calculated on a scale from 0 to 100 and shows how much an asset has risen or fallen relative to its own price in recent periods.
The RSI is calculated as the ratio of average profits to average losses over a certain period of time. A high value of the RSI indicates an overbought situation, while a low value indicates an oversold situation. Typically, a value > 70 is considered an overbought threshold and a value < 30 is considered an oversold threshold. A value above 70 signals that a single value may be overvalued and a decrease in price is likely , while a value below 30 signals that a single value may be undervalued and an increase in price is likely.
For example, let's say you're watching a stock XYZ. After a prolonged falling movement, the RSI value of this stock has fallen to 26. This means that the stock is oversold and that it is time for a potential recovery. Therefore, a trader might decide to buy this stock in the hope that it will rise again soon.
The MA / VWAP Crossover Trading Strategy
This strategy combines two popular technical indicators: the Moving Average (MA) and the Volume Weighted Average Price (VWAP). The MA VWAP crossover strategy is used to identify potential trend reversals and entry/exit points in the market.
The VWAP is calculated by taking the average price of an asset for a given period, weighted by the volume traded at each price level. The MA, on the other hand, is calculated by taking the average price of an asset over a specified number of periods. When the MA crosses above the VWAP, it suggests that buying pressure is increasing, and it may be a good time to enter a long position. When the MA crosses below the VWAP, it suggests that selling pressure is increasing, and it may be a good time to exit a long position or enter a short position.
Traders typically use the MA VWAP crossover strategy in conjunction with other technical indicators and fundamental analysis to make more informed trading decisions. As with any trading strategy, it is important to carefully consider the risks and potential rewards before making any trades.
This strategy is applicable to all timeframes and the relevant parameters for the underlying indicators (RSI and MA/VWAP) can be adjusted and optimized as needed.
Backtesting
Backtesting gives outstanding results on all timeframes and drawdowns can be reduced to a minimum level. In this example, the hourly chart for MCFT has been used.
Settings for backtesting are:
- Period from April 2020 until April 2021 (1 yr)
- Starting capital 100k USD
- Position size = 25% of equity
- 0.01% commission = USD 2.50.- per Trade
- Slippage = 2 ticks
Other comments
• This strategy has been designed to identify the most promising, highest probability entries and trades for each stock or other financial security.
• The RSI qualifier is highly selective and filters out the most promising swing-trading entries. As a result, you will normally only find a low number of trades for each stock or other financial security per year in case you apply this strategy for the daily charts. Shorter timeframes will result in a higher number of trades / year.
• As a result, traders need to apply this strategy for a full watchlist rather than just one financial security.
Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt]Someone sent me this strategy found on YouTube. It is Soheil PKO's "The Best and Most Profitable Scalping Strategy" Best way to find out is to code it =)
This strategy uses Moving Average Ribbon, Laguerre RSI, and ADX. This script only displays the MA ribbon, you will need to add Laguerre RSI and ADX separately.
Long Entry Criteria:
- 16 EMA > 48 EMA > 200 SMA
- Laguerre RSI > 80
- ADX > 20
Long Exit Criterion:
- 16 EMA < 48 EMA
Short Entry Criteria:
- 16 EMA < 48 EMA < 200 SMA
- Laguerre RSI < 20
- ADX > 20
Short Exit Criterion:
- 16 EMA > 48 EMA
As mentioned in the video, risk management is very important, especially for scalping strategies. Therefore, I've added option for setting Stop Loss and Price Target in the options for you guys to play with.
All parameters are configurable.
Enjoy~~
Simple_RSI+PA+DCA StrategyThis strategy is a result of a study to understand better the workings of functions, for loops and the use of lines to visualize price levels. The strategy is a complete rewrite of the older RSI+PA+DCA Strategy with the goal to make it dynamic and to simplify the strategy settings to the bare minimum.
In case you are not familiar with the older RSI+PA+DCA Strategy, here is a short explanation of the idea behind the strategy:
The idea behind the strategy based on an RSI strategy of buying low. A position is entered when the RSI and moving average conditions are met. The position is closed when it reaches a specified take profit percentage. As soon as the first the position is opened multiple PA (price average) layers are setup based on a specified percentage of price drop. When the price hits the layer another position with the same position size is is opened. This causes the average cost price (the white line) to decrease. If the price drops more, another position is opened with another price average decrease as result. When the price starts rising again the different positions are separately closed when each reaches the specified take profit. The positions can be re-opened when the price drops again. And so on. When the price rises more and crosses over the average price and reached the specified Stop level (the red line) on top of it, it closes all the positions at once and cancels all orders. From that moment on it waits for another price dip before it opens a new position.
This is the old RSI+PA+DCA Strategy:
The reason to completely rewrite the code for this strategy is to create a more automated, adaptable and dynamic system. The old version is static and because of the linear use of code the amount of DCA levels were fixed to max 6 layers. If you want to add more DCA layers you manually need to change the script and add extra code. The big difference in the new version is that you can specify the amount of DCA layers in the strategy settings. The use of 'for loops' in the code gives the possibility to make this very dynamic and adaptable.
The RSI code is adapted, just like the old version, from the RSI Strategy - Buy The Dips by Coinrule and is used for study purpose. Any other low/dip finding indicator can be used as well
The distance between the DCA layers are calculated exponentially in a function. In the settings you can define the exponential scale to create the distance between the layers. The bigger the scale the bigger the distance. This calculation is not working perfectly yet and needs way more experimentation. Feel free to leave a comment if you have a better idea about this.
The idea behind generating DCA layers with a 'for loop' is inspired by the Backtesting 3commas DCA Bot v2 by rouxam .
The ideas for creating a dynamic position count and for opening and closing different positions separately based on a specified take profit are taken from the Simple_Pyramiding strategy I wrote previously.
This code is a result of a study and not intended for use as a full functioning strategy. To make the code understandable for users that are not so much introduced into pine script (like myself), every step in the code is commented to explain what it does. Hopefully it helps.
Enjoy!
Negroni MA & RSI Strategy, plus trade entry and SL/TP optionsI will start with the context, and some things to think about when using a strategy tool to back-test ideas.
CONTEXT
FIRST: This is derived from other people's work, but I honestly hadn't found a mixed indicator MA strategy tool that does what this now does. If it is out there, apologies!!
This tool can help back-test various MA trends (SMA, EMA, HMA, VWMA); as well as factoring in RSI levels (or not); and can factor in a fixed HTF MA (or not). You can apply a 'retest entry' or a 'breakout entry', and you can also apply various risk mgt for SL/TP orders: 1) No SL/TP; or 2) a fixed %, or 3) dynamic ATR multipliers.
Find below, some details explaining what this tool is attempting to do.
Thank you, tack, salute!
THINGS TO REVIEW (it is not just about 'profitability'!!)
Whilst discretion is always highly encouraged as a trader, and a 100% indicator-driven strategy is VERY unlikely to yield sustainable results going forward, at the very least back-testing your strategies can help provide some guidance, not just on win rate Vs profit factor, but other things including:
a) Trade frequency: if a strategy has an 75% win rate and profit factor of 4, with all your parameters and confluence checks, but only triggers 3 trades every 5 years, is that realistically implementable to your trading situation if you have a $10,000 account?
b) Trade entry type: is it consistently better to wait for a retest of an 'MA zone', or is it better to market buy/sell on breakout of the 'MA zone'?
c) Risk management (SL/TP): is it consistently better to have a fixed static % for SL/TP ("I always place my stops 2% away, whether it is EURUSD or BTCUSDT"), or would you be better placed to try using an ATR multiplier of the respective assets?
d) Moving average type: is your old faithful 100 EMA really serving you well, or is the classic SMA more reliable, or how about the HMA, or the VWMA? Is the 100/200 cross holding up, or do you need something more sensitive? Is there any significant difference between a 10 EMA/20 EMA trend zone compared to a 13 EMA /25 EMA zone?
e) Confluence: Do added confluence checks (RSI, higher timeframe MA) actually improve profitability? But even if they do, is at the cost of cutting too many trades?
INPUTS AND PARAMETERS
Choice 1) Entry Strategy: Retest or Breakout - You can select both!
[ ]:
a) RETEST entry strat: price crosses UNDER FastMA INTO the 'MA trend zone'.
b) BREAKOUT entry strat: price crosses OVER FastMA OUT the 'MA trend zone'.
Choice 2) Risk Management (SL and TP) - You can select more than 1 strategy!
a) No SL/TP: Long trades are closed when the LOW crosses back UNDER the fastMA again, and shorts are closed when the HIGH crosses back OVER the fastMA again.
b) Static % SL/TP: Your SL/TP will be a fixed % away from avg. position price... WARNING: You should change this for various asset classes; FX vol is not the same as crypto altcoin vol!
c) Dynamic ATR SL/TP: Your SL/TP is a multiple of your selected ATR range (default is 50, see 'info' when you select ATR range). ATR accounts for the change in vol of different asset classes somewhat, HOWEVER... you should probably still not have the same multiplier trading S&P500 as you would trading crypto altcoins!
Then select your preferred parameters: EMA, SMA, HMA, VWMA, etc. You can mix and match, and most options have a info/tooltip guide.
RSI note: If you don't care for RSI levels, then set buy signal at 1... i.e always buys! Similarly set sell signal at 99.
ATR note: standard ATR length is usually 14, however... your SL/TP will move POST entry, and can tighten or widen your initial SL/TP... for better AND usually for worse! Go find a trade (strat 3) on the chart, look at the SL/TP lines, now change the number to 5, you'll see.
Fixed HTF MA note: If you don't care for HTF MA confluence, just change the timeframe/options to match the 'Slow MA' options you've chosen.