Yesterday's High v.17.07Yesterday’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 INJ, a 12% Take-Profit and a 1.5% Stop-Loss were set, with an activated trailing-stop percentage, TRL 1 and OFF 0.5.
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: INJUSDT
⁃ Timeframe: 4H
- Treshold: 1
- Gap%: 1
- SL: 1.5
- TP:12
- TRL: 1
- OFF-TRL: 0.5
⁃ 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.
อินดิเคเตอร์และกลยุทธ์
SuperTrend Enhanced Pivot Reversal - Strategy [PresentTrading]
- Introduction and How it is Different
The SuperTrend Enhanced Pivot Reversal is a unique approach to trading that combines the best of two worlds: the precision of pivot reversal points and the trend-following power of the SuperTrend indicator. This strategy is designed to provide traders with clear entry and exit points, while also filtering out potentially false signals using the SuperTrend indicator.
BTCUSDT 6hr
ETHBTC 6hr
Unlike traditional pivot reversal strategies, this approach uses the SuperTrend indicator as a filter. This means that it only takes trades that align with the overall trend, as determined by the SuperTrend indicator. This can help to reduce the number of false signals and improve the overall profitability of the strategy.
The Pivot Reversal Strategy with SuperTrend Filter is particularly well-suited to the cryptocurrency market for the reason of High Volatility. This means that prices can change rapidly in a very short time, making it possible to make a profit quickly. The strategy's use of pivot points allows traders to take advantage of these rapid price changes by identifying potential reversal points
- Strategy: How it Works
The strategy works by identifying pivot reversal points, which are points in the price chart where the price is likely to reverse. These points are identified using a combination of the ta.pivothigh and ta.pivotlow functions, which find the highest and lowest points in the price chart over a certain period.
Once a pivot reversal point is identified, the strategy checks the direction of the SuperTrend indicator. If the SuperTrend is positive (indicating an uptrend), the strategy will only take long trades. If the SuperTrend is negative (indicating a downtrend), the strategy will only take short trades.
The strategy also includes a stop loss level, which is set as a percentage of the entry price. This helps to limit potential losses if the price moves in the opposite direction to the trade.
- Trade Direction
The trade direction can be set to "Long", "Short", or "Both". This allows the trader to choose whether they want to take only long trades (buying low and selling high), only short trades (selling high and buying low), or both. This can be useful depending on the trader's view of the market and their risk tolerance.
- Usage
To use the Pivot Reversal Strategy with SuperTrend Filter, simply input the desired parameters into the script and apply it to the price chart of the asset you wish to trade. The strategy will then identify potential trade entry and exit points, which will be displayed on the price chart.
- Default Settings
The default settings for the strategy are as follows:
ATR Length: 5
Factor: 2.618
Trade Direction: Both
Stop Loss Level: 20%
Commission: 0.1%
Slippage: 1
Currency: USD
Each trade: 10% of account equity
Initial capital: $10,000
These settings can be adjusted to suit the trader's preferences and risk tolerance. Always remember to test any changes to the settings using historical data before applying them to live trades.
Moving Average Rainbow (Stormer)This strategy is based and shown by trader and investor Alexandre Wolwacz "Stormer".
Overview
The strategy uses 12 moving averages (default EMA) to identify trends and generate trading signals opening positions.
Allowing to select the type of moving average and length to be used.
The conditions includes relationship between moving averages, the position of the current price relative to the moving averages, and the occurrence of certain price patterns.
Calculation
The mean moving averages is calculated by adding all the 12 moving averages and dividing by 12, the value is used to help to identify trend and possible condition to open position.
The 12 moving averages is spliced by 3 ranges, initial range (moving average lines 1 to 4), middle range (moving average lines 5 to 8) and end range (moving average lines 9 to 12). These ranges helps to identify potential trend and market turn over.
The moving average touch price is a relationship between the low price (uptrend) or high price (downtrend) with the moving average lines, it identifies where the price (low/high) has reached the the moving average line. Fetching the value to help for opening position, set stop loss and take profit.
Since the stop loss is based and set from the previous moving average touch price value, when position is about to be open and setting the stop loss value, there is a verification to check both current and previous moving average touch price to recalculate the stop loss value.
The turnover trend checks for a possible market turnover event, setting up a new profit target, this setting when enabled is to be helpful when a turnover occurs against the position to exit position with some profit based on highest high price if long or lowest low price if short.
The turnover signal is similar to turnover trend. The difference is that when this setting is enabled and it triggers, it simply exit the current position and opens up a reverse position, long goes short and short goes long. And there is an complement optional that checks current price exit profitable.
Entry Position
Long Position:
Price is higher than the mean moving averages. Meaning possible uptrend.
The lines of the middle range from the moving averages are in increasing order. Meaning possible uptrend.
The current high pierced up previous high.
Fetch the previous value of the moving average touch price. Meaning the low price has touched one of the moving average lines, which that value is conditioning to open position.
Short Position:
Price is lower than the mean moving averages. Meaning possible downtrend.
The lines of the middle range from the moving averages are in decreasing order. Meaning possible downtrend.
The current low pierced down previous low.
Fetch the previous value of the moving average touch price. Meaning the high price has touched one of the moving average lines, which that value is conditioning to open position.
Risk Management
Stop Loss:
The stop loss is based from the previous moving average touch price value, high price for short and low price for long or occurs an verification to check for both current and previous moving average touch price value and a recalculation is done to set the stop loss.
Take Profit:
According to the author, the profit target should be at least 1:1.6 the risk, so to have the strategy mathematically positive.
The profit target is configured input, can be increased or decreased.
It calculates the take profit based on the price of the stop loss with the profit target input.
Turnover Trend
Long Position:
The moving averages initial range lines signals a possible market turnover. Meaning long might be going short.
Fetches the highest high hit since the opening of the position, setting that value to the new profit target.
Short Position:
The moving averages initial range lines signals a possible market turnover. Meaning short might be going long.
Fetches the lowest low hit since the opening of the position, setting that value to the new profit target.
Volatility Capture RSI-Bollinger - Strategy [presentTrading]- Introduction and how it is different
The 'Volatility Capture RSI-Bollinger - Strategy ' is a trading strategy that combines the concepts of Bollinger Bands (BB), Relative Strength Index (RSI), and Simple Moving Average (SMA) to generate trading signals. The uniqueness of this strategy is it calculates which is a dynamic level between the upper and lower Bollinger Bands based on the closing price. This unique feature allows the strategy to adapt to market volatility and price movements.
The market in Crypto and Stock are highly volatile, making them suitable for a strategy that uses Bollinger Bands. The RSI can help identify overbought or oversold conditions in this often speculative market.
BTCUSD 4hr chart
(700.hk) 3hr chart
Remember, the effectiveness of a trading strategy also depends on other factors such as the timeframe used, the specific settings of the indicators, and the overall market conditions. It's always recommended to backtest and paper trade a strategy before using it in live trading.
- Strategy, How it Works
Dynamic Bollinger Band: The strategy works by first calculating the upper and lower Bollinger Bands based on the user-defined length and multiplier. It then uses the Bollinger Bands and the closing price to dynamically adjust the presentBollingBand value. In the end, it generates a long signal when the price crosses over the present Bolling Band and a short signal when the price crosses under the present Bolling Band.
RSI: If the user has chosen to use RSI for signals, the strategy also calculates the RSI and its SMA, and uses these to generate additional long and short signals. The RSI-based signals are only used if the 'Use RSI for signals' option is set to true.
The strategy then checks the chosen trading direction and enters a long or short position accordingly. If the trading direction is set to 'Both', the strategy can enter both long and short positions.
Finally, the strategy exits a position when the close price crosses under the present Bolling Band for a long position, or crosses over the present Bolling Band for a short position.
- Trade direction
The strategy also includes a trade direction parameter, allowing the user to choose whether to enter long trades, short trades, or both. This makes the strategy adaptable to different market conditions and trading styles.
- Usage
1. Set the input parameters as per your trading preferences. You can choose the price source, the length of the moving average, the multiplier for the ATR, whether to use RSI for signals, the RSI and SMA periods, the bought and sold range levels, and the trading direction.
2. The strategy will then generate buy and sell signals based on these parameters. You can use these signals to enter and exit trades.
- Default settings
1. Source: hlc3
2. Length: 50
3. Multiplier: 2.7183
4. Use RSI for signals: True
5. RSI Period: 10
6. SMA Period: 5
7. Bought Range Level: 55
8. Sold Range Level: 50
9. Trade Direction: Both
- Strategy's default Properties
1. Default Quantity Type: 'strategy.percent_of_equity'
2. commission_value= 0.1, commission_type=strategy.commission.percent, slippage= 1: These parameters set the commission and slippage for the strategy. The commission is set to 0.1% of the trade value, and the slippage (the difference between the expected price of a trade and the price at which the trade is executed) is set to 1.
3. default_qty_type = strategy.percent_of_equity, default_qty_value = 15: These parameters set the default quantity for trades. The default_qty_type is set to strategy.percent_of_equity, which means that the size of each trade will be a percentage of the account equity. The default_qty_value is set to 15, which means that each trade will be 15% of the account equity.
4. initial_capital= 10000: This parameter sets the initial capital for the strategy to $10,000.
PresentTrend - Strategy [presentTrading]- Introduction and how it is different
The PresentTrend strategy is a unique custom trend-following strategy. This combination allows the strategy to take advantage of both short-term and long-term market trends, making it suitable for various market conditions.
BTCUSDT 4hr chart
(700.hk) 3D chart
- Strategy, How it Works
RSI or MFI: The first part uses a custom indicator based on either the Relative Strength Index (RSI) or the Money Flow Index (MFI). The indicator calculates a PresentTrend value, which generates buy and sell signals based on its crossover and crossunder, indicating potential trend reversals.
ATR: The second part is a popular trend-following indicator that uses the Average True Range (ATR).
The strategy enters a long position when all buy signals from both strategies are true, and a short position when all sell signals are true. This ensures trades are entered when both short-term and long-term trends align, potentially increasing the strategy's reliability.
- Trade direction
The strategy also includes a trade direction parameter, allowing the user to choose whether to enter long trades, short trades, or both. This makes the strategy adaptable to different market conditions and trading styles.
- Usage
1. Set the input parameters for the custom trend-following strategy.
2. Choose whether to use the RSI or MFI for the custom strategy.
3. Choose the trade direction: long, short, or both.
4. The strategy will generate buy and sell signals based on the conditions of both strategies.
5. Enter a trade when a buy or sell signal is generated, depending on the chosen trade direction.
Please note that this strategy is meant to be a tool to aid in your trading decisions and not a standalone trading system. Always use proper risk management and make sure to test the strategy thoroughly before using it in live trading.
- Default settings
1. Source: 'hlc3', a balanced price level for calculations.
2. Length: 14, a common setting for many technical indicators.
3. Multiplier: 1.618 (the golden ratio), used in calculating the upper and lower thresholds.
4. RSI or MFI: Set to use MFI by default, both are momentum indicators.
5. Trade Direction: 'Both', allowing for both long and short trades.
The default settings are designed to provide a balanced approach to trend detection. However, these can be adjusted based on the user's preferences and the specific characteristics of the market being traded.
- Strategy's default Properties
1. Default Quantity Type: 'strategy.percent_of_equity'
2. commission_value= 0.1, commission_type=strategy.commission.percent, slippage= 1: These parameters set the commission and slippage for the strategy. The commission is set to 0.1% of the trade value, and the slippage (the difference between the expected price of a trade and the price at which the trade is executed) is set to 1.
3. default_qty_type = strategy.percent_of_equity, default_qty_value = 10: These parameters set the default quantity for trades. The default_qty_type is set to strategy.percent_of_equity, which means that the size of each trade will be a percentage of the account equity. The default_qty_value is set to 10, which means that each trade will be 10% of the account equity.
4. initial_capital= 10000: This parameter sets the initial capital for the strategy to $10,000.
Bollinger Bands Modified (Stormer)This strategy is based and shown by trader and investor Alexandre Wolwacz "Stormer".
Overview
The strategy uses two indicators Bollinger Bands and EMA (optional for EMA).
Calculates Bollinger Bands, EMA, highest high, and lowest low values based on the input parameters, evaluating the conditions to determine potential long and short entry signals.
The conditions include checks for crossovers and crossunders of the price with the upper and lower Bollinger Bands, as well as the position of the price relative to the EMA.
The script also incorporates the option to add an inside bar pattern check for additional information.
Entry Position
Long Position:
Price cross over the superior band of bollinger bands.
The EMA is used to add support for trend analysis, it is an optional input, when used, it checks if price is above EMA.
Short Position:
Price cross under the inferior band of bollinger bands.
The EMA is used to add support for trend analysis, it is an optional input, when used, it checks if price is under EMA.
Risk Management
Stop Loss:
The stop loss is calculated based on the input highest high (for short position) and lowest low (for long position).
It gets the length based on the input from the last candles to set which is the highest high and which is the lowest low.
Take Profit:
According to the author, the profit target should be at least 1:1.6 the risk, so to have the strategy mathematically positive.
The profit target is configured input, can be increased or decreased.
It calculates the take profit based on the price of the stop loss with the profit target input.
Risk to Reward - FIXED SL BacktesterDon't know how to code? No problem! TradingView is an excellent platform for you. ✅ ✅
If you have an indicator that you want to backtest using a risk-to-reward ratio or fixed take profit/stop loss levels, then the Risk to Reward - FIXED SL Backtester script is the perfect solution for you.
introducing Risk to Reward - FIXED SL Backtester Script which will allow you to test any indicator / Signal with RR or Fixed SL system
How does it work ?!
Once you connect the script to your indicator, it will analyze your entry points and perform calculations based on them. It will then open trades for you according to the specified inputs in the script settings.
HOW TO CONNECT IT to your indicator?
simply open your indicator code and add the below line of code to it
plot(Signal ? 100 : 0,"Signal",display = display.data_window)
Replace Signal with the long condition from your own indicator. You can also modify the value 100 to any number you prefer. After that, open the settings.
Once the script is connected to your indicator, you can choose from two options:
Risk To Reward Ratio System
Fixed TP/ SL System
🔸if you select the Risk to Reward System ⤵️
The Risk-to-Reward System requires the calculation of a stop loss. That's why I have included three different types of stop-loss calculations for you to choose from:
ATR Based SL
Pivot Low SL
VWAP Based SL
Your stop loss and take profit levels will be automatically calculated based on the selected stop loss method and your risk-to-reward ratio.
You can also adjust their values to match your desired risk level. The trades will be displayed on the chart.
with the ability to change their values to match your risk.
once this is done, trades will be displayed on the chart
🔸if you select the Fixed system ⤵️
You have 2 inputs, which are FIXED TP & Fixed SL
input the values you want, and trades will be on your chart...
I have also added a Breakeven feature for you.
with this Breakeven feature the trade will not just move SL to Entry ?! NO NO, it will place it above entry by a % you input yourself, so you always win! 🚀
Here is an example
Enjoy, and have fun, if you have any questions do not hesitate to ask
twisted SMA strategy [4h] Hello
I would like to introduce a very simple strategy that uses a combination of 3 simple moving averages ( SMA 4 , SMA 9 , SMA 18 )
this is a classic combination showing the most probable trend directions
Crosses were marked on the basis of the color of the candles (bulish cross - blue / bearish cross - maroon)
ma 100 was used to determine the main trend, which is one of the most popular 4-hour candles
We define main trend while price crosses SMA100 ( for bullish trend I use green candle color )
The long position strategy was created in combination of 3 moving averages with Kaufman's adaptive moving average by alexgrover
The strategy is very accurate and is easy to use indicators
the strategy uses only Buy (Long) signals in a combination of crossovers of the SMA 4, SMA 9, SMA 18 and the Kaufman Adaptive Moving Average.
As a signal to close a long position, only the opposite signal of the intersection of 3 different moving averages is used
the current strategy is recommended for higher time zones (4h +) due to the strength of the closing candles, which translates into signal strength
works fascinatingly well for long-term bullish market assets (for example 4h Apple, Tesla charts)
Enjoy and trade safe ;)
Grid Strategy with MA0. Preface
Hello traders,
This is a strategy script that allows you to utilize a Grid Strategy using moving averages.
It is very simple, but I decided to post it because it was hard to find such shared open-source codes in Pine Script.
1. Main
This is a very simple trading method.
Based on the moving average line you set, if the price drops by a certain ATR (or percent) below it, you buy, and when it goes back up, you sell.
In basic settings, you choose the moving average line and its length, and decide how much to set the distance between each grid through the 'Band Multiplier/Percent' item.
I believe that it is advantageous to widen the bandwidth for stocks with strong upward momentum.
2. Conclusion
I have confirmed that this works better in the stock market than in the crypto market,
and that it is suitable for use on index stocks like NASDAQ because it follows trends.
In addition, through backtesting, I have confirmed that this grid strategy is more suitable for buying strategies than selling strategies, so I uploaded it as a strategy focused on buying strategies.
Personally, I have developed my own strategy by adjusting buying and selling strategies according to trends and managing risks.
I hope you can use this to create a script that suits you.
Thank you.
Buy&Sell Bullish Engulfing - The Quant Science🇺🇸
GENERAL OVERVIEW
Buy&Sell Bullish Engulfing - The Quant Science It is a Buy&Sell strategy based on the 'Bullish Engulfing' candlestick pattern. The main goal of the strategy is to achieve a consistent and sustainable return over time, with a manageable level of risk.
Bullish Engulfing
The template was developed at the top of the Indicator provided by TradingView called 'Engulfing - Bullish'.
ENTRY AND EXIT CRITERIA
Entry: A single long order is opened when the candlestick pattern is formed, and the percentage size of the order (%) is fixed by the trader through the user interface.
Exit: The long trade is closed on a percentage equity take profit-stop loss.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
🇮🇹
PANORAMICA GENERALE
Buy&Sell Bullish Engulfing - The Quant Science è una strategia Buy&Sell basata sul candlestick pattern 'Bullish Engulfing'. L'obiettivo principale della strategia è ottenere un ritorno costante e sostenibile nel tempo, con un livello gestibile di rischio.
Bullish Engulfing
Il template è stato sviluppato al top dell' Indicatore fornito da Trading View chiamato 'Engulfing - Bullish'.
CRITERI DI ENTRATA E USCITA
Entrata: viene aperto un singolo ordine long quando si forma il candlestick pattern, la size percentuale dell'ordine (%) viene selezionato tramite l'interfaccia utente dal trader.
Uscita: la chiusura della posizione avviene unicamente tramite un take profit-stop loss percentuale calcolato sul capitale.
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.
Powertrend - Volume Range Filter Strategy [wbburgin]The Powertrend is a range filter that is based off of volume, instead of price. This helps the range filter capture trends more accurately than a price-based range filter, because the range filter will update itself from changes in volume instead of changes in price. In certain scenarios this means that the Powertrend will be more profitable than a normal range filter.
Essentials of the Strategy
This is a breakout strategy which works best on trending assets with high volume and liquidity. It should be used on middle to higher timeframes and can be used on all assets that have volume provided by the data source (stocks, crypto, forex). It is long-only as of now. It can work on lower timeframes if you optimize the strategy filters to make less trades or if your exchange/broker is low/no fees, provided that your exchange/broker has high liquidity and volume.
The strategy enters a long position if the range filter is trending upwards and the price crosses over the upper range band, which signifies a price-volume breakout. The strategy closes the long position if the range filter is trending downwards and the price crosses under the lower range band, which signifies a breakdown. Both these conditions can be altered by the three filter options in the settings. The default trend filter is not alterable because it helps prevent false entries and exits that are against the trend.
Settings
The Length setting is the lookback period for the range smoothing.
The ADX Filter setting enables you to turn on an ADX filter, which will halt entries and exits unless the ADX of your customizable length is above a ADX VWMA of that length.
The Range Supertrend setting creates a supertrend from the top and bottom ranges, which can be used to filter entries and exits. The length is customizable. The filter can show you whether the range is making higher highs and lower lows. Below is an example of the Range Supertrend being used as a filter and plotted on-chart:
The VWMA setting halts entries if they are below a customizable length VWMA.
Both the Range Supertrend and the VWMA can also be plotted separately without actually filtering the strategy, so that you can use them independently if you wish. You can turn off the bar color, the highlighting, and the labels if you wish in the settings. A note about the bar color: if the color changes but the strategy does not signal an exit or entry this means that the crossover was against the trend. In these circumstances it may be indicative of a pullback to enter or exit or to add onto your position.
About the Strategy Results Below
A range filter is normally composed of two components - the range filter itself and a smoothing function. In the development of this script I tested both normal and volume-based varieties of the range filter and the smoothing function:
Tests Performed
Volume-based Range x VWMA smoothing
Price-based Range x VWMA smoothing
Price-based Range x EMA smoothing
Volume-based Range x EMA smoothing (final result)
The highest-performing was a volume-based range filter and a normal EMA-based smoothing function, but that does not mean that this strategy will be profitable - exits are based off of signal reversion so I strongly encourage you to develop your own take profits/stop losses for the strategy if you think it may be a good fit for you. The results below are with a commission value of 0.05% (because I built the strategy first for equities), slippage of 3, so if your exchange/broker has a higher fee schedule, I recommend adding filters and/or moving to higher timeframes for the strategy. Additionally, I used 10% of equity in each trade, while using the Range Supertrend filter (the previous upload was unrealistic because it used 100% of equity - missed a 0, apologies, and added in slippage).
Ta StrategyHello guys
This script follows traditional technical indicators
MACD, ADX, RSI and pivot points
If the price is above the resistance and the MACD has crossover ,and the RSI 14 is above 50
ADX is higher than 20, and DI+ is higher than DI-. This is a buy signal and vice versa for a sell signal
The script moves the stop loss to the entry price after the first target is reached
You can specify the quantity you want to sell when the price reaches the first target
There are also options like if you want the script to entry long or short, or both
you can reverse the strategy if it does not work well
If you want to inquire about any details, please let me know in the comments
Volume-Weighted Supertrend Strategy [wbburgin]This is a script that can be used as a strategy or a standalone indicator.
The Volume-Weighted Supertrend is a supertrend based on a rolling VWAP, instead of a normal price source. The strategy has two components - a supertrend based off of this VWAP (shown on the chart) and a supertrend from volume itself (not plotted on the chart directly). The supertrend from volume is an example of my "Supertrend Any Source" indicator, where a custom ATR is created from non-OHLC data; this is available as both a separate public script and also in my "wbburgin_utils" library for you to use in your own script creation.
The supertrend from volume acts as a confirmation filter for the VWAP-supertrend shown on-chart. If the volume supertrend is trending up and the VWAP-based supertrend is also trending up, a buy signal is generated. Likewise, if the volume supertrend is trending down and the VWAP-supertrend is trending down, a sell signal is generated. The colors are based off of whether both supertrends are trending up or down: green for both up, blue for only price up, orange for only price down, and red for both down.
The settings enable you to change the volume length and the ATR length separately, as well as the multiplier and the source for the price supertrend. If you load the indicator for the first time and see no entries and exits, this is because "Show Strategy Entries and Exits" is disabled in the settings. This is if you plan on using the strategy as an indicator and don't want to be bothered by the entry and exit symbols on the chart. Additionally, for those who like clean charts (like me), you can turn all the labels off in the settings, as well as the highlighting.
My default strategy settings for the strategy results shown below are as follows: 5% equity per trade, 5 degrees of pyramiding, commissions of 0.08% per trade. This strategy doesn't come with stops yet, so please be aware of that before using it to trade - I highly suggest you create your own stops based off of your R/R ratio and personal risk tolerance. Additionally, it works best on trending assets (b/c of the supertrends) with high volume. This might mean it does not work as well on lower timeframes.
[SMT] Buy & Sell Renko Based - StrategyThis is a custom indicator that implements a trading strategy based on Renko charts, but they can be used on regular candlestick charts and on any time frame. Renko charts are known for filtering market noise and displaying price movements in a clearer way. However, it is important to note that this indicator is provided for educational and informational purposes only and is not a guarantee of profitable returns.
Features:
- The indicator uses Renko charts to generate buy and sell signals.
- Renko bricks are built based on a predefined price variation, rather than time.
- The length of the Average True Range (ATR) used to calculate Renko bricks can be customized.
- Buy signals are generated when the price crosses below the current Renko brick.
- Sell signals are generated when the price crosses above the current Renko brick.
- Entry points are marked with "Buy" and "Sell" arrows on the chart.
It is essential to emphasize that no indicator or trading strategy guarantees profitable results. The financial market is complex and subject to unpredictable changes. It is recommended to perform additional tests and analysis before using this indicator on a real trading account.
Always remember to manage your risks properly and consider other factors such as fundamental analysis and market conditions when making trading decisions. The use of this indicator is entirely the user's responsibility.
DISCLAIMER: This indicator is not financial advice and should not be interpreted as such. Always consult with a qualified financial professional before making any investment decisions.
Default Strategy Template© CN_FX-999
Coded By Christian Nataliano
First Coded In 14/06/2023
Last Edited In 22/06/2023
This Is A Default Strategy Template That Can Make Your Strategy Scripts More Organized With The Benefit Of Having The Same Layouts & Not Needing To Copy Over The Common Codes Such As Displaying Backtest Results, Opening & Closing Trades, Pine Connector Capabilities And A Clean User Input Interface. This Is A Blank Strategy Script So Feel Free To Use It As Your Default Template For Your Future Strategies.
Credits To Some Of The Custom Code In The Scripts To © ZenAndTheArtOfTrading, Especially The Table Data Plotting
Heikin Ashi ROC Percentile Strategy**User Guide for the "Heikin Ashi ROC Percentile Strategy"**
This strategy, "Heikin Ashi ROC Percentile Strategy", is designed to provide an easy-to-use framework for trading based on the Heikin Ashi Rate of Change (ROC) and its percentiles.
Here's how you can use it:
1. **Setting the Start Date**: You can set the start date for the strategy in the user inputs at the top of the script. The variable `startDate` defines the point from which the script begins executing trades. Simply input the desired date in the format "YYYY MM DD". For example, to start the strategy from March 3, 2023, you would enter `startDate = timestamp("2023 03 03")`.
2. **Adjusting the Midline, Lookback Period, and Stop Loss Level**: The `zerohLine`, `rocLength`, and `stopLossLevel` inputs allow you to adjust the baseline for ROC, the lookback period for the SMA and ROC, and the level at which the strategy stops the loss, respectively. By tweaking these parameters, you can fine-tune the strategy to better suit your trading style or the particular characteristics of the asset you are trading.
3. **Understanding the Trade Conditions**: The script defines conditions for entering and exiting long and short positions based on crossovers and crossunders of the ROC and the upper and lower "kill lines". These lines are defined as certain percentiles of the ROC's highest and lowest values over a specified lookback period. When the ROC crosses above the lower kill line, the script enters a long position; when it crosses below the upper kill line, it exits the position. Similarly, when the ROC crosses below the upper kill line, the script enters a short position; when it crosses above the lower kill line, it exits the position.
In my testing, this strategy performed best on a day and hour basis. However, I encourage you to experiment with different timeframes and settings to see how the strategy performs under various conditions. Remember, there's no one-size-fits-all approach to trading; what works best will depend on your specific circumstances, goals, and risk tolerance.
If you find other useful applications for this strategy, please let me know in the comments. Your feedback is invaluable in helping to refine and improve this tool. Happy trading!
Trailing Stop with RSI - Momentum-Based StrategyTrailing Stop with RSI - Momentum-Based Strategy
Description:
The Trailing Stop with RSI strategy combines momentum analysis and trailing stop functionality to help traders identify potential entry and exit points in their trading decisions. This strategy is suitable for various markets and timeframes.
Key Features:
Momentum Analysis: The strategy incorporates momentum indicators to identify potential buying and selling opportunities based on momentum shifts in the price.
Trailing Stop Functionality: The strategy utilizes a trailing stop to protect profits and dynamically adjust the stop loss level as the trade moves in the desired direction.
RSI Confirmation: The Relative Strength Index (RSI) is included to provide additional confirmation for trade entries by considering overbought and oversold conditions.
How to Use:
Entry Conditions: Long positions are triggered when positive momentum is detected, and the RSI confirms an oversold condition. Short positions are triggered when negative momentum is detected, and the RSI confirms an overbought condition.
Trailing Stop Activation: Once a position is opened, the trailing stop is activated when the specified profit level (as a percentage) is reached.
Trailing Stop Level: The trailing stop maintains a stop loss level at a specified distance (as a percentage) from the highest profit achieved since opening the position.
Exit Conditions: The trailing stop will trigger an exit and close all positions when the trailing stop level is breached.
Markets and Conditions:
This strategy can be applied to various markets, including stocks, forex, cryptocurrencies, and commodities. It can be used in trending and ranging market conditions, making it versatile for different market environments.
Important Considerations:
Adjust Parameters: Traders can modify the length of the momentum and RSI indicators to suit their preferred timeframe and trading style.
Risk Management: It is recommended to consider appropriate position sizing, risk-to-reward ratios, and overall risk management practices when using this strategy.
Backtesting and Optimization: Traders are encouraged to backtest the strategy on historical data and optimize the parameters to find the best settings for their chosen market and timeframe.
By incorporating momentum analysis, trailing stop functionality, and RSI confirmation, this strategy aims to provide traders with a systematic approach to capturing profitable trades while managing risk effectively.
Williams %R Cross Strategy with 200 MA Filter
1. The script is a trading strategy based on the Williams %R indicator and a 200-period moving average (MA) filter.
2. The user can input the length of the Williams %R indicator (`wrLength`), the threshold for %R crossing (`crossPips`), the take profit level in pips (`takeProfitPips`), and the stop loss level in pips (`stopLossPips`).
3. The script calculates the Williams %R using the `ta.highest` and `ta.lowest` functions to find the highest high and lowest low over the specified length (`wrLength`).
4. It also calculates a 200-period simple moving average (`ma200`) using the `ta.sma` function.
5. The entry conditions are defined as follows:
- For a long entry, it checks if the Williams %R crosses above the -50 line by a threshold of `crossPips` and if the close price is above the 200-period MA.
- For a short entry, it checks if the Williams %R crosses below the -50 line by a threshold of `crossPips` and if the close price is below the 200-period MA.
6. The exit conditions are defined as follows:
- For a long position, it checks if the close price reaches the take profit level (defined as the average entry price plus `takeProfitPips` in pips) or the stop loss level (defined as the average entry price minus `stopLossPips` in pips).
- For a short position, it checks if the close price reaches the take profit level (defined as the average entry price minus `takeProfitPips` in pips) or the stop loss level (defined as the average entry price plus `stopLossPips` in pips).
7. The script uses the `strategy.entry` function to place long and short orders when the respective entry conditions are met.
8. It uses the `strategy.close` function to close the long and short positions when the respective exit conditions are met.
The script allows you to customize the parameters such as the length of Williams %R, the crossing threshold, take profit and stop loss levels, and the moving average period to suit your trading preferences.
The Z-score The Z-score, also known as the standard score, is a statistical measurement that describes a value's relationship to the mean of a group of values. It's measured in terms of standard deviations from the mean. If a Z-score is 0, it indicates that the data point's score is identical to the mean score. Z-scores may be positive or negative, with a positive value indicating the score is above the mean and a negative score indicating it is below the mean.
The concept of Z-score was introduced by statistician Carl Friedrich Gauss as part of his "method of the least squares," which was an important step in the development of the normal distribution and Z-score tables. It's a key concept in statistics and is used in various statistical tests.
In financial analysis, Z-scores are used to determine whether a data point is usual or unusual. You can think of it as a measure of how many standard deviations an element is from the mean. For instance, a Z-score of 1.0 would denote a value that is one standard deviation from the mean. Z-scores are also used to predict probabilities, with Z-scores having a distribution that is expected to be normal.
In trading, a Z-score is used to determine how often a trading system may produce a string of winners or losers. It can help a trader to understand whether the losses or profits they see are something that the system would most likely produce, or if it's a once in a blue moon situation. This helps traders make decisions about when to start or stop a system.
I just wanted to play a bit with the Z-score I guess.
Feel free to share your findings if you discover additional applications for this strategy or identify timeframes where it appears to perform more optimally.
How it works:
This strategy is based on a statistical concept called Z-score, which measures the number of standard deviations a data point is from the mean. In other words, it helps determine how unusual or usual a data point is.
In the context of this strategy, Z-score is applied to a 10-period EMA (Exponential Moving Average) of Heikin-Ashi candlestick close prices. The Z-score is calculated over a look-back period of 25 bars.
The EMA of the Z-score is then calculated over a 20-bar period, and the upper and lower thresholds (bounds for buy and sell signals) are defined using the 90th and 10th percentiles of this EMA score.
Long positions are taken when the Z-score crosses above the lower threshold or crosses above the mid-line (50th percentile). An additional long entry is made when the Z-score crosses above the highest value the EMA has been in the past 100 periods.
Short positions are initiated when the EMA crosses below the upper threshold, lower threshold or the highest value the EMA has been in the past 100 periods.
Positions are closed when opposing entry conditions are met, for example, a long position is closed when the short entry condition is true, and vice versa.
Set your desired start date for the strategy. This can be modified in the timestamp("YYYY MM DD") function at the top of the script.
D-BoT Alpha 'Short' SMA and RSI StrategyDostlar selamlar,
İşte son derece basit ama etkili ve hızlı, HTF de çok iyi sonuçlar veren bir strateji daha, hepinize bol kazançlar dilerim ...
Nedir, Nasıl Çalışır:
Strateji, iki ana girdiye dayanır: SMA ve RSI. SMA hesaplama aralığı 200 olarak, RSI ise 14 olarak ayarlanmıştır. Bu değerler, kullanıcı tercihlerine veya geriye dönük test sonuçlarına göre ayarlanabilir.
Strateji, iki koşul karşılandığında bir short sinyali oluşturur: RSI değeri, belirlenen bir giriş seviyesini (burada 51 olarak belirlenmiş) aşar ve kapanış fiyatı SMA değerinin altındadır.
Strateji, kısa pozisyonu üç durumda kapatır: Kapanış fiyatı, takip eden durdurma seviyesinden (pozisyon açıldığından beri en düşük kapanış olarak belirlenmiştir) büyükse, RSI değeri belirlenen bir durdurma seviyesini (bu durumda 54) aşarsa veya RSI değeri belirli bir kar al seviyesinin (bu durumda 32) altına düşerse.
Güçlü Yönleri:
İki farklı gösterge (SMA ve RSI) kullanımı, yalnızca birini kullanmaktan daha sağlam bir sinyal sağlayabilir.
Strateji, karları korumaya ve fiyat dalgalanmalarında kayıpları sınırlamaya yardımcı olabilecek bir iz süren durdurma seviyesi içerir.
Script oldukça anlaşılır ve değiştirmesi nispeten kolaydır.
Zayıf Yönleri:
Strateji, hacim, oynaklık veya daha geniş piyasa eğilimleri gibi diğer potansiyel önemli faktörleri göz önünde bulundurmaz.
RSI seviyeleri ve SMA süresi için belirli parametreler sabittir ve tüm piyasa koşulları veya zaman aralıkları için optimal olmayabilir.
Strateji oldukça basittir. Trade maliyetini (kayma veya komisyonlar gibi) hesaba katmaz, bu da trade performansını önemli ölçüde etkileyebilir.
Bu Stratejiyle Nasıl İşlem Yapılır:
Strateji, short işlemler için tasarlanmıştır. RSI, 51'in üzerine çıktığında ve kapanış fiyatı 200 periyotluk SMA'nın altında olduğunda işleme girer. RSI, 54'ün üzerine çıktığında veya 32'nin altına düştüğünde veya fiyat, pozisyon açıldığından beri en düşük kapanış fiyatının üzerine çıktığında işlemi kapatır.
Lütfen Dikkat, bu strateji veya herhangi bir strateji izole bir şekilde kullanılmamalıdır. Tüm bu çalışmalar eğitsel amaçlıdır. Yatırım tavsiyesi içermez.
This script defines a trading strategy based on Simple Moving Average (SMA) and the Relative Strength Index (RSI) indicators. Here's an overview of how it works, along with its strengths and weaknesses, and how to trade using this strategy:
How it works:
The strategy involves two key inputs: SMA and RSI. The SMA length is set to 200, and the RSI length is set to 14. These values can be adjusted based on user preferences or back-testing results.
The strategy generates a short signal when two conditions are met: The RSI value crosses over a defined entry level (set at 51 here), and the closing price is below the SMA value.
When a short signal is generated, the strategy opens a short position.
The strategy closes the short position under three conditions: If the close price is greater than the trailing stop (which is set as the lowest close since the position opened), if the RSI value exceeds a defined stop level (54 in this case), or if the RSI value drops below a certain take-profit level (32 in this case).
Strengths:
The use of two different indicators (SMA and RSI) can provide a more robust signal than using just one.
The strategy includes a trailing stop, which can help to protect profits and limit losses as the price fluctuates.
The script is straightforward and relatively easy to understand and modify.
Weaknesses:
The strategy doesn't consider other potentially important factors, such as volume, volatility, or broader market trends.
The specific parameters for the RSI levels and SMA length are hard-coded, and may not be optimal for all market conditions or timeframes.
The strategy is very simplistic. It doesn't take into account the cost of trading (like slippage or commissions), which can significantly impact trading performance.
How to trade with this strategy:
The strategy is designed for short trades. It enters a trade when the RSI crosses above 51 and the closing price is below the 200-period SMA. It will exit the trade when the RSI goes above 54 or falls below 32, or when the price rises above the lowest closing price since the position was opened.
Please note, this strategy or any strategy should not be used in isolation. It's important to consider other aspects of trading such as risk management, capital allocation, and combining different strategies to diversify. Back-testing the strategy on historical data and demo trading before going live is also a recommended practice.
D-Bot Alpha RSI Breakout StrategyHello dear Traders,
Here is a simple yet effective strategy to use, for best profit higher time frame, such as daily.
Structure of the code
The code defines inputs for SMA (simple moving average) length, RSI (relative strength index) length, RSI entry level, RSI stop loss level, and RSI take profit level. The default values of these variables can be customized as per the user's preferences.
The script calculates SMA and RSI based on the input parameters and the closing price of the asset.
Trading logic
This strategy allows the placement of a long position when:
The RSI crosses above the RSI entry level and
The close price is above the SMA value.
After entering a long position, it applies a trailing stop mechanism. The stop price is updated to the close price if the close price is lower than the last close price.
The script closes the long position when:
RSI falls below the stop loss level.
RSI reaches or exceeds the take profit level.
If the trailing stop is activated (once RSI reaches or exceeds the take profit level), the closing price falls below the trailing stop level.
Strengths
The strategy includes mechanisms for entering a position, taking profit, and stopping losses, which are fundamental aspects of a trading strategy.
It applies a trailing stop mechanism that allows to capture further gains if the price keeps increasing while protecting from losses if the price starts to decrease.
Weaknesses
This strategy only contemplates long positions. Depending on the market situation, the strategy may miss opportunities for short selling when the market is on a downward trend.
The choice of the fixed RSI entry, stop loss, and take profit levels may not be ideal for all market conditions or assets. It might benefit from a more adaptive mechanism that adjusts these levels according to market volatility or trend.
The strategy doesn't factor in trading costs (such as spread or commission), which could have a significant impact on the net profit, especially if the user is trading with a high frequency or in a low liquidity market.
How to trade with this strategy
Given these parameters and the strategy outlined by the code, the trader would enter a long position when the RSI crosses above the RSI entry level (default 34) and the closing price is above the SMA value (SMA calculated with default period of 200). The trader would exit the position when either the RSI falls below the RSI stop loss level (default 30), or RSI rises above the RSI take profit level (default 50), or when the trailing stop is hit.
Remember "The strategies I have prepared are entirely for educational purposes and should not be considered as investment advice. Support your trades using other tools. Wishing everyone profitable trades..."
Mechanical Trading StrategyThe "Mechanical Trading Strategy" is a simple and systematic approach to trading that aims to capture short-term price movements in the financial markets. This strategy focuses on executing trades based on specific conditions and predetermined profit targets and stop loss levels.
Key Features:
Profit Target: The strategy allows you to set a profit target as a percentage of the entry price. This target represents the desired level of profit for each trade.
Stop Loss: The strategy incorporates a stop loss level as a percentage of the entry price. This level represents the maximum acceptable loss for each trade, helping to manage risk.
Entry Condition: The strategy triggers trades at a specific time. In this case, the condition for entering a trade is based on the hour of the candle being 16 (4:00 PM). This time-based entry condition provides a systematic approach to executing trades.
Position Sizing: The strategy determines the position size based on a fixed percentage of the available equity. This approach ensures consistent risk management and allows for potential portfolio diversification.
Execution:
When the entry condition is met, signified by the hour being 16, the strategy initiates a long position using the strategy.entry function. It sets the exit conditions using the strategy.exit function, with a limit order for the take profit level and a stop order for the stop loss level.
Take Profit and Stop Loss:
The take profit level is calculated by adding a percentage of the entry price to the entry price itself. This represents the profit target for the trade. Conversely, the stop loss level is calculated by subtracting a percentage of the entry price from the entry price. This level represents the maximum acceptable loss for the trade.
By using this mechanical trading strategy, traders can establish a disciplined and systematic approach to their trading decisions. The predefined profit target and stop loss levels provide clear exit rules, helping to manage risk and potentially maximize returns. However, it is important to note that no trading strategy is guaranteed to be profitable, and careful analysis and monitoring of market conditions are always recommended.