Weekly RSI Buy/Sell SignalsWeekly RSI Buy/Sell Signal Indicator
This indicator is designed to help traders identify high-probability buy and sell opportunities on the weekly chart by using the Relative Strength Index (RSI). By utilizing weekly RSI values, this indicator ensures signals align with broader market trends, providing a clearer view of potential price reversals and continuation.
How It Works:
Weekly RSI Calculation: This script calculates the RSI using a 14-period setting, focusing on the weekly timeframe regardless of the user’s current chart view. The weekly RSI is derived using request.security, allowing for consistent signals even on intraday charts.
Signal Conditions:
Buy Signal: A buy signal appears when the RSI crosses above the oversold threshold of 30, suggesting that price may be gaining momentum after a potential bottom.
Sell Signal: A sell signal triggers when the RSI crosses below the overbought threshold of 70, indicating a possible momentum shift downwards.
Visual Cues:
Buy/Sell Markers: Clear green "BUY" and red "SELL" markers are displayed on the chart when buy or sell conditions are met, making it easy to identify entry and exit points.
RSI Line and Thresholds: The weekly RSI value is plotted in real time with color-coded horizontal lines at 30 (oversold) and 70 (overbought), providing a visual reference for key levels.
This indicator is ideal for traders looking for reliable, trend-based signals on higher timeframes and can be a helpful tool for filtering out shorter-term market noise.
Algotrading
Rolling Straddle PremiumScript is Basically intended to provide insight's on the Rolling Straddle premium for the selected index based on the input settings.
Important thing to consider for the script to work seamlessly:
Specify the LTP in the input field (need not be very accurate)
Specify the Expiry Date for the Option Strike.
Ensure Profile matches to the chart script (Index Script)
Note: Zones marked in Blue, is the max level that indicator can track the option prices. beyond which it may fail to track, during such time consider reloading the indicator with Latest LTP .
Labels on the chart indicate that If i had shorted the Straddle, what would be my current position of that Straddle. however the rational behind shorting is only the pivot high points (not sure if this is right or wrong! )
Note On Labels: Labels are delayed basis the pivot point candles specified in the indicator settings.
EN: Entry Price (Straddle Premium) of the Strike Specified.
Cur: Current Price ( Current Straddle Premium ) of the Strike Specified.
SH: Max Straddle Premium ( Increase in Premium ) since position is active.
SL: Min Straddle Premium ( Premium Erosion ) since position is active.
Approximate Spectral Entropy-Based Market Momentum (SEMM)Overview
The Approximate Spectral Entropy-Based Market Momentum (SEMM) indicator combines the concepts of spectral entropy and traditional momentum to provide traders with insights into both the strength and the complexity of market movements. By measuring the randomness or predictability of price changes, SEMM helps traders understand whether the market is in a trending or consolidating state and how strong that trend or consolidation might be.
Key Features
Entropy Measurement: Calculates the approximate spectral entropy of price movements to quantify market randomness.
Momentum Analysis: Integrates entropy with rate-of-change (ROC) to highlight periods of strong or weak momentum.
Dynamic Market Insight: Provides a dual perspective on market behavior—both the trend strength and the underlying complexity.
Customizable Parameters: Adjustable window length for entropy calculation, allowing for fine-tuning to suit different market conditions.
Concepts Underlying the Calculations
The indicator utilizes Shannon entropy, a concept from information theory, to approximate the spectral entropy of price returns. Spectral entropy traditionally involves a Fourier Transform to analyze the frequency components of a signal, but due to Pine Script limitations, this indicator uses a simplified approach. It calculates log returns over a rolling window, normalizes them, and then computes the Shannon entropy. This entropy value represents the level of disorder or complexity in the market, which is then multiplied by traditional momentum measures like the rate of change (ROC).
How It Works
Price Returns Calculation: The indicator first computes the log returns of price data over a specified window length.
Entropy Calculation: These log returns are normalized and used to calculate the Shannon entropy, representing market complexity.
Momentum Integration: The calculated entropy is then multiplied by the rate of change (ROC) of prices to generate the SEMM value.
Signal Generation: High SEMM values indicate strong momentum with higher randomness, while low SEMM values indicate lower momentum with more predictable trends.
How Traders Can Use It
Trend Identification: Use SEMM to identify strong trends or potential trend reversals. Low entropy values can indicate a trending market, whereas high entropy suggests choppy or consolidating conditions.
Market State Analysis: Combine SEMM with other indicators or chart patterns to confirm the market's state—whether it's trending, ranging, or transitioning between states.
Risk Management: Consider high SEMM values as a signal to be cautious, as they suggest increased market unpredictability.
Example Usage Instructions
Add the Indicator: Apply the "Approximate Spectral Entropy-Based Market Momentum (SEMM)" indicator to your chart.
Adjust Parameters: Modify the length parameter to suit your trading timeframe. Shorter lengths are more responsive, while longer lengths smooth out the signal.
Analyze the Output: Observe the blue line for entropy and the red line for SEMM. Look for divergences or confirmations with price action to guide your trades.
Combine with Other Tools: Use SEMM alongside moving averages, support/resistance levels, or other indicators to build a comprehensive trading strategy.
Multi-Spectral RSI Deviations [AlgoAlpha]🌌 Multi-Spectral RSI Deviations by AlgoAlpha - Dive into Market Dynamics! 🌠
Dive deep into the essence of market trends with our 🚀 Multi-Spectral RSI Deviations indicator, a comprehensive tool designed by AlgoAlpha to enhance your trading strategy. By harnessing the power of multiple RSI lengths and innovative smoothing techniques, this indicator offers a unique perspective on market momentum and potential reversals.
🔍 Key Features:
🎨 Customizable up and down colors for immediate trend recognition.
🔢 Three RSI lengths for multi-layered market analysis.
🔄 Various Moving Average (MA) types including SMA, EMA, and more for tailored smoothing.
✅ Bullish and Bearish divergence plotting for spotting potential reversals.
🕵️♂️ Adjustable divergence sensitivity settings to fine-tune signal detection.
🔔 Built-in alerts for trend shifts and reversal conditions, ensuring you never miss a trading opportunity.
🚀 Quick Guide to Using the Multi-Spectral RSI Deviations Indicator
🛠 Add the Indicator: Search for "Multi-Spectral RSI Deviations" in TradingView's Indicators & Strategies. Adjust the RSI lengths and MA settings to suit your trading strategy.
🔍 Market Analysis: Keep an eye on the color changes for trend direction and use divergence plots to anticipate potential market reversals.
🔔 Alerts Setup: Activate the built-in alerts for trend shifts and reversals to stay ahead of the game without having to constantly monitor the charts.
🧠 How It Works:
At the core of the Multi-Spectral RSI Deviations indicator is its ability to analyze the market through various RSI lengths, providing a comprehensive view of momentum. The indicator calculates the Relative Strength Index (RSI) over three different periods, creating a spectrum of momentum insights. These RSI values are then compared to each other to identify the momentum shifts within the market.
To refine these insights, the differences between these RSI values are smoothed using a selected Moving Average type, such as SMA, EMA, etc., based on user preference. This smoothing process helps in highlighting the overall trend direction and potential reversal points with greater clarity.
Furthermore, the indicator employs a color-coding system, where the plotted line changes color based on the momentum's direction—shifting to an up color for positive momentum and a down color for negative momentum. This visual cue enables traders to quickly discern the market trend at a glance.
Divergences between the price action and the indicator's values are another cornerstone of this tool. By plotting potential bullish and bearish divergences, the indicator provides early signals of possible trend reversals, offering traders a strategic advantage.
Embrace the power of our 🌌 Multi-Spectral RSI Deviations and elevate your trading to stellar heights! 🌠✨
Enhanced Candle Sticks [AlgoAlpha]🚀🌟 Introducing the Enhanced Candle Sticks by AlgoAlpha, a Pine Script tool designed to provide traders with an enhanced view of market dynamics through candlestick analysis. This script aims to visualise if price has hit the high or low of the candle first, aiding in back-testing, and to identify smaller trends using market structure.📊🔍
Key Features:
Timeframe Flexibility: Users can select their desired timeframe for analysis, offering a range of options from M15 to H12. This flexibility allows for detailed and specific timeframe analysis.
Micro Trend Identification: The script includes an option to enable 'MicroTrends', giving traders insights into smaller movements and trends within the larger market context.
Customizable Visuals: Traders can customize the colors of bullish and bearish candlesticks, enhancing visual clarity and personalizing the chart to their preferences.
State Tracking: The script tracks the 'state' of the market on lower timeframes to detect if the high or the low was formed first.
Warning System: When the selected timeframe does not match the chart timeframe, the script generates a warning, ensuring accurate analysis and preventing potential misinterpretations.
Usages:
Enhanced Back-testing: Users can now get a more accurate interpretation of the candlesticks by know if the high or the low came first (denoted with ⩚ or ⩛), especially in scenarios where the high and the low of the larger timeframe candle is touching both the take-profit and stop-loss levels.
Squeeze Analysis: Users can identify squeezes in price when the microtrend shows both an uptrend and a downtrend, possibly giving more insight into the market.
Lower Timeframe Market Structure Analysis: Microtrends form when the low of the candle is consecutively increasing and the high is consecutively falling, which means on a lower timeframe, price is forming higher lows or lower highs.
Basic Logic Explanation:
- The script starts by setting up the necessary parameters and importing the required library. Users can customize the timeframe, colors, and whether to enable micro trends and candlestick plotting.
- It then calculates the lower timeframe (1/12th of the current timeframe) for more detailed analysis. The `minutes` function helps in converting the selected timeframe into minutes.
- The script tracks new bars and calculates the highest and lowest values within an hour, using `ta.highestSince` and `ta.lowestSince`.
- It determines the market 'state' by checking if the current high is breaking the previous high and if the current low is breaking the previous low on lower timeframes to determine if the high or the low was formed first.
- The script uses the `plotchar` and `plotcandle` functions to visually represent these trends and states on the chart. This visual representation is key for quick and effective analysis.
Alerts:
Alerts can be set for microtrend formations:
This script is a valuable tool for traders looking to deepen their market analysis with enhanced candlestick visualization and micro trend tracking. 📈🔶💡
Standardized Median Proximity [AlgoAlpha]Introducing the Standardized Median Proximity by AlgoAlpha 🚀📊 – a dynamic tool designed to enhance your trading strategy by analyzing price fluctuations relative to the median value. This indicator is built to provide clear visual cues on the price deviation from its median, allowing for a nuanced understanding of market trends and potential reversals.
🔍 Key Features:
1. 📈 Median Tracking: At the core of this indicator is the calculation of the median price over a specified lookback period. By evaluating the current price against this median, the indicator provides a sense of whether the price is trending above or below its recent median value.
medianValue = ta.median(priceSource, lookbackLength)
2. 🌡️ Normalization of Price Deviation: The deviation of the price from the median is normalized using standard deviation, ensuring that the indicator's readings are consistent and comparable across different time frames and instruments.
standardDeviation = ta.stdev(priceDeviation, 45)
normalizedValue = priceDeviation / (standardDeviation + standardDeviation)
3. 📌 Boundary Calculations: The indicator sets upper and lower boundaries based on the normalized values, helping to identify overbought and oversold conditions.
upperBoundary = ta.ema(positiveValues, lookbackLength) + ta.stdev(positiveValues, lookbackLength) * stdDevMultiplier
lowerBoundary = ta.ema(negativeValues, lookbackLength) - ta.stdev(negativeValues, lookbackLength) * stdDevMultiplier
4. 🎨 Visual Appeal and Clarity: With carefully chosen colors, the plots provide an intuitive and clear representation of market states. Rising trends are indicated in a shade of green, while falling trends are shown in red.
5. 🚨 Alert Conditions: Stay ahead of market movements with customizable alerts for trend shifts and impulse signals, enabling timely decisions.
alertcondition(ta.crossover(normalizedValue, 0), "Bullish Trend Shift", "Median Proximity Crossover Zero Line")
🔧 How to Use:
- 🎯 Set your preferred lookback lengths and standard deviation multipliers to tailor the indicator to your trading style.
- 💹 Utilize the boundary plots to understand potential overbought or oversold conditions.
- 📈 Analyze the color-coded column plots for quick insights into the market's direction relative to the median.
- ⏰ Set alerts to notify you of significant trend changes or conditions that match your trading criteria.
Basic Logic Explained:
- The indicator first calculates the median of the selected price source over your chosen lookback period. This median serves as a baseline for measuring price deviation.
- It then standardizes this deviation by dividing it by the standard deviation of the price deviation over a 45-period lookback, creating a normalized value.
- Upper and lower boundaries are computed using the exponential moving average (EMA) and standard deviation of these normalized values, adjusted by your selected multiplier.
- Finally, color-coded plots provide a visual representation of these calculations, offering at-a-glance insights into market conditions.
Remember, while this tool offers valuable insights, it's crucial to use it as part of a comprehensive trading strategy, complemented by other analysis and indicators. Happy trading!
🚀
Median Proximity Percentile [AlgoAlpha]📊🚀 Introducing the "Median Proximity Percentile" by AlgoAlpha, a dynamic and sophisticated trading indicator designed to enhance your market analysis! This tool efficiently tracks median price proximity over a specified lookback period and finds it's percentile between 2 dynamic standard deviation bands, offering valuable insights for traders looking to make informed decisions.
🌟 Key Features:
Color-Coded Visuals: Easily interpret market trends with color-coded plots indicating bullish or bearish signals.
Flexibility: Customize the indicator with your preferred price source and lookback lengths to suit your trading strategy.
Advanced Alert System: Stay ahead with customizable alerts for key trend shifts and market conditions.
🔍 Deep Dive into the Code:
Choose your preferred price data source and define lookback lengths for median and EMA calculations. priceSource = input.source(close, "Source") and lookbackLength = input.int(21, minval = 1, title = "Lookback Length")
Calculate median value, price deviation, and normalized value to analyze market position relative to the median. medianValue = ta.median(priceSource, lookbackLength)
Determine upper and lower boundaries based on standard deviation and EMA. upperBoundary = ta.ema(positiveValues, lookbackLength) + ta.stdev(positiveValues, lookbackLength) * stdDevMultiplier
lowerBoundary = ta.ema(negativeValues, lookbackLength) - ta.stdev(negativeValues, lookbackLength) * stdDevMultiplier
Compute the percentile value to track market position within these boundaries. percentileValue = 100 * (normalizedValue - lowerBoundary)/(upperBoundary - lowerBoundary) - 50
Enhance your analysis with Hull Moving Average (HMA) for smoother trend identification. emaValue = ta.hma(percentileValue, emaLookbackLength)
Visualize trends with color-coded plots and characters for easy interpretation. plotColor = percentileValue > 0 ? colorUp : percentileValue < 0 ? colorDown : na
Set up advanced alerts to stay informed about significant market movements. // Alerts
alertcondition(ta.crossover(emaValue, 0), "Bullish Trend Shift", "Median Proximity Percentile Crossover Zero Line")
alertcondition(ta.crossunder(emaValue, 0), "Bearish Trend Shift", "Median Proximity Percentile Crossunder Zero Line")
alertcondition(ta.crossunder(emaValue,emaValue ) and emaValue > 90, "Bearish Reversal", "Median Proximity Percentile Bearish Reversal")
alertcondition(ta.crossunder(emaValue ,emaValue) and emaValue < -90, "Bullish Reversal", "Median Proximity Percentile Bullish Reversal")
🚨 Remember, the "Median Proximity Percentile " is a tool to aid your analysis. It’s essential to combine it with other analysis techniques and market understanding for best results. Happy trading! 📈📉
Momentum Bias Index [AlgoAlpha]Description:
The Momentum Bias Index by AlgoAlpha is designed to provide traders with a powerful tool for assessing market momentum bias. The indicator calculates the positive and negative bias of momentum to gauge which one is greater to determine the trend.
Key Features:
Comprehensive Momentum Analysis: The script aims to detect momentum-trend bias, typically when in an uptrend, the momentum oscillator will oscillate around the zero line but will have stronger positive values than negative values, similarly for a downtrend the momentum will have stronger negative values. This script aims to quantify this phenomenon.
Overlay Mode: Traders can choose to overlay the indicator on the price chart for a clear visual representation of market momentum.
Take-profit Signals: The indicator includes signals to lock in profits, they appear as labels in overlay mode and as crosses when overlay mode is off.
Impulse Boundary: The script includes an impulse boundary, the impulse boundary is a threshold to visualize significant spikes in momentum.
Standard Deviation Multiplier: Users can adjust the standard deviation multiplier to increase the noise tolerance of the impulse boundary.
Bias Length Control: Traders can customize the length for evaluating bias, enabling them to fine-tune the indicator according to their trading preferences. A higher length will give a longer-term bias in trend.
Squeeze & Release [AlgoAlpha]Introduction:
💡The Squeeze & Release by AlgoAlpha is an innovative tool designed to capture price volatility dynamics using a combination of EMA-based calculations and ATR principles. This script aims to provide traders with clear visual cues to spot potential market squeezes and release scenarios. Hence it is important to note that this indicator shows information on volatility, not direction.
Core Logic and Components:
🔶EMA Calculations: The script utilizes the Exponential Moving Average (EMA) in multiple ways to smooth out the data and provide indicator direction. There are specific lengths for the EMAs that users can modify as per their preference.
🔶ATR Dynamics: Average True Range (ATR) is a core component of the script. The differential between the smoothed ATR and its EMA is used to plot the main line. This differential, when represented as a percentage of the high-low range, provides insights into volatility.
🔶Squeeze and Release Detection: The script identifies and highlights squeeze and release scenarios based on the crossover and cross-under events between our main line and its smoothed version. Squeezes are potential setups where the market may be consolidating, and releases indicate a potential breakout or breakdown.
🔶Hyper Squeeze Detection: A unique feature that detects instances when the main line is rising consistently over a user-defined period. Hyper squeeze marks areas of extremely low volatility.
Visual Components:
The main line (ATR-based) changes color depending on its position relative to its EMA.
A middle line plotted at zero level which provides a quick visual cue about the main line's position. If the main line is above the zero level, it indicates that the price is squeezing on a longer time horizon, even if the indicator indicates a shorter-term release.
"𝓢" and "𝓡" characters are plotted to represent 'Squeeze' and 'Release' scenarios respectively.
Standard Deviation Bands are plotted to help users gauge the extremity and significance of the signal from the indicator, if the indicator is closer to either the upper or lower deviation bands, this means that statistically, the current value is considered to be more extreme and as it is further away from the mean where the indicator is oscillating at for the majority of the time. Thus indicating that the price has experienced an unusual amount or squeeze or release depending on the value of the indicator.
Usage Guidelines:
☝️Traders can use the script to:
Identify potential consolidation (squeeze) zones.
Gauge potential breakout or breakdown scenarios (release).
Fine-tune their entries and exits based on volatility.
Adjust the various lengths provided in the input for better customization based on individual trading styles and the asset being traded.
Session Breakout Scalper Trading BotHi Traders !
Introduction:
I have recently been exploring the world of automated algorithmic trading (as I prefer more objective trading strategies over subjective technical analysis (TA)) and would like to share one of my automation compatible (PineConnecter compatible) scripts “Session Breakout Scalper”.
The strategy is really simple and is based on time conditional breakouts although has more ”relatively” advanced optional features such as the regime indicators (Regime Filters) that attempt to filter out noise by adding more confluence states and the ATR multiple SL that takes into account volatility to mitigate the down side risk of the trade.
What is Algorthmic Trading:
Firstly what is algorithmic trading? Algorithmic trading also known as algo-trading, is a method of using computer programs (in this case pine script) to execute trades based on predetermined rules and instructions (this trading strategy). It's like having a robot trader who follows a strict set of commands to buy and sell assets automatically, without any human intervention.
Important Note:
For Algorithmic trading the strategy will require you having an essential TV subscription at the minimum (so that you can set alerts) plus a PineConnecter subscription (scroll down to the .”How does the strategy send signals” headings to read more)
The Strategy Explained:
Is the Time input true ? (this can be changed by toggling times under the “TRADE MEDIAN TIMES” group for user inputs).
Given the above is true the strategy waits x bars after the session and then calculates the highest high (HH) to lowest low (LL) range. For this box to form, the user defined amount of bars must print after the session. The box is symmetrical meaning the HH and LL are calculated over a lookback that is equal to the sum of user defined bars before and after the session (+ 1).
The Strategy then simultaneously defines the HH as the buy level (green line) and the LL as the sell level (red line). note the strategy will set stop orders at these levels respectively.
Enter a buy if price action crosses above the HH, and then cancel the sell order type (The opposite is true for a stop order).
If the momentum based regime filters are true the strategy will check for the regime / regimes to be true, if the regime if false the strategy will exit the current trade, as the regime filter has predicted a slowing / reversal of momentum.
The image below shows the strategy executing these trading rules ( Regime filters, "Trades on chart", "Signal & Label" and "Quantity" have been omitted. "Strategy label plots" has been switched to true)
Other Strategy Rules:
If a new session (time session which is user defined) is true (blue vertical line) and the strategy is currently still in a trade it will exit that trade immediately.
It is possible to also set a range of percentage gain per day that the strategy will try to acquire, if at any point the strategy’s profit is within the percentage range then the position / trade will be exited immediately (This can be changed in the “PERCENT DAY GAIN” group for user inputs)
Stops and Targets:
The strategy has either static (fixed) or variable SL options. TP however is only static. The “STRAT TP & TP” group of user inputs is responsible for the SL and TP values (quoted in pips). Note once the ATR stop is set to true the SL values in the above group no longer have any affect on the SL as expected.
What are the Regime Filters:
The Larry Williams Large Trade Index (LWLTI): The Larry Williams Large Trade Index (LWTI) is a momentum-based technical indicator developed by iconic trader Larry Williams. It identifies potential entries and exits for trades by gauging market sentiment, particularly the buying and selling pressure from large market players. Here's a breakdown of the LWTI:
LWLTI components and their interpretation:
Oscillator: It oscillates between 0 and 100, with 50 acting as the neutral line.
Sentiment Meter: Values above 75 suggest a bearish market dominated by large selling, while readings below 25 indicate a bullish market with strong buying from large players.
Trend Confirmation: Crossing above 75 during an uptrend and below 25 during a downtrend confirms the trend's continuation.
The Andean Oscillator (AO) : The Andean Oscillator is a trend and momentum based indicator designed to measure the degree of variations within individual uptrends and downtrends in the prices.
Regime Filter States:
In trading, a regime filter is a tool used to identify the current state or "regime" of the market.
These Regime filters are integrated within the trading strategy to attempt to lower risk (equity volatility and/or draw down). The regime filters have different states for each market order type (buy and sell). When the regime filters are set to true, if these regime states fail to be true the trade is exited immediately.
For Buy Trades:
LWLTI positive momentum state: Quotient of the lagged trailing difference and the ATR > 50
AO positive momentum state: Bull line > Bear line (signal line is omitted)
For Sell Trades:
LWLTI negative momentum stat: Quotient of the lagged trailing difference and the ATR < 50
AO negative momentum state: Bull line < Bear line (signal line is omitted)
How does the Strategy Send Signals:
The strategy triggers a TV alert (you will neet to set a alert first), TV then sends a HTTP request to the automation software (PineConnecter) which receives the request and then communicates to an MT4/5 EA to automate the trading strategy.
For the strategy to send signals you must have the following
At least a TV essential subscription
This Script added to your chart
A PineConnecter account, which is paid and not free. This will provide you with the expert advisor that executes trades based on these strategies signals.
For more detailed information on the automation process I would recommend you read the PineConnecter documentation and FAQ page.
Dashboard:
This Dashboard (top right by defualt) lists some simple trading statistics and also shows when a trade is live.
Important Notice:
- USE THIS STRATEGY AT YOUR OWN RISK AND ALWAYS DO YOUR OWN RESEARCH & MANUAL BACKTESTING !
- THE STRATEGY WILL NOT EXHIBIT THE BACKTEST PERFORMANCE SEEN BELOW IN ALL MARKETS !
Bollinger Bands Percentile + Stdev Channels (BBPct) [AlgoAlpha]Description:
The "Bollinger Bands Percentile (BBPct) + STD Channels" mean reversion indicator, developed by AlgoApha, is a technical analysis tool designed to analyze price positions using Bollinger Bands and Standard Deviation Channels (STDC). The combination of these two indicators reinforces a stronger reversal signal. BBPct calculates the percentile rank of the price's standard deviation relative to a specified lookback period. Standard deviation channels operate by utilizing a moving average as the central line, with upper and lower lines equidistant from the average based on the market's volatility, helping to identify potential price boundaries and deviations.
How it Works:
The BBPct indicator utilizes Bollinger Bands, which consist of a moving average (basis) and upper and lower bands based on a specified standard deviation multiplier. By default, it uses a 20-period moving average and a standard deviation multiplier of 2. The upper band is calculated by adding the basis to the standard deviation multiplied by the multiplier, while the lower band is calculated by subtracting the same value. The BBPct indicator calculates the position of the current price between the lower and upper Bollinger Bands as a percentile value. It determines this position by comparing the price's distance from the lower band to the overall range between the upper and lower bands. A value of 0 indicates that the price is at the lower band, while a value of 100 indicates that the price is at the upper band. The indicator also includes an optional Bollinger Band standard deviation percentage (%Stdev) histogram, representing the deviation of the current price from the moving average as a percentage of the price itself.
Standard deviation channels, also known as volatility channels, aid in identifying potential buying and selling opportunities while minimizing unfavorable trades. These channels are constructed by two lines that run parallel to a moving average. The separation between these lines is determined by the market's volatility, represented by standard deviation. By designating upper and lower channel lines, the channels demarcate the borders between typical and atypical price movements. Consequently, when the market's price falls below the lower channel line, it suggests undervaluation, whereas prices surpassing the upper channel line indicate overvaluation.
Signals
The chart displays potential reversal points through the use of red and green arrows. A red arrow indicates a potential bearish retracement, signaling a possible downward movement, while a green arrow represents a potential pullback to the positive, suggesting a potential upward movement. These signals are generated only when both the BBPct (Bollinger Bands Percentage) and the STDC (Standard Deviation Channel) indicators align with bullish or bearish conditions. Consequently, traders might consider opening long positions when the green arrow appears and short positions when the red arrow is plotted.
Usage:
This indicator can be utilized by traders and investors to effectively identify pullbacks, reversals, and mean regression, thereby enhancing their trading opportunities. Notably, extreme values of the BBPct, such as below -5 or above 105, indicate oversold or overbought conditions, respectively. Moreover, the presence of extreme STDC zones occurs when prices fall below the lower channel line or cross above the upper channel line. Traders can leverage this information as a mean reversion tool by identifying instances of peak overbought and oversold values. These distinctive characteristics facilitate the identification of potential entry and exit points, thus augmenting trading decisions and enhancing market analysis.
The indicator's parameters, such as the length of the moving average, the data source, and the standard deviation multiplier, can be customized to align with individual trading strategies and preferences.
Originality:
The BBPct + STDC indicator, developed by AlgoAlpha, is an original implementation that combines the calculation of Bollinger Bands, percentile ranking, the %Stdev histogram and the STDC. While it shares some similarities with the Bollinger Bands %B indicator, the BBPct indicator introduces additional elements and customization options tailored to AlgoAlpha's methodology. The script is released under the Mozilla Public License 2.0, granting users the freedom to utilize and modify it while adhering to the license terms.
ATR GOD Strategy by TradeSmart (PineConnector-compatible)This is a highly-customizable trading strategy made by TradeSmart, focusing mainly on ATR-based indicators and filters. The strategy is mainly intended for trading forex , and has been optimized using the Deep Backtest feature on the 2018.01.01 - 2023.06.01 interval on the EUR/USD (FXCM) 15M chart, with a Slippage value of 3, and a Commission set to 0.00004 USD per contract. The strategy is also made compatible with PineConnector , to provide an easy option to automate the strategy using a connection to MetaTrader. See tooltips for details on how to set up the bot, and check out our website for a detailed guide with images on how to automate the strategy.
The strategy was implemented using the following logic:
Entry strategy:
A total of 4 Supertrend values can be used to determine the entry logic. There is option to set up all 4 Supertrend parameters individually, as well as their potential to be used as an entry signal/or a trend filter. Long/Short entry signals will be determined based on the selected potential Supertrend entry signals, and filtered based on them being in an uptrend/downtrend (also available for setup). Please use the provided tooltips for each setup to see every detail.
Exit strategy:
4 different types of Stop Losses are available: ATR-based/Candle Low/High Based/Percentage Based/Pip Based. Additionally, Force exiting can also be applied, where there is option to set up 4 custom sessions, and exits will happen after the session has closed.
Parameters of every indicator used in the strategy can be tuned in the strategy settings as follows:
Plot settings:
Plot Signals: true by default, Show all Long and Short signals on the signal candle
Plot SL/TP lines: false by default, Checking this option will result in the TP and SL lines to be plotted on the chart.
Supertrend 1-4:
All the parameters of the Supertrends can be set up here, as well as their individual role in the entry logic.
Exit Strategy:
ATR Based Stop Loss: true by default
ATR Length (of the SL): 100 by default
ATR Smoothing (of the SL): RMA/SMMA by default
Candle Low/High Based Stop Loss: false by default, recent lowest or highest point (depending on long/short position) will be used to calculate stop loss value. Set 'Base Risk Multiplier' to 1 if you would like to use the calculated value as is. Setting it to a different value will count as an additional multiplier.
Candle Lookback (of the SL): 50 by default
Percentage Based Stop Loss: false by default, Set the stop loss to current price - % of current price (long) or price + % of current price (short).
Percentage (of the SL): 0.3 by default
Pip Based Stop Loss: Set the stop loss to current price - x pips (long) or price + x pips (short). Set 'Base Risk Multiplier' to 1 if you would like to use the calculated value as is. Setting it to a different value will count as an additional multiplier.
Pip (of the SL): 10 by default
Base Risk Multiplier: 4.5 by default, the stop loss will be placed at this risk level (meaning in case of ATR SL that the ATR value will be multiplied by this factor and the SL will be placed that value away from the entry level)
Risk to Reward Ratio: 1.5 by default, the take profit level will be placed such as this Risk/Reward ratio is met
Force Exiting:
4 total Force exit on custom session close options: none applied by default. If enabled, trades will close automatically after the set session is closed (on next candle's open).
Base Setups:
Allow Long Entries: true by default
Allow Short Entries: true by default
Order Size: 10 by default
Order Type: Capital Percentage by default, allows adjustment on how the position size is calculated: Cash: only the set cash amount will be used for each trade Contract(s): the adjusted number of contracts will be used for each trade Capital Percentage: a % of the current available capital will be used for each trade
ATR Limiter:
Use ATR Limiter: true by default, Only enter into any position (long/short) if ATR value is higher than the Low Boundary and lower than the High Boundary.
ATR Limiter Length: 50 by default
ATR Limiter Smoothing: RMA/SMMA by default
High Boundary: 1000 by default
Low Boundary: 0.0003 by default
MA based calculation: ATR value under MA by default, If not Unspecified, an MA is calculated with the ATR value as source. Only enter into position (long/short) if ATR value is higher/lower than the MA.
MA Type: RMA/SMMA by default
MA Length: 400 by default
Waddah Attar Filter:
Explosion/Deadzone relation: Not specified by default, Explosion over Deadzone: trades will only happen if the explosion line is over the deadzone line; Explosion under Deadzone: trades will only happen if the explosion line is under the deadzone line; Not specified: the opening of trades will not be based on the relation between the explosion and deadzone lines.
Limit trades based on trends: Not specified by default, Strong Trends: only enter long if the WA bar is colored green (there is an uptrend and the current bar is higher then the previous); only enter short if the WA bar is colored red (there is a downtrend and the current bar is higher then the previous); Soft Trends: only enter long if the WA bar is colored lime (there is an uptrend and the current bar is lower then the previous); only enter short if the WA bar is colored orange (there is a downtrend and the current bar is lower then the previous); All Trends: only enter long if the WA bar is colored green or lime (there is an uptrend); only enter short if the WA bar is colored red or orange (there is a downtrend); Not specified: the color of the WA bar (trend) is not relevant when considering entries.
WA bar value: Not specified by default, Over Explosion and Deadzone: only enter trades when the WA bar value is over the Explosion and Deadzone lines; Not specified: the relation between the explosion/deadzone lines to the value of the WA bar will not be used to filter opening trades.
Sensitivity: 150 by default
Fast MA Type: SMA by default
Fast MA Length: 10 by default
Slow MA Type: SMA
Slow MA Length: 20 by default
Channel MA Type: EMA by default
BB Channel Length: 20 by default
BB Stdev Multiplier: 2 by default
Trend Filter:
Use long trend filter 1: false by default, Only enter long if price is above Long MA.
Show long trend filter 1: false by default, Plot the selected MA on the chart.
TF1 - MA Type: EMA by default
TF1 - MA Length: 120 by default
TF1 - MA Source: close by default
Use short trend filter 1: false by default, Only enter long if price is above Long MA.
Show short trend filter 1: false by default, Plot the selected MA on the chart.
TF2 - MA Type: EMA by default
TF2 - MA Length: 120 by default
TF2 - MA Source: close by default
Volume Filter:
Only enter trades where volume is higher then the volume-based MA: true by default, a set type of MA will be calculated with the volume as source, and set length
MA Type: RMA/SMMA by default
MA Length: 200 by default
Date Range Limiter:
Limit Between Dates: false by default
Start Date: Jan 01 2023 00:00:00 by default
End Date: Jun 24 2023 00:00:00 by default
Session Limiter:
Show session plots: false by default, show market sessions on chart: Sidney (red), Tokyo (orange), London (yellow), New York (green)
Use session limiter: false by default, if enabled, trades will only happen in the ticked sessions below.
Sidney session: false by default, session between: 15:00 - 00:00 (EST)
Tokyo session: false by default, session between: 19:00 - 04:00 (EST)
London session: false by default, session between: 03:00 - 11:00 (EST)
New York session: false by default, session between: 08:00 - 17:00 (EST)
Trading Time:
Limit Trading Time: true by default, tick this together with the options below to enable limiting based on day and time
Valid Trading Days Global: 123567 by default, if the Limit Trading Time is on, trades will only happen on days that are present in this field. If any of the not global Valid Trading Days is used, this field will be neglected. Values represent days: Sunday (1), Monday (2), ..., Friday (6), Saturday(7) To trade on all days use: 123457
(1) Valid Trading Days: false, 123456 by default, values represent days: Sunday (1), Monday (2), ..., Friday (6), Saturday(7) The script will trade on days that are present in this field. Please make sure that this field and also (1) Valid Trading Hours Between is checked
(1) Valid Trading Hours Between: false, 1800-2000 by default, hours between which the trades can happen. The time is always in the exchange's timezone
All other options are also disabled by default
PineConnector Automation:
Use PineConnector Automation: false by default, In order for the connection to MetaTrader to work, you will need do perform prerequisite steps, you can follow our full guide at our website, or refer to the official PineConnector Documentation. To set up PineConnector Automation on the TradingView side, you will need to do the following:
1. Fill out the License ID field with your PineConnector License ID;
2. Fill out the Risk (trading volume) with the desired volume to be traded in each trade (the meaning of this value depends on the EA settings in Metatrader. Follow the detailed guide for additional information);
3. After filling out the fields, you need to enable the 'Use PineConnector Automation' option (check the box in the strategy settings);
4. Check if the chart has updated and you can see the appropriate order comments on your chart;
5. Create an alert with the strategy selected as Condition, and the Message as {{strategy.order.comment}} (should be there by default);
6. Enable the Webhook URL in the Notifications section, set it as the official PineConnector webhook address and enjoy your connection with MetaTrader.
License ID: 60123456789 by default
Risk (trading volume): 1 by default
NOTE! Fine-tuning/re-optimization is highly recommended when using other asset/timeframe combinations.
Hobbiecode - RSI + Close previous dayThis is a simple strategy that is working well on SPY but also well performing on Mini Futures SP500. The strategy is composed by the followin rules:
1. If RSI(2) is less than 15, then enter at the close.
2. Exit on close if today’s close is higher than yesterday’s high.
If you backtest it on Mini Futures SP500 you will be able to track data from 1993. It is important to select D1 as timeframe.
Please share any comment or idea below.
Have a good trading,
Ramón.
Hobbiecode - Five Day Low RSI StrategyThis is a simple strategy that is working well on SPY but also well performing on Mini Futures SP500. The strategy is composed by the followin rules:
1. If today’s close is below yesterday’s five-day low, go long at the close.
2. Sell at the close when the two-day RSI closes above 50.
3. There is a time stop of five days if the sell criterium is not triggered.
If you backtest it on Mini Futures SP500 you will be able to track data from 1993. It is important to select D1 as timeframe.
Please share any comment or idea below.
Have a good trading,
Ramón.
Hobbiecode - SP500 IBS + HigherThis is a simple strategy that is working well on SPY but also well performing on Mini Futures SP500. The strategy is composed by the followin rules:
1. Today is Monday.
2. The close must be lower than the close on Friday.
3. The IBS must be below 0.5.
4. If 1-3 are true, then enter at the close.
5. Sell 5 trading days later (at the close).
If you backtest it on Mini Futures SP500 you will be able to track data from 1993. It is important to select D1 as timeframe.
Please share any comment or idea below.
Have a good trading,
Ramón.
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.
Yesterday’s High Breakout - Trend Following StrategyYesterday’s High Breakout it is a trading system based on the analysis of yesterday's highs, it works in trend-following mode therefore it opens a long position at the breakout of yesterday's highs even if they occur several times in one day.
There are several methods for exiting a trade, each with its own unique strategy. The first method involves setting Take-Profit and Stop-Loss percentages, while the second utilizes a trailing-stop with a specified offset value. The third method calls for a conditional exit when the candle closes below a reference EMA.
Additionally, operational filters can be applied based on the volatility of the currency pair, such as calculating the percentage change from the opening or incorporating a gap to the previous day's high levels. These filters help to anticipate or delay entry into the market, mitigating the risk of false breakouts.
In the specific case of NULS, a 9% Take-Profit and a 3% Stop-Loss were set, with an activated trailing-stop percentage. To postpone entry and avoid false breakouts, a 1% gap was added to the price of yesterday's highs.
Name : Yesterday's High Breakout - Trend Follower Strategy
Author : @tumiza999
Category : Trend Follower, Breakout of Yesterday's High.
Operating mode : Spot or Futures (only long).
Trade duration : Intraday.
Timeframe : 30M, 1H, 2H, 4H
Market : Crypto
Suggested usage : Short-term trading, when the market is in trend and it is showing high volatility.
Entry : When there is a breakout of Yesterday's High.
Exit : Profit target or Trailing stop, Stop loss or Crossunder EMA.
Configuration :
- Gap to anticipate or postpone the entry before or after the identified level
- Rate of Change for Entry Condition
- Take Profit, Stop Loss and Trailing Stop
- EMA length
Backtesting :
⁃ Exchange: BINANCE
⁃ Pair: NULSUSDT
⁃ Timeframe: 2H
⁃ Fee: 0.075%
⁃ Slippage: 1
- Initial Capital: 10000 USDT
- Position sizing: 10% of Equity
- Start : 2018-07-26 (Out Of Sample from 2022-12-23)
- Bar magnifier: on
Credits : LucF for Pine Coders (f_security function to avoid repainting using security)
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.
Risk Reward Calculator [lovealgotrading]
OVERVIEW:
This Risk Reward Calculator strategy can help you maximize your RR value with help of algorithmic trading.
INDICATOR:
I wanted to setup my trades more easier with this indicator, I didn't want to calculate everytime before orders, with help this indicator we can calculate R:R value, avarage price, stoploss price, take-profit price, order prices, all position cost and more ...
Our strategy is a risk revard calculation indicator that is made easy to use by using visualized lines and panels, and also has algorithmic trading support.
With the help of this indicator, we can quickly and easily calculate our risk reward values and enter the positions.
If we want to ensure that our balance grows regularly while trading in the stock market, we need to manage the risks and rewards otherwise we may fall below our initial balance at the end of the day, even if we seem to be winning.
What is the Risk-Reward value ?
This value is a value that shows how many times the amount of risk we take when entering the position is successful, we will earn.
- For example, you risked $100 while entering the trade, so if your trade stops, you will lose 100 $.
Your Risk-Reward(RR) value is 2 means that if your position is successful, you will have 200 $ in your pocket.
A trader's success is determined by the amount of R he earns monthly or yearly, not how much money he makes.
What is different in this indicator ?
I want to say thank you to © EvoCrypto. His Calculator (weighted) – evo indicator helped me when I was developed my indicator.
I want to explain what I have improved:
1-In this strategy, we can determine the time period in which we want to open our positions.
2-We can open a maximum of 4 positions in the same direction and close our positions at a single level. StopLoss or TakeProfit
3-This indicator, which works in the form of a strategy, shows where our positions have been opened or closed. With the help of this, it helps us to determine our strategy in our future positions more accurately.
4-The most important improvement is that we do not miss our positions with the help of alarms (WEB HOOK). if we want, we receive by quickly connecting all these positions to our robot, the software can enter and exit the position while we are busy.
IMPLEMENTATION DETAILS – SETTINGS:
1 - We can set the start and end dates of the positions we will take.
2- We can set our take profit, stoploss levels.
3- If your trade is stopped, we can determine the amount of the trade that we will lose.
4- We can adjust our entry levels to positions and our position sizes at entry levels.
(Sum of positions weight must be 100%)
5- We can receive our positions even if we are busy with the help of algorithmic trading. For this, we must paste our Jshon codes into the fields specified in the settings panel.
6- Finally, we can change the settings we want and don't want to have in our visual elements.
Let's make a LONG side example together
We have determined our positions to enter stoploss, take profit and long positions. We did not forget to set the start time of our strategy
Our strategy appear on the graph as follows.
Our strategy has calculated the total position size, our R-R value, the distance of the current price to the stop and take profit levels, in short, a lot of things we could look visually.
Notes:
If you're going to connect this bot to an automatic Long or Short direction,
Don’t forget! you need to Webhook URL,
Don’t miss paste this code to your message window {{strategy.order.alert_message}}
ALSO:
If you have any ideas what to add to my work to add more sources or make calculations cooler, feel free to write me.
AUTOMATIC GRID BOT STRATEGY [ilovealgotrading]
OVERVIEW:
This Grid trading strategy can help you maximize your profit in a ranging sideways market with no clear direction.
INDICATOR:
We can get some money by taking advantage of the movement of the price between the range we have determined.
Short positions are opened while the price is rising, long positions are opened while the price is falling.
Therefore, there is no need to predict the trend direction.
What is different in this indicator:
I want to say thank you to © thequantscience. His GRID SPOT TRADING ALGORITHM - GRID BOT TRADING strategy helped me when I was writing my indicator.
I want to explain what I have improved:
1- Grid strategy is a type of strategy that can be traded in very short time frames and users can trade this strategy algorithmically by connecting this strategy to their own accounts with the help of API systems. For this reason, I have developed a software that can give us signals by dynamically changing the long and short messages when users are trading.
2- We can change the start and end dates of our grid bot as we want. It is necessary to use this setting when setting up automatic bots, so that previously opened transactions are not taken into account.
3 - Lot or quantity size should not be excessively small when users are taking automatic trades because exchanges have limitations, to avoid this problem, I have prevented this error by automatically rounding up to the nearest quantity size inside the software.
4 - Users can avoid excessive losses by using stop loss on this grid bot if they wish.
5 - When our price is over the range high or below the range low, our open positions are closed, if the stop button is active. We can also change which close price time frame we take as a basis from the settings.
6 -Users can set how many dollars they can enter per transaction while performing their transactions automatically.
IMPLEMENTATION DETAILS – SETTINGS:
This script allows the user to choose the highs and lows leves of our range. Our bot trades in the specified range.
1. This strategy allows us to set start and end backtest dates.
2. We can change range high and range low leves of our bot
3. IF people want to trade algorithmically with the help of this bot, there are 6 different input systems that will receive the Json codes as an alarm
4. IF the price closes above the upper line or below the lower line, all transactions will be closed. We can determine in which time frame our transactions will be stopped if the price closes outside these levels.We can adjust how our bot works by activating or turning off the Stop Loss button.
5. In this strategy, you can determine your dollar cost for per position.
6. The user can also divide the interval we have determined into 10 parts or 20 equal parts.
7. The grid is divided and colored at the interval we set. At the same time, if we don't want we can turn off colored channels.
Notes:
If you're going to connect this bot to an automatic Long and Short direction,
Don’t forget! you need to Webhook URL,
Don’t miss paste this code to your message window {{strategy.order.alert_message}}
ALSO:
Set your range below the support zones and above the resistance zones.
Don't be afraid to take a wide range, it doesn't matter if you make a little money, the important thing is that you don't lose money.
If you have any ideas what to add to my work to add more sources or make calculations cooler, suggest in DM .
BE - Golden Cross Crude KeyTraders, i have been observing crude oil for about 3 months now and somehow I can see that crude is respecting 42 days Moving average and crosses have created massive spikes most of the time.
However you need to be mindful of the time to trade and timeframe since not all crosses creates spikes.
Note: I have been testing on a 15min timeframe.
Keeping this in mind, this indicator is a automated solution which takes trade entries on crosses plus buffer and exits based on the specified Sl type.
Enjoy!
DISCLAIMER: No sharing, copying, reselling, modifying, or any other forms of use are authorized for our documents, script / strategy, and the information published with them. This informational planning script / strategy is strictly for individual use and educational purposes only. This is not financial or investment advice. Investments are always made at your own risk and are based on your personal judgement. I am not responsible for any losses you may incur. Please invest wisely.
Happy to receive suggestions and feedback in order to improve the performance of the indicator better.
Investments/swing trading strategy for different assetsStop worrying about catching the lowest price, it's almost impossible!: with this trend-following strategy and protection from bearish phases, you will know how to enter the market properly to obtain benefits in the long term.
Backtesting context: 1899-11-01 to 2023-02-16 of SPX by Tvc. Commissions: 0.05% for each entry, 0.05% for each exit. Risk per trade: 2.5% of the total account
For this strategy, 5 indicators are used:
One Ema of 200 periods
Atr Stop loss indicator from Gatherio
Squeeze momentum indicator from LazyBear
Moving average convergence/divergence or Macd
Relative strength index or Rsi
Trade conditions:
There are three type of entries, one of them depends if we want to trade against a bearish trend or not.
---If we keep Against trend option deactivated, the rules for two type of entries are:---
First type of entry:
With the next rules, we will be able to entry in a pull back situation:
Squeeze momentum is under 0 line (red)
Close is above 200 Ema and close is higher than the past close
Histogram from macd is under 0 line and is higher than the past one
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
For closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
Second type of entry:
With the next rules, we will not lose a possible bullish movement:
Close is above 200 Ema
Squeeze momentum crosses under 0 line
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
Like in the past type of entry, for closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
---If we keep Against trend option activated, the rules are the same as the ones above, but with one more type of entry. This is more useful in weekly timeframes, but could also be used in daily time frame:---
Third type of entry:
Close is under 200 Ema
Squeeze momentum crosses under 0 line
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
Like in the past type of entries, for closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
Risk management
For calculating the amount of the position you will use just a small percent of your initial capital for the strategy and you will use the atr stop loss for this.
Example: You have 1000 usd and you just want to risk 2,5% of your account, there is a buy signal at price of 4,000 usd. The stop loss price from atr stop loss is 3,900. You calculate the distance in percent between 4,000 and 3,900. In this case, that distance would be of 2.50%. Then, you calculate your position by this way: (initial or current capital * risk per trade of your account) / (stop loss distance).
Using these values on the formula: (1000*2,5%)/(2,5%) = 1000usd. It means, you have to use 1000 usd for risking 2.5% of your account.
We will use this risk management for applying compound interest.
In settings, with position amount calculator, you can enter the amount in usd of your account and the amount in percentage for risking per trade of the account. You will see this value in green color in the upper left corner that shows the amount in usd to use for risking the specific percentage of your account.
Script functions
Inside of settings, you will find some utilities for display atr stop loss, break evens, positions, signals, indicators, etc.
You will find the settings for risk management at the end of the script if you want to change something. But rebember, do not change values from indicators, the idea is to not over optimize the strategy.
If you want to change the initial capital for backtest the strategy, go to properties, and also enter the commisions of your exchange and slippage for more realistic results.
If you activate break even using rsi, when rsi crosses under overbought zone break even will be activated. This can work in some assets.
---Important: In risk managment you can find an option called "Use leverage ?", activate this if you want to backtest using leverage, which means that in case of not having enough money for risking the % determined by you of your account using your initial capital, you will use leverage for using the enough amount for risking that % of your acount in a buy position. Otherwise, the amount will be limited by your initial/current capital---
Some things to consider
USE UNDER YOUR OWN RISK. PAST RESULTS DO NOT REPRESENT THE FUTURE.
DEPENDING OF % ACCOUNT RISK PER TRADE, YOU COULD REQUIRE LEVERAGE FOR OPEN SOME POSITIONS, SO PLEASE, BE CAREFULL AND USE CORRECTLY THE RISK MANAGEMENT
Do not forget to change commissions and other parameters related with back testing results!
Some assets and timeframes where the strategy has also worked:
BTCUSD : 4H, 1D, W
SPX (US500) : 4H, 1D, W
GOLD : 1D, W
SILVER : 1D, W
ETHUSD : 4H, 1D
DXY : 1D
AAPL : 4H, 1D, W
AMZN : 4H, 1D, W
META : 4H, 1D, W
(and others stocks)
BANKNIFTY : 4H, 1D, W
DAX : 1D, W
RUT : 1D, W
HSI : 1D, W
NI225 : 1D, W
USDCOP : 1D, W
RSI Buy & Sell Trading ScriptThis is my first attempt at a trading script using the RSI indicator for Buy & Sell signals (so please be nice but would appreciate any constructive comments).
Starting with $100 initial capital and using 10% per trade
You can select which month the backtesting starts
There is also a monthly table (sorry can’t remember who I got this from) that shows the total monthly profits, but you’ll need to turn it on by going into settings, Properties and in the Recalculate section tick the “On every tick” box
It should do the following:
Open Buy order if the RSI > 68 and the current Moving Average is greater than the previous Moving average
• TP1 = 50% of Order at 0.4%
• TP2 = 50% of order at 0.8%
• SL = 2% below entry
• Close Buy order if the RSI < 30
Open Sell order if the RSI < 28 and the current Moving Average is less than the previous Moving average
• TP1 = 50% of Order at 0.4%
• TP2 = 50% of order at 0.8%
• SL = 2% above entry
• Close Buy order if the RSI < 60
I would like to build on this if you have any ideas/ code that could help like the following:
• Move the SL to break even when it hits TP1
• Move the SL to TP1 when TP2 hits
• Moving take profit code so I can let the some of the trade stay in play (activate if it hits 1% profit and close trade if price retracts 0.5%)
Refracted EMARefracted EMA is a price based indicator with bands that is built on moving average.
The price range between the bands directly depends on relationship of Average True Range to Moving Average. This gives us very valuable variable constant that changes with the market moves.
So the bands expand and contract due to changes in volatility of the market, which makes this tool very flexible exposing psychological levels.