QuantBuilder | FractalystWhat's the strategy's purpose and functionality?
QuantBuilder is designed for both traders and investors who want to utilize mathematical techniques to develop profitable strategies through backtesting on historical data.
The primary goal is to develop profitable quantitive strategies that not only outperform the underlying asset in terms of returns but also minimize drawdown.
For instance, consider Bitcoin (BTC), which has experienced significant volatility, averaging an estimated 200% annual return over the past decade, with maximum drawdowns exceeding -80%. By employing this strategy with diverse entry and exit techniques, users can potentially seek to enhance their Compound Annual Growth Rate (CAGR) while managing risk to maintain a lower maximum drawdown.
While this strategy employs quantitative techniques, including mathematical methods such as probabilities and positive expected values, it demonstrates exceptional efficacy across all markets. It particularly excels in futures, indices, stocks, cryptocurrencies, and commodities, leveraging their inherent trending behaviors for optimized performance.
In both trending and consolidating market conditions, QuantBuilder employs a combination of multi-timeframe probabilities, expected values, directional biases, moving averages and diverse entry models to identify and capitalize on bullish market movements.
How does the strategy perform for both investors and traders?
The strategy has two main modes, tailored for different market participants: Traders and Investors.
1. Trading:
- Designed for traders looking to capitalize on bullish markets.
- Utilizes a percentage risk per trade to manage risk and optimize returns.
- Suitable for both swing and intraday trading with a focus on probabilities and risk per trade approach.
2. Investing:
- Geared towards investors who aim to capitalize on bullish trending markets without using leverage while mitigating the asset's maximum drawdown.
- Utilizes pre-define percentage of the equity to buy, hold, and manage the asset.
- Focuses on long-term growth and capital appreciation by fully/partially investing in the asset during bullish conditions.
How does the strategy identify market structure? What are the underlying calculations?
The strategy utilizes an efficient logic with for loops to pinpoint the first swing candle featuring a pivot of 2, establishing the point at which the break of structure begins.
What entry criteria are used in this script? What are the underlying calculations?
The script utilizes two entry models: BreakOut and fractal.
Underlying Calculations:
Breakout: The script assigns the most recent swing high to a variable. When the price closes above this level and all other conditions are met, the script executes a breakout entry (conservative approach).
Fractal: The script identifies a swing low with a period of 2. Once this condition is met, the script executes the trade (aggressive approach).
How does the script calculate probabilities? What are the underlying calculations?
The script calculates probabilities by monitoring price interactions with liquidity levels. Here’s how the underlying calculations work:
Tracking Price Hits: The script counts the number of times the price taps into each liquidity side after the EQM level is activated. This data is stored in an array for further analysis.
Sample Size Consideration: The total number of price interactions serves as the sample size for calculating probabilities.
Probability Calculation: For each liquidity side, the script calculates the probability by taking the average of the recorded hits. This allows for a dynamic assessment of the likelihood that a particular side will be hit next, based on historical performance.
Dynamic Adjustment: As new price data comes in, the probabilities are recalculated, providing real-time aduptive insights into market behavior.
Note: The calculations are performed independently for each directional range. A range is considered bearish if the previous breakout was through a sellside liquidity. Conversely, a range is considered bullish if the most recent breakout was through a buyside liquidity.
How does the script calculate expected values? What are the underlying calculations?
The script calculates expected values by leveraging the probabilities of winning and losing trades, along with their respective returns. The process involves the following steps:
This quantitative methodology provides a robust framework for assessing the expected performance of trading strategies based on historical data and backtesting results.
How is the contextual bias calculated? What are the underlying calculations?
The contextual bias in the QuantBuilder script is calculated through a structured approach that assesses market structure based on swing highs and lows. Here’s how it works:
Identification of Swing Points: The script identifies significant swing points using a defined pivot logic, focusing on the first swing high and swing low. This helps establish critical levels for determining market structure.
Break of Structure (BOS) Assessment:
Bullish BOS: The script recognizes a bullish break of structure when a candle closes above the first swing high, followed by at least one swing low.
Bearish BOS: Conversely, a bearish break of structure is identified when a candle closes below the first swing low, followed by at least one swing high.
Bias Assignment: Based on the identified break of structure, the script assigns directional biases:
A bullish bias is assigned if a bullish BOS is confirmed.
A bearish bias is assigned if a bearish BOS is confirmed.
Quantitative Evaluation: Each identified bias is quantitatively evaluated, allowing the script to assign numerical values representing the strength of each bias. This quantification aids in assessing the reliability of market sentiment across multiple timeframes.
What's the purpose of using moving averages in this strategy? What are the underlying calculations?
Using moving averages is a widely-used technique to trade with the trend.
The main purpose of using moving averages in this strategy is to filter out bearish price action and to only take trades when the price is trading ABOVE specified moving averages.
The script uses different types of moving averages with user-adjustable timeframes and periods/lengths, allowing traders to try out different variations to maximize strategy performance and minimize drawdowns.
By applying these calculations, the strategy effectively identifies bullish trends and avoids market conditions that are not conducive to profitable trades.
The MA filter allows traders to choose whether they want a specific moving average above or below another one as their entry condition.
What type of stop-loss identification method are used in this strategy? What are the underlying calculations?
- Initial Stop-loss:
1. ATR Based:
The Average True Range (ATR) is a method used in technical analysis to measure volatility. It is not used to indicate the direction of price but to measure volatility, especially volatility caused by price gaps or limit moves.
Calculation:
- To calculate the ATR, the True Range (TR) first needs to be identified. The TR takes into account the most current period high/low range as well as the previous period close.
The True Range is the largest of the following:
- Current Period High minus Current Period Low
- Absolute Value of Current Period High minus Previous Period Close
- Absolute Value of Current Period Low minus Previous Period Close
- The ATR is then calculated as the moving average of the TR over a specified period. (The default period is 14)
2. ADR Based:
The Average Day Range (ADR) is an indicator that measures the volatility of an asset by showing the average movement of the price between the high and the low over the last several days.
Calculation:
- To calculate the ADR for a particular day:
- Calculate the average of the high prices over a specified number of days.
- Calculate the average of the low prices over the same number of days.
- Find the difference between these average values.
- The default period for calculating the ADR is 14 days. A shorter period may introduce more noise, while a longer period may be slower to react to new market movements.
3. PL Based:
This method places the stop-loss at the low of the previous candle.
If the current entry is based on the hunt entry strategy, the stop-loss will be placed at the low of the candle that wicks through the lower FRMA band.
Example:
If the previous candle's low is 100, then the stop-loss will be set at 100.
This method ensures the stop-loss is placed just below the most recent significant low, providing a logical and immediate level for risk management.
- Trailing Stop-Loss:
One of the key elements of this strategy is its ability to detect structural liquidity and structural invalidation levels across multiple timeframes to trail the stop-loss once the trade is in running profits.
By utilizing this approach, the strategy allows enough room for price to run.
By using these methods, the strategy dynamically adjusts the initial stop-loss based on market volatility, helping to protect against adverse price movements while allowing for enough room for trades to develop.
Each market behaves differently across various timeframes, and it is essential to test different parameters and optimizations to find out which trailing stop-loss method gives you the desired results and performance.
What type of break-even and take profit identification methods are used in this strategy? What are the underlying calculations?
For Break-Even:
Percentage (%) Based:
Moves the initial stop-loss to the entry price when the price reaches a certain percentage above the entry.
Calculation:
Break-even level = Entry Price * (1 + Percentage / 100)
Example:
If the entry price is $100 and the break-even percentage is 5%, the break-even level is $100 * 1.05 = $105.
Risk-to-Reward (RR) Based:
Moves the initial stop-loss to the entry price when the price reaches a certain RR ratio.
Calculation:
Break-even level = Entry Price + (Initial Risk * RR Ratio)
For TP1 (Take Profit 1):
- You can choose to set a take profit level at which your position gets fully closed or 50% if the TP2 boolean is enabled.
- Similar to break-even, you can select either a percentage (%) or risk-to-reward (RR) based take profit level, allowing you to set your TP1 level as a percentage amount above the entry price or based on RR.
For TP2 (Take Profit 2):
- You can choose to set a take profit level at which your position gets fully closed.
- As with break-even and TP1, you can select either a percentage (%) or risk-to-reward (RR) based take profit level, allowing you to set your TP2 level as a percentage amount above the entry price or based on RR.
What's the day filter Filter, what does it do?
The day filter allows users to customize the session time and choose the specific days they want to include in the strategy session. This helps traders tailor their strategies to particular trading sessions or days of the week when they believe the market conditions are more favorable for their trading style.
Customize Session Time:
Users can define the start and end times for the trading session.
This allows the strategy to only consider trades within the specified time window, focusing on periods of higher market activity or preferred trading hours.
Select Days:
Users can select which days of the week to include in the strategy.
This feature is useful for excluding days with historically lower volatility or unfavorable trading conditions (e.g., Mondays or Fridays).
Benefits:
Focus on Optimal Trading Periods:
By customizing session times and days, traders can focus on periods when the market is more likely to present profitable opportunities.
Avoid Unfavorable Conditions:
Excluding specific days or times can help avoid trading during periods of low liquidity or high unpredictability, such as major news events or holidays.
What tables are available in this script?
- Summary: Provides a general overview, displaying key performance parameters such as Net Profit, Profit Factor, Max Drawdown, Average Trade, Closed Trades and more.
Total Commission: Displays the cumulative commissions incurred from all trades executed within the selected backtesting window. This value is derived by summing the commission fees for each trade on your chart.
Average Commission: Represents the average commission per trade, calculated by dividing the Total Commission by the total number of closed trades. This metric is crucial for assessing the impact of trading costs on overall profitability.
Avg Trade: The sum of money gained or lost by the average trade generated by a strategy. Calculated by dividing the Net Profit by the overall number of closed trades. An important value since it must be large enough to cover the commission and slippage costs of trading the strategy and still bring a profit.
MaxDD: Displays the largest drawdown of losses, i.e., the maximum possible loss that the strategy could have incurred among all of the trades it has made. This value is calculated separately for every bar that the strategy spends with an open position.
Profit Factor: The amount of money a trading strategy made for every unit of money it lost (in the selected currency). This value is calculated by dividing gross profits by gross losses.
Avg RR: This is calculated by dividing the average winning trade by the average losing trade. This field is not a very meaningful value by itself because it does not take into account the ratio of the number of winning vs losing trades, and strategies can have different approaches to profitability. A strategy may trade at every possibility in order to capture many small profits, yet have an average losing trade greater than the average winning trade. The higher this value is, the better, but it should be considered together with the percentage of winning trades and the net profit.
Winrate: The percentage of winning trades generated by a strategy. Calculated by dividing the number of winning trades by the total number of closed trades generated by a strategy. Percent profitable is not a very reliable measure by itself. A strategy could have many small winning trades, making the percent profitable high with a small average winning trade, or a few big winning trades accounting for a low percent profitable and a big average winning trade. Most mean-reversion successful strategies have a percent profitability of 40-80% but are profitable due to risk management control.
BE Trades: Number of break-even trades, excluding commission/slippage.
Losing Trades: The total number of losing trades generated by the strategy.
Winning Trades: The total number of winning trades generated by the strategy.
Total Trades: Total number of taken traders visible your charts.
Net Profit: The overall profit or loss (in the selected currency) achieved by the trading strategy in the test period. The value is the sum of all values from the Profit column (on the List of Trades tab), taking into account the sign.
- Monthly: Displays performance data on a month-by-month basis, allowing users to analyze performance trends over each month and year.
- Weekly: Displays performance data on a week-by-week basis, helping users to understand weekly performance variations.
- UI Table: A user-friendly table that allows users to view and save the selected strategy parameters from user inputs. This table enables easy access to key settings and configurations, providing a straightforward solution for saving strategy parameters by simply taking a screenshot with Alt + S or ⌥ + S.
User-input styles and customizations:
To facilitate studying historical data, all conditions and filters can be applied to your charts. By plotting background colors on your charts, you'll be able to identify what worked and what didn't in certain market conditions.
Please note that all background colors in the style are disabled by default to enhance visualization.
How to Use This Quantitive Strategy Builder to Create a Profitable Edge and System?
Choose Your Strategy mode:
- Decide whether you are creating an investing strategy or a trading strategy.
Select a Market:
- Choose a one-sided market such as stocks, indices, or cryptocurrencies.
Historical Data:
- Ensure the historical data covers at least 10 years of price action for robust backtesting.
Timeframe Selection:
- Choose the timeframe you are comfortable trading with. It is strongly recommended to use a timeframe above 15 minutes to minimize the impact of commissions/slippage on your profits.
Set Commission and Slippage:
- Properly set the commission and slippage in the strategy properties according to your broker/prop firm specifications.
Parameter Optimization:
- Use trial and error to test different parameters until you find the performance results you are looking for in the summary table or, preferably, through deep backtesting using the strategy tester.
Trade Count:
- Ensure the number of trades is 200 or more; the higher, the better for statistical significance.
Positive Average Trade:
- Make sure the average trade is above zero.
(An important value since it must be large enough to cover the commission and slippage costs of trading the strategy and still bring a profit.)
Performance Metrics:
- Look for a high profit factor, and net profit with minimum drawdown.
- Ideally, aim for a drawdown under 20-30%, depending on your risk tolerance.
Refinement and Optimization:
- Try out different markets and timeframes.
- Continue working on refining your edge using the available filters and components to further optimize your strategy.
What makes this strategy original?
QuantBuilder stands out due to its unique combination of quantitative techniques and innovative algorithms that leverage historical data for real-time trading decisions. Unlike most algorithmic strategies that work based on predefined rules, this strategy adapts to real-time market probabilities and expected values, enhancing its reliability. Key features include:
Mathematical Framework: The strategy integrates advanced mathematical concepts, such as probabilities and expected values, to assess trade viability and optimize decision-making.
Multi-Timeframe Analysis: By utilizing multi-timeframe probabilities, QuantBuilder provides a comprehensive view of market conditions, enhancing the accuracy of entry and exit points.
Dynamic Market Structure Identification: The script employs a systematic approach to identify market structure changes, utilizing a blend of swing highs and lows to detect contextual/direction bias of the market.
Built-in Trailing Stop Loss: The strategy features a dynamic trailing stop loss based on multi-timeframe analysis of market structure. This allows traders to lock in profits while adapting to changing market conditions, ensuring that exits are executed at optimal levels without prematurely closing positions.
Robust Performance Metrics: With detailed performance tables and visualizations, users can easily evaluate strategy effectiveness and adjust parameters based on historical performance.
Adaptability: The strategy is designed to work across various markets and timeframes, making it versatile for different trading styles and objectives.
Suitability for Investors and Traders: QuantBuilder is ideal for both investors and traders looking to rely on mathematically proven data to create profitable strategies, ensuring that decisions are grounded in quantitative analysis.
These original elements combine to create a powerful tool that can help both traders and investors to build and refine profitable strategies based on algorithmic quantitative analysis.
Terms and Conditions | Disclaimer
Our charting tools are provided for informational and educational purposes only and should not be construed as financial, investment, or trading advice. They are not intended to forecast market movements or offer specific recommendations. Users should understand that past performance does not guarantee future results and should not base financial decisions solely on historical data.
Built-in components, features, and functionalities of our charting tools are the intellectual property of @Fractalyst Unauthorized use, reproduction, or distribution of these proprietary elements is prohibited.
By continuing to use our charting tools, the user acknowledges and accepts the Terms and Conditions outlined in this legal disclaimer and agrees to respect our intellectual property rights and comply with all applicable laws and regulations.
Algorithmictrading
BE-NSE-Distributed Straddle Intraday Trading StrategyHerewith publishing the script (not the Indicator!) for the benift of Option Traders. I call this a script as this doesn't perform any kind of analysis of candle data and provide general BUY | SELL information. This Script is based on the TRUE VALUES concept which is nothing but LTP.
Idea Behind this Script:
As an option seller i need the lower risk option premium to trade. so that, time can work in our favor. basic question which we get at the first is which option to choose out of many available.
If traders feel the question is apt then this script is for them.
Logic Behind this script:
Upon Market Open, script in the BACKEND ( Under the hood ) deployes 60 possible combinations of STRADDLES for sampling, and continue to monitor the LTP movements and compares it against opposite pairs. lets say out of 30 Straddle options one of the Straddle it picked is ATM CE VS ATM PE. for 1 rs move in underlying how much impact is happening in CE VS PE.
This simple anlysis is done at every 30 seconds. once the Analysis is complete it picks 4 options 2 on the CALL side and 2 on the PUT side, which script feels the movement of prices are smooth. SMOOTH refers that time decay that can work in our favor..
Calculations behid the script:
lets say BNF LTP is 52000 at 9:20 AM, and one of the pair script took for sampling was ATM CE vs PE which are having the LTP of 100 each.
At 9:35 AM, BNF is trading at 52075, and ATM CE is reading the LTP of 122 and ATM PUT is reading the LTP of 70. ideally LTP of Call should be around 135 and Put should be around 65 considering the usual delta of 0.48 . Net Money Index for this Pair Sample is 8
Call Side => 100 - 122 = -22
Put Side => 100 - 70 = 30
Money Index => 30 - 22 = 8 for 15 Min
This Money index is calculated across choosen samples and the Option strikes is provided as an output which has mere possiblity of working in Options Seller's favor.
How to Read the Output:
For the choosen strikes from the time of Entry (Suggested Entry time by script) till the current time, the bottom pane plots the Money index as columns. Green Columns indicate that how much option premium eroded due to time decay. Red Columns indicate that how much Option premium increased during the time.
Note: Script dynamically calculate the strikes and suggests in realtime.
WARNING or a Humble Request:
For those who don't understand the word "Repaint" how it works in Pine Script. plz don't consider using this script. For those who wish to understand I have kept the Observer mode in the settings which shall guide you on why the Money Index shown on the chart when the MARKET IS CLOSED is different than when the MARKET IS OPEN (Realtime).
Disclaimer:
I have tested the script only in BNF and not sure if this works on Nifty, FinNifty or others. you may still try and plz do provide the feedback for improvising the script.
----- BreathEasy --------
The information contained in my scripts/indicators/ideas does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, or individual’s trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My scripts/indicators/ideas are only for educational purposes!
AlgoBuilder [Mean-Reversion] | FractalystWhat's the strategy's purpose and functionality?
This strategy is designed for both traders and investors looking to rely and trade based on historical and backtested data using automation.
The main goal is to build profitable mean-reversion strategies that outperform the underlying asset in terms of returns while minimizing drawdown.
For example, as for a benchmark, if the S&P 500 (SPX) has achieved an estimated 10% annual return with a maximum drawdown of -57% over the past 20 years, using this strategy with different entry and exit techniques, users can potentially seek ways to achieve a higher Compound Annual Growth Rate (CAGR) while maintaining a lower maximum drawdown.
Although the strategy can be applied to all markets and timeframes, it is most effective on stocks, indices, future markets, cryptocurrencies, and commodities and JPY currency pairs given their trending behaviors.
In trending market conditions, the strategy employs a combination of moving averages and diverse entry models to identify and capitalize on upward market movements. It integrates market structure-based moving averages and bands mechanisms across different timeframes and provides exit techniques, including percentage-based and risk-reward (RR) based take profit levels.
Additionally, the strategy has also a feature that includes a built-in probability function for traders who want to implement probabilities right into their trading strategies.
Performance summary, weekly, and monthly tables enable quick visualization of performance metrics like net profit, maximum drawdown, profit factor, average trade, average risk-reward ratio (RR), and more.
This aids optimization to meet specific goals and risk tolerance levels effectively.
-----
How does the strategy perform for both investors and traders?
The strategy has two main modes, tailored for different market participants: Traders and Investors.
Trading:
1. Trading:
- Designed for traders looking to capitalize on bullish trending markets.
- Utilizes a percentage risk per trade to manage risk and optimize returns.
- Suitable for active trading with a focus on mean-reversion and risk per trade approach.
◓: Mode | %: Risk percentage per trade
3. Investing:
- Geared towards investors who aim to capitalize on bullish trending markets without using leverage while mitigating the asset's maximum drawdown.
- Utilizes pre-define percentage of the equity to buy, hold, and manage the asset.
- Focuses on long-term growth and capital appreciation by fully investing in the asset during bullish conditions.
- ◓: Mode | %: Risk not applied (In investing mode, the strategy uses 10% of equity to buy the asset)
-----
What's is FRMA? How does the triple bands work? What are the underlying calculations?
Middle Band (FRMA):
The middle band is the core of the FRMA system. It represents the Fractalyst Moving Average, calculated by identifying the most recent external swing highs and lows in the market structure.
By determining these external swing pivot points, which act as significant highs and lows within the market range, the FRMA provides a unique moving average that adapts to market structure changes.
Upper Band:
The upper band shows the average price of the most recent external swing highs.
External swing highs are identified as the highest points between pivot points in the market structure.
This band helps traders identify potential overbought conditions when prices approach or exceed this upper band.
Lower Band:
The lower band shows the average price of the most recent external swing lows.
External swing lows are identified as the lowest points between pivot points in the market structure.
The script utilizes this band to identify potential oversold conditions, triggering entry signals as prices approach or drop below the lower band.
Adjustments Based on User Inputs:
Users can adjust how the upper and lower bands are calculated based on their preferences:
Upper/Lower: This method calculates the average bands using the prices of external swing highs and lows identified in the market.
Percentage Deviation from FRMA: Alternatively, users can opt to calculate the bands based on a percentage deviation from the middle FRMA. This approach provides flexibility to adjust the width of the bands relative to market conditions and volatility.
-----
What's the purpose of using moving averages in this strategy? What are the underlying calculations?
Using moving averages is a widely-used technique to trade with the trend.
The main purpose of using moving averages in this strategy is to filter out bearish price action and to only take trades when the price is trading ABOVE specified moving averages.
The script uses different types of moving averages with user-adjustable timeframes and periods/lengths, allowing traders to try out different variations to maximize strategy performance and minimize drawdowns.
By applying these calculations, the strategy effectively identifies bullish trends and avoids market conditions that are not conducive to profitable trades.
The MA filter allows traders to choose whether they want a specific moving average above or below another one as their entry condition.
This comparison filter can be turned on (>) or off.
For example, you can set the filter so that MA#1 > MA#2, meaning the first moving average must be above the second one before the script looks for entry conditions. This adds an extra layer of trend confirmation, ensuring that trades are only taken in more favorable market conditions.
⍺: MA Period | Σ: MA Timeframe
-----
What entry modes are used in this strategy? What are the underlying calculations?
The strategy by default uses two different techniques for the entry criteria with user-adjustable left and right bars: Breakout and Fractal.
1. Breakout Entries :
- The strategy looks for pivot high points with a default period of 3.
- It stores the most recent high level in a variable.
- When the price crosses above this most recent level, the strategy checks if all conditions are met and the bar is closed before taking the buy entry.
◧: Pivot high left bars period | ◨: Pivot high right bars period
2. Fractal Entries :
- The strategy looks for pivot low points with a default period of 3.
- When a pivot low is detected, the strategy checks if all conditions are met and the bar is closed before taking the buy entry.
◧: Pivot low left bars period | ◨: Pivot low right bars period
2. Hunt Entries :
- The strategy identifies a candle that wicks through the lower FRMA band.
- It waits for the next candle to close above the low of the wick candle.
- When this condition is met and the bar is closed, the strategy takes the buy entry.
By utilizing these entry modes, the strategy aims to capitalize on bullish price movements while ensuring that the necessary conditions are met to validate the entry points.
-----
What type of stop-loss identification method are used in this strategy? What are the underlying calculations?
Initial Stop-Loss:
1. ATR Based:
The Average True Range (ATR) is a method used in technical analysis to measure volatility. It is not used to indicate the direction of price but to measure volatility, especially volatility caused by price gaps or limit moves.
Calculation:
- To calculate the ATR, the True Range (TR) first needs to be identified. The TR takes into account the most current period high/low range as well as the previous period close.
The True Range is the largest of the following:
- Current Period High minus Current Period Low
- Absolute Value of Current Period High minus Previous Period Close
- Absolute Value of Current Period Low minus Previous Period Close
- The ATR is then calculated as the moving average of the TR over a specified period. (The default period is 14).
Example - ATR (14) * 2
⍺: ATR period | Σ: ATR Multiplier
2. ADR Based:
The Average Day Range (ADR) is an indicator that measures the volatility of an asset by showing the average movement of the price between the high and the low over the last several days.
Calculation:
- To calculate the ADR for a particular day:
- Calculate the average of the high prices over a specified number of days.
- Calculate the average of the low prices over the same number of days.
- Find the difference between these average values.
- The default period for calculating the ADR is 14 days. A shorter period may introduce more noise, while a longer period may be slower to react to new market movements.
Example - ADR (20) * 2
⍺: ADR period | Σ: ADR Multiplier
3. PL Based:
This method places the stop-loss at the low of the previous candle.
If the current entry is based on the hunt entry strategy, the stop-loss will be placed at the low of the candle that wicks through the lower FRMA band.
Example:
If the previous candle's low is 100, then the stop-loss will be set at 100.
This method ensures the stop-loss is placed just below the most recent significant low, providing a logical and immediate level for risk management.
Application in Strategy (ATR/ADR):
- The strategy calculates the current bar's ADR/ATR with a user-defined period.
- It then multiplies the ADR/ATR by a user-defined multiplier to determine the initial stop-loss level.
By using these methods, the strategy dynamically adjusts the initial stop-loss based on market volatility, helping to protect against adverse price movements while allowing for enough room for trades to develop.
Each market behaves differently across various timeframes, and it is essential to test different parameters and optimizations to find out which trailing stop-loss method gives you the desired results and performance.
-----
What type of break-even and take profit identification methods are used in this strategy? What are the underlying calculations?
For Break-Even:
Percentage (%) Based:
Moves the initial stop-loss to the entry price when the price reaches a certain percentage above the entry.
Calculation:
Break-even level = Entry Price * (1 + Percentage / 100)
Example:
If the entry price is $100 and the break-even percentage is 5%, the break-even level is $100 * 1.05 = $105.
Risk-to-Reward (RR) Based:
Moves the initial stop-loss to the entry price when the price reaches a certain RR ratio.
Calculation:
Break-even level = Entry Price + (Initial Risk * RR Ratio)
Example:
If the entry price is $100, the initial risk is $10, and the RR ratio is 2, the break-even level is $100 + ($10 * 2) = $120.
FRMA Based:
Moves the stop-loss to break-even when the price hits the FRMA level at which the entry was taken.
Calculation:
Break-even level = FRMA level at the entry
Example:
If the FRMA level at entry is $102, the break-even level is set to $102 when the price reaches $102.
For TP1 (Take Profit 1):
- You can choose to set a take profit level at which your position gets fully closed or 50% if the TP2 boolean is enabled.
- Similar to break-even, you can select either a percentage (%) or risk-to-reward (RR) based take profit level, allowing you to set your TP1 level as a percentage amount above the entry price or based on RR.
For TP2 (Take Profit 2):
- You can choose to set a take profit level at which your position gets fully closed.
- As with break-even and TP1, you can select either a percentage (%) or risk-to-reward (RR) based take profit level, allowing you to set your TP2 level as a percentage amount above the entry price or based on RR.
When Both Percentage (%) Based and RR Based Take Profit Levels Are Off:
The script will adjust the take profit level to the higher FRMA band set within user inputs.
Calculation:
Take profit level = Higher FRMA band length/timeframe specified by the user.
This ensures that when neither percentage-based nor risk-to-reward-based take profit methods are enabled, the strategy defaults to using the higher FRMA band as the take profit level, providing a consistent and structured approach to profit-taking.
For TP1 and TP2, it's specifying the price levels at which the position is partially or fully closed based on the chosen method (percentage or RR) above the entry price.
These calculations are crucial for managing risk and optimizing profitability in the strategy.
⍺: BE/TP type (%/RR) | Σ: how many RR/% above the current price
-----
What's the ADR filter? What does it do? What are the underlying calculations?
The Average Day Range (ADR) measures the volatility of an asset by showing the average movement of the price between the high and the low over the last several days.
The period of the ADR filter used in this strategy is tied to the same period you've used for your initial stop-loss.
Users can define the minimum ADR they want to be met before the script looks for entry conditions.
ADR Bias Filter:
- Compares the current bar ADR with the ADR (Defined by user):
- If the current ADR is higher, it indicates that volatility has increased compared to ADR (DbU).(⬆)
- If the current ADR is lower, it indicates that volatility has decreased compared to ADR (DbU).(⬇)
Calculations:
1. Calculate ADR:
- Average the high prices over the specified period.
- Average the low prices over the same period.
- Find the difference between these average values in %.
2. Current ADR vs. ADR (DbU):
- Calculate the ADR for the current bar.
- Calculate the ADR (DbU).
- Compare the two values to determine if volatility has increased or decreased.
By using the ADR filter, the strategy ensures that trades are only taken in favorable market conditions where volatility meets the user's defined threshold, thus optimizing entry conditions and potentially improving the overall performance of the strategy.
>: Minimum required ADR for entry | %: Current ADR comparison to ADR of 14 days ago.
-----
What's the probability filter? What are the underlying calculations?
The probability filter is designed to enhance trade entries by using buyside liquidity and probability analysis to filter out unfavorable conditions.
This filter helps in identifying optimal entry points where the likelihood of a profitable trade is higher.
Calculations:
1. Understanding Swing highs and Swing Lows
Swing High: A Swing High is formed when there is a high with 2 lower highs to the left and right.
Swing Low: A Swing Low is formed when there is a low with 2 higher lows to the left and right.
2. Understanding the purpose and the underlying calculations behind Buyside, Sellside and Equilibrium levels.
3. Understanding probability calculations
1. Upon the formation of a new range, the script waits for the price to reach and tap into equilibrium or the 50% level. Status: "⏸" - Inactive
2. Once equilibrium is tapped into, the equilibrium status becomes activated and it waits for either liquidity side to be hit. Status: "▶" - Active
3. If the buyside liquidity is hit, the script adds to the count of successful buyside liquidity occurrences. Similarly, if the sellside is tapped, it records successful sellside liquidity occurrences.
5. Finally, the number of successful occurrences for each side is divided by the overall count individually to calculate the range probabilities.
Note: The calculations are performed independently for each directional range. A range is considered bearish if the previous breakout was through a sellside liquidity. Conversely, a range is considered bullish if the most recent breakout was through a buyside liquidity.
Example - BSL > 55%
-----
What's the range length Filter? What are the underlying calculations?
The range length filter identifies the price distance between buyside and sellside liquidity levels in percentage terms. When enabled, the script only looks for entries when the minimum range length is met. This helps ensure that trades are taken in markets with sufficient price movement.
Calculations:
Range Length (%) = ( ( Buyside Level − Sellside Level ) / Current Price ) ×100
Range Bias Identification:
Bullish Bias: The current range price has broken above the previous external swing high.
Bearish Bias: The current range price has broken below the previous external swing low.
Example - Range length filter is enabled | Range must be above 1%
>: Minimum required range length for entry | %: Current range length percentage in a (Bullish/Bearish) range
-----
What's the day filter Filter, what does it do?
The day filter allows users to customize the session time and choose the specific days they want to include in the strategy session. This helps traders tailor their strategies to particular trading sessions or days of the week when they believe the market conditions are more favorable for their trading style.
Customize Session Time:
Users can define the start and end times for the trading session.
This allows the strategy to only consider trades within the specified time window, focusing on periods of higher market activity or preferred trading hours.
Select Days:
Users can select which days of the week to include in the strategy.
This feature is useful for excluding days with historically lower volatility or unfavorable trading conditions (e.g., Mondays or Fridays).
Benefits:
Focus on Optimal Trading Periods:
By customizing session times and days, traders can focus on periods when the market is more likely to present profitable opportunities.
Avoid Unfavorable Conditions:
Excluding specific days or times can help avoid trading during periods of low liquidity or high unpredictability, such as major news events or holidays.
Increased Flexibility: The filter provides increased flexibility, allowing traders to adapt the strategy to their specific needs and preferences.
Example - Day filter | Session Filter
θ: Session time | Exchange time-zone
-----
What tables are available in this script?
Table Type:
- Summary: Provides a general overview, displaying key performance parameters such as Net Profit, Profit Factor, Max Drawdown, Average Trade, Closed Trades and more.
Avg Trade: The sum of money gained or lost by the average trade generated by a strategy. Calculated by dividing the Net Profit by the overall number of closed trades. An important value since it must be large enough to cover the commission and slippage costs of trading the strategy and still bring a profit.
MaxDD: Displays the largest drawdown of losses, i.e., the maximum possible loss that the strategy could have incurred among all of the trades it has made. This value is calculated separately for every bar that the strategy spends with an open position.
Profit Factor: The amount of money a trading strategy made for every unit of money it lost (in the selected currency). This value is calculated by dividing gross profits by gross losses.
Avg RR: This is calculated by dividing the average winning trade by the average losing trade. This field is not a very meaningful value by itself because it does not take into account the ratio of the number of winning vs losing trades, and strategies can have different approaches to profitability. A strategy may trade at every possibility in order to capture many small profits, yet have an average losing trade greater than the average winning trade. The higher this value is, the better, but it should be considered together with the percentage of winning trades and the net profit.
Winrate: The percentage of winning trades generated by a strategy. Calculated by dividing the number of winning trades by the total number of closed trades generated by a strategy. Percent profitable is not a very reliable measure by itself. A strategy could have many small winning trades, making the percent profitable high with a small average winning trade, or a few big winning trades accounting for a low percent profitable and a big average winning trade. Most mean-reversion successful strategies have a percent profitability of 40-80% but are profitable due to risk management control.
BE Trades: Number of break-even trades, excluding commission/slippage.
Losing Trades: The total number of losing trades generated by the strategy.
Winning Trades: The total number of winning trades generated by the strategy.
Total Trades: Total number of taken traders visible your charts.
Net Profit: The overall profit or loss (in the selected currency) achieved by the trading strategy in the test period. The value is the sum of all values from the Profit column (on the List of Trades tab), taking into account the sign.
- Monthly: Displays performance data on a month-by-month basis, allowing users to analyze performance trends over each month.
- Weekly: Displays performance data on a week-by-week basis, helping users to understand weekly performance variations.
- OFF: Hides the performance table.
Profit Color:
- Allows users to set the color for representing profit in the performance table, helping to quickly distinguish profitable periods.
Loss Color:
- Allows users to set the color for representing loss in the performance table, helping to quickly identify loss-making periods.
These customizable tables provide traders with flexible and detailed performance analysis, aiding in better strategy evaluation and optimization.
-----
User-input styles and customizations:
To facilitate studying historical data, all conditions and rules can be applied to your charts. By plotting background colors on your charts, you'll be able to identify what worked and what didn't in certain market conditions.
Please note that all background colors in the style are disabled by default to enhance visualization.
-----
How to Use This Algobuilder to Create a Profitable Edge and System:
Choose Your Strategy mode:
- Decide whether you are creating an investing strategy or a trading strategy.
Select a Market:
- Choose a one-sided market such as stocks, indices, or cryptocurrencies.
Historical Data:
- Ensure the historical data covers at least 10 years of price action for robust backtesting.
Timeframe Selection:
- Choose the timeframe you are comfortable trading with. It is strongly recommended to use a timeframe above 15 minutes to minimize the impact of commissions/slippage on your profits.
Set Commission and Slippage:
- Properly set the commission and slippage in the strategy properties according to your broker or prop firm specifications.
Parameter Optimization:
- Use trial and error to test different parameters until you find the performance results you are looking for in the summary table or, preferably, through deep backtesting using the strategy tester.
Trade Count:
- Ensure the number of trades is 100 or more; the higher, the better for statistical significance.
Positive Average Trade:
- Make sure the average trade value is above zero.
(An important value since it must be large enough to cover the commission and slippage costs of trading the strategy and still bring a profit.)
Performance Metrics:
- Look for a high profit factor, and net profit with minimum drawdown.
- Ideally, aim for a drawdown under 20-30%, depending on your risk tolerance.
Refinement and Optimization:
- Try out different markets and timeframes.
- Continue working on refining your edge using the available filters and components to further optimize your strategy.
Automation:
- Once you’re confident in your strategy, you can use the automation section to connect the algorithm to your broker or prop firm.
- Trade a fully automated and backtested trading strategy, allowing for hands-free execution and management.
-----
What makes this strategy original?
1. Incorporating direct integration of probabilities into the strategy.
2. Utilizing built-in market structure-based moving averages across various timeframes.
4. Offering both investing and trading strategies, facilitating optimization from different perspectives.
5. Automation for efficient execution.
6. Providing a summary table for instant access to key parameters of the strategy.
-----
How to use automation?
For Traders:
1. Ensure the strategy parameters are properly set based on your optimized parameters.
2. Enter your PineConnector License ID in the designated field.
3. Specify the desired risk level.
4. Provide the Metatrader symbol.
5. Check for chart updates to ensure the automation table appears on the top right corner, displaying your License ID, risk, and symbol.
6. Set up an alert with the strategy selected as Condition and the Message as {{strategy.order.alert_message}}.
7. Activate the Webhook URL in the Notifications section, setting it as the official PineConnector webhook address.
8. Double-check all settings on PineConnector to ensure the connection is successful.
9. Create the alert for entry/exit automation.
For Investors:
1. Ensure the strategy parameters are properly set based on your optimized parameters.
2. Choose "Investing" in the user-input settings.
3. Create an alert with a specified name.
4. Customize the notifications tab to receive alerts via email.
5. Buying/selling alerts will be triggered instantly upon entry or exit order execution.
-----
Terms and Conditions | Disclaimer
Our charting tools are provided for informational and educational purposes only and should not be construed as financial, investment, or trading advice. They are not intended to forecast market movements or offer specific recommendations. Users should understand that past performance does not guarantee future results and should not base financial decisions solely on historical data.
Built-in components, features, and functionalities of our charting tools are the intellectual property of @Fractalyst Unauthorized use, reproduction, or distribution of these proprietary elements is prohibited.
By continuing to use our charting tools, the user acknowledges and accepts the Terms and Conditions outlined in this legal disclaimer and agrees to respect our intellectual property rights and comply with all applicable laws and regulations.
Markov Chain Trend IndicatorOverview
The Markov Chain Trend Indicator utilizes the principles of Markov Chain processes to analyze stock price movements and predict future trends. By calculating the probabilities of transitioning between different market states (Uptrend, Downtrend, and Sideways), this indicator provides traders with valuable insights into market dynamics.
Key Features
State Identification: Differentiates between Uptrend, Downtrend, and Sideways states based on price movements.
Transition Probability Calculation: Calculates the probability of transitioning from one state to another using historical data.
Real-time Dashboard: Displays the probabilities of each state on the chart, helping traders make informed decisions.
Background Color Coding: Visually represents the current market state with background colors for easy interpretation.
Concepts Underlying the Calculations
Markov Chains: A stochastic process where the probability of moving to the next state depends only on the current state, not on the sequence of events that preceded it.
Logarithmic Returns: Used to normalize price changes and identify states based on significant movements.
Transition Matrices: Utilized to store and calculate the probabilities of moving from one state to another.
How It Works
The indicator first calculates the logarithmic returns of the stock price to identify significant movements. Based on these returns, it determines the current state (Uptrend, Downtrend, or Sideways). It then updates the transition matrices to keep track of how often the price moves from one state to another. Using these matrices, the indicator calculates the probabilities of transitioning to each state and displays this information on the chart.
How Traders Can Use It
Traders can use the Markov Chain Trend Indicator to:
Identify Market Trends: Quickly determine if the market is in an uptrend, downtrend, or sideways state.
Predict Future Movements: Use the transition probabilities to forecast potential market movements and make informed trading decisions.
Enhance Trading Strategies: Combine with other technical indicators to refine entry and exit points based on predicted trends.
Example Usage Instructions
Add the Markov Chain Trend Indicator to your TradingView chart.
Observe the background color to quickly identify the current market state:
Green for Uptrend, Red for Downtrend, Gray for Sideways
Check the dashboard label to see the probabilities of transitioning to each state.
Use these probabilities to anticipate market movements and adjust your trading strategy accordingly.
Combine the indicator with other technical analysis tools for more robust decision-making.
Hulk Grid Algorithm V2 - The Quant ScienceIt's the latest proprietary grid algorithm developed by our team. This software represents a clearer and more comprehensive modernization of the deprecated Hulk Grid Algorithm. In this new release, we have optimized the source code architecture and investment logic, which we will describe in detail below.
Overview
Hulk Grid Algorithm V2 is designed to optimize returns in sideways market conditions. In this scenario, the algorithm divides purchases with long orders at each level of the grid. Unlike a typical grid algorithm, this version applies an anti-martingale model to mitigate volatility and optimize the average entry price. Starting from the lower level, the purchase quantity is increased at each new subsequent level until reaching the upper level. The initial quantity of the first order is fixed at 0.50% of the initial capital. With each new order, the initial quantity is multiplied by a value equal to the current grid level (where 1 is the lower level and 10 is the upper level).
Example: Let's say we have an initial capital of $10,000. The initial capital for the first order would be $50 * 1 = $50, for the second order $50 * 2 = $100, for the third order $50 * 3 = $150, and so on until reaching the upper level.
All previously opened orders are closed using a percentage-based stop-loss and take-profit, calculated based on the extremes of the grid.
Set Up
As mentioned earlier, the user's goal is to analyze this strategy in markets with a lack of trend, also known as sideways markets. After identifying a price range within which the asset tends to move, the user can choose to create the grid by placing the starting price at the center of the range. This way, they can consider trading the asset, if the backtesting generates a return greater than the Buy & Hold return.
Grid Configuration
To create the grid, it's sufficient to choose the starting price during the launch phase. This level will be the center of the grid from which the upper and lower levels will be calculated. The grid levels are computed using an arithmetic method, adding and subtracting a configurable fixed amount from the user interface (Grid Step $).
Example: Let's imagine choosing 1000 as the starting price and 50 as the Grid Step ($). The upper levels will be 1000, 1050, 1100, 1150, 1200. The lower levels will be 950, 900, 850, 800, and 750.
Markets
This software can be used in all markets: stocks, indices, commodities, cryptocurrencies, ETFs, Forex, etc.
Application
With this backtesting software, is possible to analyze the strategy and search for markets where it can generate better performance than Buy & Hold returns. There are no alerts or automatic investment mechanisms, and currently, the strategy can only be executed manually.
Design
Is possible to modify the grid style and customize colors by accessing the Properties section of the user interface.
Hybrid EMA AlgoLearner⭕️Innovative trading indicator that utilizes a k-NN-inspired algorithmic approach alongside traditional Exponential Moving Averages (EMAs) for more nuanced analysis. While the algorithm doesn't actually employ machine learning techniques, it mimics the logic of the k-Nearest Neighbors (k-NN) methodology. The script takes into account the closest 'k' distances between a short-term and long-term EMA to create a weighted short-term EMA. This combination of rule-based logic and EMA technicals offers traders a more sophisticated tool for market analysis.
⭕️Foundational EMAs: The script kicks off by generating a 50-period short-term EMA and a 200-period long-term EMA. These EMAs serve a dual purpose: they provide the basic trend-following capability familiar to most traders, akin to the classic EMA 50 and EMA 200, and set the stage for more intricate calculations to follow.
⭕️k-NN Integration: The indicator distinguishes itself by introducing k-NN (k-Nearest Neighbors) logic into the mix. This machine learning technique scans prior market data to find the closest 'neighbors' or distances between the two EMAs. The 'k' closest distances are then picked for further analysis, thus imbuing the indicator with an added layer of data-driven context.
⭕️Algorithmic Weighting: After the k closest distances are identified, they are utilized to compute a weighted EMA. Each of the k closest short-term EMA values is weighted by its associated distance. These weighted values are summed up and normalized by the sum of all chosen distances. The result is a weighted short-term EMA that packs more nuanced information than a simple EMA would.
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.
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 .
Cloud X MesoHello there fellow Traders!
Thanks for stopping by, so today I will be covering everything you need to to know about this TradingView strategy.
Below I will discuss everything you need to know about this strategy so you can get a full grasp of what the strategy is, the features, what it does, how it works, the benefits of how this strategy can help you, and the results.
What is Cloud X Meso?
-Cloud X Meso is a strategy that consists of 7 indicators to all line up for total confluence to take a buy or sell once all 6 indicators conditions are met. This strategy does not repaint and doesn't require any technical analysis to be used. The strategy can be used on any timeframe, and any instrument.
-I have optimized many different variations for different types of trading instruments of this strategy ready to be used. The difference of this strategy is that these variations do not need any reoptimization to keep up with recent market conditions since there are hardly any inputs used, which prevents common overfitting problems. The main goal was for this strategy to be automated, as well as plug and play or you can officially consider this as set and forever forget.
What does this strategy do?
-The main goal for this strategy is to catch long or short term trends by waiting for all 7 indicators to line up as well as using customized trading times to trade certain sessions where there is high amounts of volume in the market. This strategy doesn't always need to have a clear trending market, since it can also catch short term trends in choppy markets as well. Overall, the strategy tell you when it buys, sells, and exits after all conditions are met.
How does the strategy work?
-The way that this strategy works is when all of the indicators confluences are met. Next, a buy or sell label will print and the candles colors will color blue or red to show that the trade is in the buy or sell position followed along with a magenta colored line which is the trailing stop to follow the trade until the trade exits from the trailing stop being hit or if the strategies exit condition is met.
-The strategy does have a set Take Profit target since it relies on the trailing stop to end the trade. This is beneficial so you can catch any size of a trend move when the strategy is in high volume market sessions. You catch these trends by customizing the settings to toggle on or off certain indicators, functions, configuring a customized trading time, and toggling on or off certain trading days to make a specific approach for fine tuning a pair to trade in a certain time window with high amounts of volume to catch trending moves whether it be a long or short term trend.
Below I will explain each functionality of the strategy for you to better understand the different ways you can adjust the settings of this strategy.
Backtest Settings:
-You can use these settings to determine a start / end date of what results you would like to see in the strategy tester.
-You can determine the $ amount you would like to see on strategy testers results to be in terms of net profit and max drawdown.
-You can choose whether you want the strategy to take buys only, sells only, or buys and sells.
Automation:
-Compatible with Pine Connectors to fully automate this strategy for MT4/5
-It uses a % based risk when placing trades so you won't have to calculate a proper lot size or dollar amount.
-You can also put the symbol of what that strategy will be trading on so you know what pair its trading.
Custom Trading Times:
-When you customize a trading time for the strategy to trade in, the background will turn blue for that specific time window, and you can use the "Session Exit" function to have trades close once the time window ends when toggled on, or you can have the existing trades close on their own when "Session Exit" is toggled off.
Dynamic Trailing:
-The algorithm uses a volatility based indicator to determine proper stop loss placement depending on how volatile the market is. This will prevent you from guesstimating if your stop loss is too big or too small.
-When Dynamic trailing is off, then the strategy will use a Risk Reward based stop loss to trail everytime the trades hits a new Risk Reward target.
-You can also toggle on or off for the stop loss to go to break even once the trade hits a 1:1 Risk Reward.
Directional Bias Settings:
-This indicator is the main directional bias that uses a multi timeframe function to determine the directional bias, you can also use the Exponential Moving Average as a form of directional bias instead, or you can use both of them to work together to find the directional bias. You can also toggle each one on or off
Entry / Exit Settings:
-This indicator also uses a multi timeframe function but it determines the entry and exit for a trade when all confluences are met. You can also toggle the entry and exit functions on or off.
1 Candle Rule:
-This feature is inspired by No Nonsense Forex (NNFX) the main function of this is if your entry doesn't meet all the entry conditions, then the strategy will wait 1 more candle to meet all the entry conditions to take a trade.
No Trade Zone:
-This feature will uses a Volume based indicator to filter out low volume markets. The candles will turn grey to indicate the algorithm not to take trades, and you can also customize the sensitivity of how strong this indicator will filter out the low volume in the markets.
Indicator functions
Each indicator plays a certain role and also meets certain conditions when a buy or sell trade is placed. I will reveal 3 out of 7 of the indicators used to preserve the uniqueness of this strategy but overall, the logic of this strategies main goal is to ride long or short terms trends while getting dynamic Risk Reward trades.
-The first indicator that the strategy uses an Exponential Moving Average that is customizable, and is used as a form of a filter for either a long or short term directional bias to filter out false signals to help the algorithm trade with the trend.
-The second indicator that the strategy uses is an Oscillator which is the Wavetrend and this indicators functionality for the algorithm is used for the its buy and sell signals to line up with all the other indicators for confluence. This indicator can also be toggled on or off for you own preference
-The third indicator used is the Volume indicator, and this is used to give the other indicators the green light to enter a trade if there are high amounts of volume in the market.
What are the benefits of using this algorithm?
Stress Free Trading:
-Once automated, you will no longer need to stare at the charts all day, as well as trying to execute the trades on time or worried that you missed a setup. Or you can choose to take trades manually when a buy or sell signal comes up
Stress Free Risk Management:
-All you have to do is provide a risk % and the algorithm will do the rest of the work calculating the stop loss, exiting trades, etc. No more needing to find the right lot size, or dollar amount, all in all the strategy will manage the trades for you.
Psychology:
-when you choose to have a systematic trading approach, it eliminates a lot bad habits from human nature
What are the results like?
-I have multiple different variations of results of this strategy, but I will share one of the results.
Here is a screenshot below of what this strategy can do from just one of the variations.
The backtest below was done with another variation on simulating a 100k account risking 0.50% per trade.
Thank you for taking the time to read through this whole guide, and I hope this helped you better understand the strategy.
Reinforced RSI - The Quant Science This strategy was designed and written with the goal of showing and motivating the community how to integrate our 'Probabilities' module with their own script.
We have recreated one of the simplest strategies used by many traders. The strategy only trades long and uses the overbought and oversold levels on the RSI indicator.
We added stop losses and take profits to offer more dynamism to the strategy. Then the 'Probabilities' module was integrated to create a probabilistic reinforcement on each trade.
Specifically, each trade is executed, only if the past probabilities of making a profitable trade is greater than or equal to 51%. This greatly increased the performance of the strategy by avoiding possible bad trades.
The backtesting was calculated on the NASDAQ:TSLA , on 15 minutes timeframe.
The strategy works on Tesla using the following parameters:
1. Lenght: 13
2. Oversold: 40
3. Overbought: 70
4. Lookback: 50
5. Take profit: 3%
6. Stop loss: 3%
Time period: January 2021 to date.
Our Probabilities Module, used in the strategy example:
Hulk Grid Algorithm - The Quant ScienceGrid-based intraday algorithm that works 50% in trend following and 50% in swing trading. Orders are executed on a grid of 10 levels. The grid levels are dynamic and calculated on the difference between the previous day's open and close. The algorithm makes only long trades based on the following logic:
1. The daily close of the previous day is analyzed, the first condition is met if the previous day was bullish, closing higher than the 'opening.
2. Must pass 'x' number of bars before placing market orders.
3. The range, as the difference between close and open of the previous day must be greater than 'x'.
If these three conditions are met then the algorithm will proceed to place long orders. On a total of 10 grid levels, up to five trades are executed per day.
If the current close is above level 1 of the grid (previous day's close) then trend following trading will take place, working on the upper 5 levels. In this case each order is placed starting at level 1 and closed at each level above.
If the current close is below level 1 of the grid (previous day's open) then swing trading will be carried out, working on the lower 5 levels. In this case each order is placed starting at level 2 and closed at the upper level.
If at the time of order execution the price is above or below the stop loss and take profit levels, the algorithm will cancel the orders and prevent trading.
All orders are closed exclusively for two reasons:
1. If the stop loss or take profit level is confirmed.
2. If the daily session is ended.
UI Interface
You can adjust:
1. Backtesting period
2. 'x' number of bars before placing orders at the market (remember to always add 2 to the number you enter in the user interface if you enter 2 then execution will occur at the market opening after the fourth bar).
3. Intercepted price range between close and open of the previous day, avoiding trading on days when the range is too low.
4. Stop loss, level calculated from the 'last lower grid, if the market breaks this level the grid is destroyed and closes all open positions.
5. Take profit, the level calculated from the last upper grid, if the market breaks this level the grid is destroyed and closes all open positions.
The backtesting you see in the example was generated on:
BINANCE:BTCUSDT
Timeframe 15 min
Stop loss 2%
Take profit 2%
Minimum bars 3
Size grid range 500
This algorithm can be used only on intraday timeframe.
iMoku (Ichimoku Complete Tool) - The Quant Science iMoku™ is a professional all-in-one solution for the famous Ichimoku Kinko Hyo indicator.
The algorithm includes:
1. Backtesting spot
2. Visual tool
3. Auto-trading functions
With iMoku you can test four different strategies.
Strategy 1: Cross Tenkan Sen - Kijun Sen
A long position is opened with 100% of the invested capital ($1000) when "Tenkan Sen" crossover "Kijun Sen".
Closing the long position on the opposite condition.
There are 3 different strength signals for this strategy: weak, normal, strong.
Weak : the signal is weak when the condition is true and the price is above the 'Kumo'
Normal : the signal is normal when the condition is true and the price is within the 'Kumo'
Strong : the signal is strong when the condition is true and the price is below the 'Kumo'
Strategy 2: Cross Price - Kijun Sen
A long position is opened with 100% of the invested capital ($1000) when the price crossover the 'Kijun Sen'.
Closing the long position on the opposite condition.
There are 3 different strength signals for this strategy: weak, normal, strong.
Weak : the signal is weak when the condition is true and the price is above the 'Kumo'
Normal : the signal is normal when the condition is true and the price is inside the 'Kumo'
Strong : the signal is strong when the condition is true and the price is below the 'Kumo'
Strategy 3: Kumo Breakout
A long position is opened with 100% of the invested capital ($1000) when the price breakup the 'Kumo'.
Closing the long position with a percentage stop loss and take profit on the invested capital.
Strategy 4: Kumo Twist
A long position is opened with 100% of the invested capital ($1000) when the 'Kumo' goes from negative to positive (called "Twist").
Closing the long position on the opposite condition.
There are 2 different strength signals for this strategy: weak, and strong.
Weak : the signal is weak when the condition is true and the price is above the 'Kumo'
Strong : the signal is strong when the condition is true and the price is below the 'Kumo'
This script is compliant with algorithmic trading.
You can use this script with trading terminals such as 3Commas or CryptoHopper. Connecting this script is very easy.
1. Enter the user interface
2. Select and activate a strategy
3. Copy your bot's links into the dedicated fields
4. Create and activate alert
Disclaimer: algorithmic trading involves risk, the user should consider aspects such as slippage, liquidity and costs when evaluating an asset. The Quant Science is not responsible for any kind of damage resulting from use of this script. By using this script you take all the responsibilities and risks.
Protervus Trading ToolkitHi Traders! Welcome to Protervus Trading Toolkit (PTT) , a comprehensive set of tools to help you building, backtesting, and even automating your strategy.
Important : the data and screenshots I publish are solely for presentation and explanation purposes and must not be intended as recommendations or guarantees. Please consider eventual backtesting results seen here as almost-random. My goal is not to provide ready-made strategies, signals, or infallible methods, but rather indicators and tools to help you focus on your own research and build a reliable trading plan based on discipline.
BUILD, BACKTEST, AUTOMATE
The first step is to link a chained indicator which will send Entry signals and, optionally, Exit signals: to integrate your own triggers with this toolkit, check out my tutorial and use this code as a template.
Then, in the Trading Settings you can set the Trading Mode (Full - Long and Short, Long only, or Short only) as well as Starting Capital, Drawdown Limit, Risk per Trade, Fees, and the date range in which trading will be enabled and backtested.
Go further by tweaking your strategy with built-in Take Profit and Stop Loss conditions, and keep it under control thanks to the Statistics Panel.
Trades will be shown on the chart, including TP\SL levels (according to the ones you enable) and per-trade statistics:
Tip: point the cursor over TP or SL icon to open the tooltip, showing additional details about the trade.
BUILT-IN CONDITIONS
Note: all conditions already account for fees.
Take Profit \ Stop Loss percentage
Take Profit or Stop at Loss when a fixed percentage is reached.
Limit \ Hard Stop: the trade will be considered closed when that specific price is reached - otherwise, the candle closing price will be used.
Trailing Take Profit
Trail the price and close the trade in profit when it reverses for the chosen percentage.
Engage and Disengage: activate trailing when the price is above the entry price for the chosen percentage, and de-activate it if price goes past the disengage percentage.
Safety TP: close the trade at Break-Even if the price sharply reverses from engaged area to BE level. A specific Alert is available in order to create a separate trigger with immediate effect.
Note: using TP Safety with an Engage % of zero might result in many early exits, so it is recommended to add some margin to Engage % to avoid that.
Exit \ Stop on Opposite Signal
Close the trade when another, contrary signal is received (e.g. close a Long position when a signal to go Short is received).
Exit \ Stop after X candles
Close the trade after X candles, as soon as the condition is met (e.g. for Take Profit condition, it will close the trade after X candles as soon as the trade is in profit).
Bind to TP \ SL: only validate the condition if the current PnL is above (TakeProfit cond.) or below (Stop Loss cond.) the specified percentage.
ATR Stop
Classic ATR Stop Loss.
Trailing ATR
Chase the price by the defined ratio and close the position when the candle closes past the ATR line.
Bind to TP \ SL: only validate the condition if the current PnL is above (TakeProfit cond.) or below (Stop Loss cond.) the specified percentage.
External Signal (sent from your indicator)
Close the position basing on your own triggers, defined in the chained indicator.
- Bind to TP \ SL: only validate the condition if the current PnL is above (TakeProfit cond.) or below (Stop Loss cond.) the specified percentage.
PANEL CUSTOMIZATION AND ADDITIONAL OPTIONS
A strategy name can be assigned in the settings and will show it at the top of the Statistics Panel, so you can better identify and label your tests and live instances.
The panel can be customized in terms of colors, text size and height. It can be also "split" in modular panels that will appear at the bottom of the chart.
It is also possible to show \ hide prices and live data labels as well as position and Break-Even levels. In some cases you will need to limit the display of those plots in order to avoid PineScript calculation issues.
If you limited the plots but you are checking very old trades, you can enable the Legacy position tracker to see basic markers for positions (position is active, and profit \ loss marker).
In the case you will be sending webhook alerts to a trading bot , "Position Alert Failover" will come in aid to prevent situations where the initial trade closing alert is either not sent or missed: it will keep sending the position closing signal for X candles.
PLUGINS
Thanks to the modular nature of PTT, plugins will eventually be available to provide additional features and extend functionalities even further. Make sure to keep an eye on updates.
CREATING ALERTS
To create alerts you must first select the PTT indicator from the "Condition" drop-down menu, then the whole list of available alerts will appear. When creating alerts, please make sure to set "Once Per Bar Close" for the normal conditions, and "Once Per Bar" for safety conditions (Limit and Hard Stop simulation, Trailing TP Safety Trigger).
Besides positions opening and closing alerts, you also have the option to add extra alerts for when a position is open or not open (e.g. Active Long position, No Long Position) - that might come handy when dealing with trading bots and automation tools. Also, as mentioned earlier, you have the chance to create a special alert as failover in order to repeat the closing alert.
TIPS AND RECOMMENDATIONS
Set Visual Order > Bring to front for PTT to avoid other indicators or candles covering up labels.
If you receive errors like "Referencing too many candles" or "Too many drawings", use the " Limit to last candles " function in the Settings panel to lower the number of candles.
If the Statistics Panel or labels are not appearing, and no errors are shown (red circled exclamation mark next to indicator's name), try changing any value in the settings to trigger a new calculation.
The Lowest Point in Trades refers to the maximum movement against your position. However, if the price never goes negative against the Entry level, it will be calculated from the Break-Even level.
Differently from TradingView's Strategy Tester, PTT calculates DrawDown from the Equity line (the starting balance).
Remember that Backtests only show past results, and although very useful to understand if your strategy makes sense, the market can completely change at any moment and ruin your dreams: make sure to avoid over-fitting (using very specific values) in your settings and to prefer more generic values in order to factor broader market situations.
After many successful backtests of your newly created strategy, let it run live without actually trading it for some time (paper trading), and see if it remains valid.
You can use multiple Conditions as safeguard. For example, main Stop condition can be Trailing ATR and secondary Stop condition can be Stop Loss % with Hard Stop, so you will be protected in case of sudden big price moves.
Statistical Correlation Algorithm - The Quant ScienceStatistical Correlation Algorithm - The Quant Science™ is a quantitative trading algorithm.
ALGORITHM DESCRIPTION
This algorithm analyses the correlation ratios between two assets. The main asset (on the chart), and the secondary asset (set by the user). Then apply the long or short trading strategy.
The algorithm divides trading work into three parts:
1. Correlation analysis
2. Long or short entry
3. Closing trades
Inside the strategy: the algorithm analyses the percentage change yields from a previous session, of the secondary asset. If the variation meets the set condition then it will open a long or short position, on the primary asset. The open position is closed after 'x' number of sessions. Stop loss and take profit can be added to the trade exit parameters.
Logic: analyses the correlation between two assets and looks for a statistical advantage within the correlation.
INDICATOR DESCRIPTION
The algorithm includes a quantitative indicator. This indicator is used for correlation analysis and offers a quick reading of the quantitative data. The blue area shows the correlation ratio values. The yellow histograms show the percentage change in the yields of the main asset. Purple histograms show the percentage change in secondary asset yields.
GENERAL FEATURES
Multi time-frame: the user can set any time-frame for the secondary asset.
Multi asset: the user analyses the conditions on a second asset.
Multi-strategy: the algorithm can apply either the long strategy or the short strategy.
Built-in alerts: the algorithm contains alerts that can be customized from the user interface.
Integrated indicator: the quantity indicator is included.
Backtesting included: automatic backtesting of the strategy is generated based on the values set.
Auto-trading compliant: functions for auto trading are included.
USER INTERFACE SETTINGS
Through the intuitive user interface, you can manage all the parameters of this algorithm without any programming experience. The user interface is extremely descriptive and contains all the information needed to understand the logic of the algorithm and to configure it correctly.
1. Date range: through this function you can adjust the analysis and working period of the algorithm.
2. Asset: through this function you can adjust the secondary asset and its time-frame. You can enter any type of asset, even indices and economic indicators.
3. Asset details: this function is used to adjust the percentage change to be analyzed on the secondary asset. The analysis and input conditions are also chosen.
4. Active long or short strategy: this function is used to set the type of strategy to be used, long or short.
5. Setting algo trading alert: with this function, users can manage alerts for their web-hook.
6. Exit&Money management: with this function the user can adjust the exit periods of each trade and activate or deactivate any stop losses and take profits.
7. Data Value Analysis: this function is used to adjust the parameters for the quantity indicator.
MZ Momentum Non Repainting HTF HFT Scalper BotThis is an original script meant to be a high frequency trader that works on higher time frame calculations. I came up with the idea that using calculus I can figure out the actual rate of change and momentum with different calculations than the momentum indicator that is provided by trading view. Once momentum is shifted on a small time frame, it will provide an entry signal. The script is meant to be used on an algorithmic trading system for scalping purposes. It should be run on a one minute time frame.
Set it up on a one minute chart - setup your bot on a one minute interval.
Find the source of your data. You can use any time frame, open, close. high, low, olc4. Open is pretty much guaranteed to not have any repainting issues - although all the other calcs use a custom isbarconfirmed security repaint calculation.
Set your rate of change period - typically I use a one minute time frame for this as well - but set my length fairly long (30-40).
Then set your period for momentum calculation. This will sample the rate of change data to figure out your momentum. I typically try a setting of 6-8. If that doesn't work, try setting it about the same as the rate of change period and add or subtract a few from there.
Unfortunately due to various plotting constraints in Pinescript, you cannot plot the rate of change and momentum and price in the same.
Set your trigger point. I try values -30, -20, -10, 0, 1. Then finesse to get an earlier entry signal. You should account for a slight delay from the signal to the actual entry. Your backtest should test well, but please note that does not gaurantee results. In my findings, I have seen that there is a slight minimal delay between signal to entry and that can make the difference whether your trade is profitable or not.
Use the show data to show you additional data when you are backtesting. This can allow you to try to filter out results or market conditions that do not work. I typically work with the RSI and use the 30 minute and 15 minute RSIs. I make sure that it is trading within a certain band - about 40-75. You can try the inverse and only buy during really low RSI's as well.
Use the enter and close messages to setup your webhook messages. But I recommend to allow the algo trading platform to close the trade for you based on their calcs since that platform knows the actual price level and when it has become profitable.
Filters have been setup for
Moving Average Variants - any time frame, any length.
RSI - Any time frame, any length,
Future Plans: ATR Filter so you can filter out low volatility periods.
Send me a message with any suggestions.
Customizable Non-Repainting HTF MACD MFI Scalper Bot StrategyThis script was originally shared by Wunderbit as a free open source script for the community to work with.
WHAT THIS SCRIPT DOES:
It is intended for use on an algorithmic bot trading platform but can be used for scalping and manual trading.
This strategy is based on the trend-following momentum indicator . It includes the Money Flow index as an additional point for entry.
HOW IT DOES IT:
It uses a combination of MACD and MFI indicators to create entry signals. Parameters for each indicator have been surfaced for user configurability.
Take profits are fixed, but stop loss uses ATR configuration to minimize losses and close profitably.
HOW IS MY VERSION ORIGINAL:
I started trying to deploy this script myself in my algorithmic trading but ran into some issues which I have tried to address in this version.
Delayed Signals : The script has been refactored to use a time frame drop down. The higher time frame can be run on a faster chart (recommended on one minute chart for fastest signal confirmation and relay to algotrading platform.)
Repainting Issues : All indicators have been recoded to use the security function that checks to see if the current calculation is in realtime, if it is, then it uses the previous bar for calculation. If you are still experiencing repainting issues based on intended (or non intended use), please provide a report with screenshot and explanation so I can try to address.
Filtering : I have added to additional filters an ABOVE EMA Filter and a BELOW RSI Filter (both can be turned on and off)
Customizable Long and Close Messages : This allows someone to use the script for algorithmic trading without having to alter code. It also means you can use one indicator for all of your different alterts required for your bots.
HOW TO USE IT:
It is intended to be used in the 5-30 minute time frames, but you might be able to get a good configuration for higher time frames. I welcome feedback from other users on what they have found.
Find a pair with high volatility (example KUCOIN:ETH3LUSDT ) - I have found it works particularly well with 3L and 3S tokens for crypto. although it the limitation is that confrigurations I have found to work typically have low R/R ratio, but very high win rate and profit factor.
Ideally set one minute chart for bots, but you can use other charts for manual trading. The signal will be delayed by one bar but I have found configurations that still test well.
Select a time frame in configuration for your indicator calculations.
Select the strategy config for time frame. I like to use 5 and 15 minutes for scalping scenarios, but I am interested in hearing back from other community memebers.
Optimize your indicator without filters (trendFilter and RSI Filter)
Use the TrendFilter and RSI Filter to further refine your signals for entry. You will get less entries but you can increase your win ratio.
I will add screenshots and possibly a video provided that it passes community standards.
Limitations: this works rather well for short term, and does some good forward testing but back testing large data sets is a problem when switching from very small time frame to large time frame. For instance, finding a configuration that works on a one minute chart but then changing to a 1 hour chart means you lose some of your intra bar calclulations. There are some new features in pine script which might be able to address, this, but I have not had a chance to work on that issue.
SIMPLE CANDLESTICK PATTERN ALGO BACKTESTING - TESLA 4HMany traders spend a lot of time to create algorithms full of unrealistic and far from reality indicators and market conditions. With this script I want to help traders understand the advantage of the Pine language. Using indicators with no statistical foundation and creating algorithms with technical indicators and thousands of conditions is not always the right way to create an efficient tool.
With this script that we have called "SimpleBarPattern_LongOnly" we analyse the market through a simple condition, using bars or candles.
How it works
The condition is constructed as follows. You go long with 100% of the established capital and 0.03% commission. The first condition is that the minimum of the period under analysis falls below the opening level. The second condition is that the low of the period is below the low of the previous period. The third condition is that the close of the period is above the opening level. The final condition wants the current close to be higher than the previous open and higher than the previous close. We used a statistical approach in the creation of this script, some candlestick patterns that reflect these conditions are: Bullish Engulfing, Bullish Hammer and Morning Star .
This strategy aims to help traders make more accurate decisions while using candlesticks for their trading and scientifically demonstrates that candlesticks are valid statistical tools for financial analysis.
"SimpleBarPattern_LongOnly" is a very lightweight script created with Pine v5. We developed a user interface that can adjust the analysis period from a few days to several years.
The initial capital set is €1,000 (You can change this from the "Properties" section of the user interface).
Each individual trade uses 100% of the set capital, in this case €1,000.
The default commission per trade is 0.03% (You can change this in the "Properties" section of the user interface).
User Interface
1) General backtest time settings: Set the history period to be analysed
StartDate: backtest start date
StartMonth: backtest start month
StartYear: backtest start year
EndDate: backtest end day
EndMonth: backtest end month
EndYear: backtest end year
3) Stop Loss
4) Take Profit
Please do not hesitate to contact us for any questions or information.
Disclaimer
Be careful, the past is not a guarantee of future performance, so remember to use the script as a pure analysis tool. The developer takes no responsibility for any use other than research and analysis and can in no way be held liable for damages resulting from wrong use of this code.
Algorithmic Trading on ETH/USDT 1H Backtesting Strategy How it works
%VARonMeanLongOnly is a long-only strategy that uses the average and price movement to find buying opportunities. The script takes into account the simple average over a longer timeframe than the observed timeframe. It then calculates the distance between point "X" (average) and point "Y" (market price). The algorithm will buy every time the price is lower than the average and has a percentage variation greater than the set one. So every time the price moves away from the average by XY% a long position will be opened. The position is closed only when a specific percentage distance of the price above the average is reached, without the use of stop losses and take profits.
This strategy is inspired by the classic academic mean and standard deviation approach , according to which the market tends to move around average values, which may deviate from the average for short periods. In this strategy the trader tries to find a statistical advantage over the distances between average and price.
%VARonMeanLongOnly is a very lightweight script created with Pine v5. We developed a user interface that can adjust the analysis period from a few days to several years. We chose the Moving Average Multi Time Frame and a simple mathematical expression to calculate the percentage distance from price to average and vice versa.
What can you do with %VARonMeanLongOnly ?
With %VARonMeanLongOnly you can implement a statistical arbitrage strategy that allows you to understand if buying above the average and selling the asset above the average can be profitable for a given market. Using the interface you can adjust the periods and variations and analyse if there is a possibility to use this strategy on that market. Understand if this approach has produced positive results on the market under analysis in the past.
The initial capital set is €1,000 (You can change this from the "Properties" section of the user interface).
Each individual trade uses 100% of the set capital, in this case €1,000.
The default commission per trade is 0.03% (You can change this in the "Properties" section of the user interface).
User Interface
1) General backtest time settings: Set the history period to be analysed
StartDate: backtest start date
StartMonth: backtest start month
StartYear: backtest start year
EndDate: backtest end day
EndMonth: backtest end month
EndYear: backtest end year
2) Mean Setting
Length: Periods to be observed when calculating the average
Source: Open, Close, High, Low
TimeFrame: Time frame of the average (usually larger than the time frame under observation)
3) Entry Long Trades:
EntryOnPercentVar: % distance from average to current price
4) Exit Long Trades:
ExitOnPercentVar: % distance from the current price to the average
Please do not hesitate to contact us for any questions or information.
Disclaimer
Be careful, the past is not a guarantee of future performance, so remember to use the script as a pure analysis tool. The developer takes no responsibility for any use other than research and analysis and can in no way be held liable for damages resulting from wrong use of this code.
LTDP: Long Trade on Drop Price (ETH/USDT, Timeframe 4H)How it works
The script analyses drawdown periods and negative price variation in order to search for ideal entry points for long positions.
"Has 'buy the dip' really produced profitable results so far?" "How do you define a buy the dip entry?" "What are the best setups to take advantage of a strong market drop?"
Many investors ask themselves these questions when they are buying during a strong drop price. Having an analysis tool that allows you to analyse the profitability of buying during a market drop is indispensable for dealing with it like a pro. We have decided to develop a script that gives you the ability to analyse this market condition in depth.
LTDP is a very light script created with Pine V.5 that has about 50 strings of code. We have developed a user interface capable of adjusting the analysis period from a few days to several years. We have chosen the Rate Of Change indicator to implement the function to analyse the period and the price variation. Finally, we have set the condition with which the script simulates a long entry with the intention of exploiting the volatility and the bearish moment. The trade is closed by stop losses and take profits which can be adjusted by the user interface.
What can you do with LTDP ?
1) Understand if a Buy The Dip approach can be profitable .
Using the interface you can adjust the periods and variations and analyse whether there is a possibility to use this strategy on that market. Understand if in the past this approach has produced positive results on the market under analysis.
2) Understand the best setup to approach a "Buy The Dip" strategy.
Once you understand and set up the best period and variation you can research which take profit and stop loss has worked best so far.
In this test
We used LTDP to answer this question on the ETH/USDT pair with 4H timeframe.
Buying after a drop of -17.5% over 28 hours, is it possible to achieve profitable conditions by opening only long positions with a 3% take profit and a 4% stop loss?
In this study case the result was that offered by the backtest. In this market using this simple strategy, positive results have been produced over the last 4 years.
The initial capital set is €10,000 (You can change this from the "Properties" section of the user interface).
Each individual trade uses 100% of the set capital, in this case €10,000.
The default commission per trade is 0.03% (You can change this in the "Properties" section of the user interface).
User Interface
1) General backtest time settings: Set the history period to be analysed
StartDate: backtest start date
StartMonth: backtest start month
StartYear: backtest start year
EndDate: backtest end day
EndMonth: backtest end month
EndYear: backtest end year
2) Buy The Dip analysis settings: Set the drawdown period and the variation to be taken into account
Period_on_analysis: Drawdown bars analysis
Source: Open, Close, High, Low
PercentDrawDown: The percentage of decline to be observed in Period_on_analysis
3) Money Management Settings: Set Take Profit and Stop Loss
TakeProfit: % Profit
StopLoss: % Loss
Please do not hesitate to contact us for any questions or information.
Disclaimer
Be careful, the past is not a guarantee of future performance, so remember to use the script as a pure analysis tool that cannot be intended as the sole reference in making and implementing financial investment strategies. The developer takes no responsibility for any use other than research and analysis and can in no way be held liable for damages resulting from misuse of this code.
hamster-bot PDD Pump and Dump DetectorPump and Dump detector by hamster-bot
strategy author: foresterufa
Pump and Dump detector (PDD)
This is a trend strategy, with a unique mechanism of multi-stage re-entry into a position (Take Profit-Entry) when a significant trend develops, based on our HiDeep indicator.
Positions are opened by the HiDeep indicator signal with trend direction filtering and volatility filtering. Positions are closed by a HiDeep indicator signal or a change in the trend direction.
The position can be accompanied by a unique Stoploss trailing MA.
EngineeringRobo DeluxeToday we are releasing the EngineeringRobo Deluxe!
New advanced trading tools for traders and investors. The new Robo 4 is extremely powerful !
It works perfectly with other existing strategies as an add-on feature. EngineeringRobo Deluxe has seen major improvements in accuracy of levels, speed and intelligence to detect the best possible trade setups.
This script is equipped with
🔵 EngineeringRobo 4
It offers strategic trading entry and exit points, so you can preserve capital before markets tumble, and take full advantage as they start to rebound. At a glance, market timing indicators tell investors whether market conditions are right or whether it’s safer on the sideline.
Truly unique tool for technical analysis for the financial market as it includes calculation of specific metrics like SAR + MACD + Price Movement.
You no longer have to worry about spending hours in front of the computer looking for a trade.You can use the indicator on every assets available on your broker.
🔵 Change Candle Color
You can change the colors depending on buy 4 and sell 4 signals. It helps traders a lot to see the direction clearly.
🔵 BB Signals :
This strategy uses the MACD indicator together with the Bollinger Bands to sell when the price is above the upper Bollinger Band (and to buy when this value is below the lower band). This simple strategy only triggers when both the MACD and the Bollinger Band indicators are at the same time in a overbought or oversold condition.
Removed Upper & Lower bands & SMA20 from the charts.
To see bands, You can activate the Bollinger Bands on EngineeringRobo - not the Deluxe version.
If you are buying it with BB BUY, No need to wait for BB Sell to sell it. Vice versa.
They are not the opposite to each other. Get your profit at your target level and move on.
🔵 Ultimate MA crossover signals :
As a general guideline,the idea behind trading crossovers is that a short-term moving average above a long-term moving average is an indicator of upward momentum in a stock & crypto , and the opposite is true about a short-term average trading below a long-term average.
For this guideline to be of use, the moving average should have provided insights into trends and trend changes in the past.
Are the settings of SMA 50 & SMA 200 really the best for Golden Cross and Death Cross?
Have you ever tested ROI for MA cross strategies?
Do you think MA 20 and MA 50 are the best pair for traders?
Do you know that Exponential Moving Average ( EMA ) beats the Simple Moving Average ( SMA ) ?
In order to answer these questions we applied some brute mathematical force and tested 1830 different MA combination to find out the best pair through 50 years of data across stock / forex and 5 years of data across crypto markets . We have done the hard work and you get the benefits .
P.S. The oldest date is 1872 on SPCFD:SPX chart on tradingview . Almost 150 years of backtesting is possible from 1872 to 2020!
🔵 Cloud Signals :
This is a strategy made from ichimoku cloud , together with MACD . Changed Ichimoku cloud formula. Based on that we have a long or a short entry.
it is an effective strategy when paired with a trailing stop loss. Removed standard line ( Kijun Sen ), turning line ( Tenkan Sen ), lagging line ( Chikou Span ) and senkou lines, added buy & sell signals. Traders can use EngineeringRobo's cloud to see the clouds on the chart.
This method doesn't work in sideways markets, only in volatile trending markets.
🔵 EMA TrendLines & Custom Moving Average :
Moving averages help traders isolate the trend in a security or market, or the lack of one, and can also signal when a trend may be reversing. Two of the most common types are simple and exponential. We will look at the differences between these two moving averages, helping traders determine which one to use. Simple moving averages and the more complex exponential moving averages help visualize the trend by smoothing out price movements.
Each trader must decide which MA is better for his or her particular strategy. Many shorter-term traders use EMAs because they want to be alerted as soon as the price is moving the other way. Longer-term traders tend to rely on SMAs since these investors aren't rushing to act and prefer to be less actively engaged in their trades.
🟠50 And 200 Day Moving Average Rules
Trend reversal (downtrend to uptrend) - MA 50 crossover MA 200 from below.
Trend reversal (uptrend to downtrend) - MA 50 crossover MA 200 from above.
Weekly open –close above MA 20 ( bullish trend )
Weekly open –close below MA 50 ( Bearish trend )
Super Bullish : The candle is above MA 20 ( Daily )
Bullish : MA 50 Above MA 100 ( Daily )
Bearish : MA 50 below MA 100 ( Daily )
🔵 Fear & Greed Index
This strategy uses two unique EMA indicators in the formula.
1. Use the indicator to identify when investors are greedy.
2. Use the indicator to identify potential bottom levels
For best testing example:
Open BLX Chart, pick 1D time frame, open only FEAR & Greed Index
🟢Green Area : Ready to buy a lot of cryptocurrencies
🔴Red Area : Ready to sell a lot of cryptocurrencies
Price crosses above red line = Entering overbought zone
Price crosses below red line = Exiting overbought zone
Price crosses below green line = Entering oversold zone
Price crosses above green line = Exiting oversold zone
🔵 Automated Trend Channel Lines
It’s 2020 and you are still drawing lines?
The automated trend lines helps you find the best trend lines and you can stop re-drawing over and over. You don't need to flip back and forth between different timeframes. You can let your robo advisor do the work for you.
🔵 Dynamic Support and Resistance Levels
On the most fundamental level, support and resistance are simple concepts. The price finds a level that it’s unable to break through, with this level acting as a barrier of some sort. In the case of support, price finds a “floor,” while in the case of resistance, it finds a “ceiling.”
Basically, you could think of support as a zone of demand and resistance as a zone of supply.
While more traditionally, support and resistance are indicated as lines, the real-world cases are usually not as precise. Bear in mind; the markets aren’t driven by some physical law that prevents them from breaching a specific level. This is why it may be more beneficial to think of support and resistance as areas. You can think of these areas as ranges on a price chart that will likely drive increased activity from traders.
🔵 Automated Fibonacci Retracements
Automatic Fibonacci let you replace subjective manual analysis with objective automated analysis so you always get the best Fibonacci levels, this can really improve the quality of your trading decisions.
Fibonacci retracements are often used to identify the end of a correction or a counter-trend bounce. Corrections and counter-trend bounces often retrace a portion of the prior move. While short 23.6% retracements do occur, the 38.2-61.8% zone covers the most possibilities (with 50% in the middle). This zone may seem big, but it is just a reversal alert zone. One of the best ways to use the Fibonacci retracement tool is to spot potential support and resistance levels and see if they line up with Fibonacci retracement levels.
Even though Fibonacci levels are extremely popular among technical traders, one should not rely solely on Fibonacci retracement and extension levels in trading. Fibonacci tools return the best results when combined with other technical tools, such as trendlines , chart patterns, candlestick patterns, channels or technical indicators.
If you are following any EngineeringRobo Deluxe signals, you should always wait for the candle close before buying or selling.
The signal can come and go anytime during the live candle. ALL indicators do that, that is not considered repainting.
Repainting is when a signal appears, the candle is closed, and when you refresh the chart it disappeared. It is logical that until the candle is closed the signal is not decided yet, hence the alert setup as Once per bar Close.
Deluxe never repaints! Yes, you heard it right: you will never have to worry about signal changing after the candle is closed.
*** Added alarm system alerts for all signals.
________________________________________________________________________ Timeframes _____________________________________________________________________
Our recommendations to get the best results:
Swing Trading Crypto : Use 1D Time Frame Candles
Swing Trading Stocks : Use 1W Time Frame Candles
Swing Trading Commodities : Use 1W Time Frame Candles
Day Trading Crypto : Use 3H Time Frame Candles
Day Trading Stocks : Use 1D Time Frame Candles
Day Trading Commodities : Use 1D Time Frame Candles
Not recommended any other time frames.
What Is Risk-Reward Ratio RRR?
Your risk-reward ratio is how much you risk per trade, relative to how much you expect to make (reward).
When trading with Robo , you should always aim for a bigger reward compared to your risk per trade.
A good rule is only to risk 1% per trade for day traders and 5% per trade for swing trader . Robo follows strong risk management rules on the algorithm .
One of the biggest advantages of algo trading is removing human emotion from the financial markets,humans trading are susceptible to emotions that lead to irrational decisions. Robo doesn't have to think or feel good to make a trade. If conditions are met, it enters.When the trade goes the wrong way or hits a profit target, It exits. It doesn't get angry at the market or feel invincible after making a few good trades.
EngineeringRobo gives you all the tools and information you need for day-to-day trading and investing, while also keeping a great buy and sell signals! No excuse to lose in any financial market anymore! Try now!
How can you add the algorithm into your chart?
1. Login to TradingView.com
2. From the homepage, click on ‘Chart’ in the top navigation bar
3. Select “Indicators” on the top-center-middle panel
4. In the indicator library, type "EngineeringRobo Deluxe "
5. Use the website link below to obtain access to this indicator
The indicator will be added to your chart after It is approved.
Relativity BEARS FOREX 50X 4H AlgorithmHello, this script is the correction of my old script related to Forex. (Bear market)
Old script :
4H was chosen as the time frame.
Thus, larger pips are at our disposal and we benefit more from the hedge effect of the leverage.
Commissions per trade have been removed to get more realistic commissions.
Because every wrong trade deletes all the 1% position size.
(with leverage effect)
Use the links below to obtain access to this indicator :