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.
Profitabletrading
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.
Candle StrategyThis strategy is based candle count number also strategy analysis -
Rules for buy-
1) choose Candle Number(Ex.-47) For Trade
2) Trade Sell if price is above high of day 1st candle that mean direction is upside
3) We are taking stop loss on lowest low of candle since day first candle to trade no.
4) close Trade at last bar of the day
5) Trader Can Choose Trade Direction From input
Rules for Sell-
1) Choose Candle Number(Ex.-47) For Trade
2) Trade Sell if price is below low of day 1st candle that mean direction is downside
3) We are taking stop loss on highest of candle since day first candle to trade no.
4) close Trade at last bar of the day
5) Trader Can Choose Trade Direction From input
Note - this strategy can be also use for static to understand which candle will make low/high of the day high chance Example in bank nifty 5 minutes chart candle no 47 have highest trade
opportunity appear on long side ...this data is small based on 5000 previous bar ...
Disclaimer: market involves significant risks, including complete possible loss of funds. Consequently trading is not suitable for all investors and traders. By increasing leverage risk increases as well.With the demo account you can test any trading strategies you wish in a risk-free environment. Please bear in mind that the results of the transactions of the practice account are virtual, and do not reflect any real profit or loss or a real trading environment, whereas market conditions may affect both the quotation and execution
Simple SuperTrend Strategy for BTCUSD 4HHello guys!, If you are a swing trader and you are looking for a simple trend strategy, you should check this one. Based in the supertrend indicator, this strategy will help you to catch big movements in BTCUSD 4H and avoid losses as much as possible in consolidated situations of the market
This strategy was designed for BTCUSD in 4H timeframe
Backtesting context: 2020-01-02 to 2023-01-05 (The strategy has also worked in previous years)
Trade conditions:
Rules are actually simple, the most important thing is the risk and position management of this strategy
For long:
Once Supertrend changes from a downtrend to a uptrend, you enter into a long position. The stop loss will be defined by the atr stop loss
The first profit will be of 0.75 risk/reward ratio where half position will be closed. When this happens, you move the stop loss to break even.
Now, just will be there two situations:
Once Supertrend changes from a uptrend to a downtrend, you close the other half of the initial long position.
If price goes againts the position, the position will be closed due to breakeven.
For short:
Once Supertrend changes from a uptrend to a downtrend, you enter into a short position. The stop loss will be defined by the atr stop loss
The first profit will be of 0.75 risk/reward ratio where half position will be closed. When this happens, you move the stop loss to break even.
Like in the long position, just will be there two situations:
Once Supertrend changes from a downtrend to a uptrend, you close the other half of the initial short position.
If price goes againts the position, the position will be closed due to breakeven.
Risk management
For calculate the amount of the position you will use just a small percent of your initial capital for the strategy and you will use the atr stop loss for this.
Example: You have 1000 usd and you just want to risk 2,5% of your account, there is a long signal at price of 20,000 usd. The stop loss price from atr stop loss is 19,000. You calculate the distance in percent between 20,000 and 19,000. In this case, that distance would be of 5,0%. Then, you calculate your position by this way: (initial or current capital * risk per trade of your account) / (stop loss distance).
Using these values on the formula: (1000*2,5%)/(5,0%) = 500usd. It means, you have to use 500 usd for risking 2.5% of your account.
We will use this risk management for apply compound interest.
Script functions
Inside of settings, you will find some utilities for display atr stop loss, supertrend or positions.
You will find the settings for risk management at the end of the script if you want to change something. But rebember, do not change values from indicators, the idea is to not over optimize the strategy.
If you want to change the initial capital for backtest the strategy, go to properties, and also enter the commisions of your exchange and slippage for more realistic results.
Signals meanings:
L for long position. CL for close long position.
S for short position. CS for close short position.
Tp for take profit (it also appears when the position is closed due to stop loss, this due to the script uses two kind of positions)
Exit due to break even or due to stop loss
Some things to consider
USE UNDER YOUR OWN RISK. PAST RESULTS DO NOT REPRESENT THE FUTURE.
DEPENDING OF % ACCOUNT RISK PER TRADE, YOU COULD REQUIRE LEVERAGE FOR OPEN SOME POSITIONS, SO PLEASE, BE CAREFULL AND USE CORRECTLY THE RISK MANAGEMENT
The amount of trades closed in the backtest are not exactly the real ones. If you want to know the real ones, go to settings and change % of trade for first take profit to 100 for getting the real ones. In the backtest, the real amount of opened trades was of 194.
Indicators used:
Supertrend
Atr stop loss by garethyeo
This is the fist strategy that I publish in tradingview, I will be glad with you for any suggestion, support or advice for future scripts. Do not doubt in make any question you have and if you liked this content, leave a boost. I plan to bring more strategies and useful content for you!
CONSOLIDATION BAND BREAKOUT [5MIN TF]CONSOLIDTION BREAKOUT STRATEGY for 5 minute Time-Frame , that has the time condition adjustable for Indian Markets.
// ══════════════════════════════════════════════════════════════════════════ //
Unlike the Free Scripts - Risk Management , Position Sizing , Partial Exit etc. are also included .
Message to know more about the strategy.
// ══════════════════════════════════════════════════════════════════════════ //
The Timing can be changed to fit other markets, scroll down to "TIME CONDITION" to know more.
The commission is also included in the strategy .
The basic idea is when ,
1) Price crosses above upper Level ,indicated by Red Line, is a Long condition .
2) Price crosses below lower Level ,indicated by Green Line , is a Short condition .
3) Candle close crosses above ema1 , is a part of the Long condition .
4) Candle close crosses below ema1 , is a part of the Short condition .
5) Allowed hours specifies the trade entry timing.
6) ATR STOP is the stop-loss value on chart , can be adjusted in INPUTS.
7) Target 1 is the 1st target value on chart , can be adjusted in INPUTS.
8) RISK is Maximum Risk per trade for the intraday trade can be changed .
9) Total Capital used can be adjusted under INPUTS.
10) ATR TRAIL is used for trailing after entry, as mentioned in the inputs below.
11) Check trades under the list of trades .
12) Trade only in liquid stocks .
13) Risk only 1-5% of total capital.
14) Inputs can be changed for better back-test results, but also manually check the trades before setting alerts
15) SQUARE OFF TIME - As you change the time frame , also change the square-off time to that candle's closing time.
Eg: For 3min Time-frame , Hour = 2Hrs | Minute = 57min
16) Strategy stops for the day if you have a loss .
*The input values and the results are mentioned under "BACKTEST RESULTS" below*
// ══════════════════════════════ //
// ————————> RISK MANAGEMENT <——————— //
// ══════════════════════════════ //
Risk management is done based on max loss per trade and can be adjusted in the INPUTS.
// ═══════════════════════════ //
// ————————> POSITION SIZE <——————— //
// ═══════════════════════════ //
Quantity of each trade is different based on the loss
// ═════════════════════════ //
// ————————> PROPERTIES <——————— //
// ═════════════════════════ //
COMMISSION , SLIPPAGE ,RECALCULATE is already mentioned .
COMMISSION can be charges , based on the broker charges.
// ═══════════════════════════════//
// ————————> TIME CONDITION <————————— //
// ═══════════════════════════════//
The time can be changed in the INPUT.
The Indian Markets open at 9:15am and closes at 3:30pm.
The 'Allowed hours' under Inputs specifies the time at which Entries should happen .
"Close All" function closes all the trades before 3pm , at the open of the next candle.
To change the time to close all trades , check INPUT.
All open trades get closed at 3pm , because some brokers don't allow you to place fresh intraday orders after 3pm .
// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 123 CLOSED TRADES )<————————— //
// ═══════════════════════════════════════════════ //
INPUTS can be changed for better Back-Test results.
The strategy applied to NSE:TCS (5 min Time-Frame and with a capital of 1,00,000 ) gives us 77% profitability , as shown below
It was tested for a period a 1 year with a Profit Factor of 2.143 ,net Profit of 10,886 Rs .
The Initial Capital and Risk can be increased for better results.
The graph has a Linear Curve with Consistent Profits.
The INPUTS are as follows,
1) LENGTH ——————————————> 79
2) MUT_STDEV ————————————> 2.3
3) ALLOWED HRS ———————————> 9:25 TO 14:30
4) ATR STOP ——————————————> 2.2
5) RISK ——————————————————> 400
6) ATR TRAIL ———————————————> 2.6
7) TARGET 1 ————————————————> 2.1
8) MAX POSITION VALUE ——————————> 1,00,000
8) MAX DRAWDOWN —————————————> 2,000
8) SQUARE-OFF ————————————————> 14:55
NSE:TCS
Apply it to your charts Now !!
Send us a message to know more about this strategy
Thank You ☺ NSE:TCS
Cheat Code- Example 1; Short-Term; Follow the Trend BINANCE:BTCUSDT ; BINANCE:ETHUSDT ; BINANCE:FILUSDT ;
This strategy is simple and easy to read and takes advantage of conditional signs of trend reversals. It works best in 10-minute time frames for most large and mid-cap crypto. This code is a tutorial for creating a profitable yet easy strategy, and hopefully, it can be put to good use :)
Strategy - Cryptosystem NNFX wayFirst script done!
This is my version of the No-Nonsense Forex (NNFX) Strategy
This strategy shows you the entry and exit signal with a standard 1.5 x ATR for Stop Loss and 1 x ATR for Taking Profit. You can adjust the settings to your needs.
This strategy uses 5 indicators:
1. Average True Range for SL and TP placement, there is a nuance where you can add the 1XATR Rule;
2. SMA used to filter longs and shorts;
3. SSL Channel for 1st Confirmation;
4. DPO for 2nd Confirmation;
5. Waddah Attar Explosion as a volume indicator.
There is no exit indicator because I coded 2 trades (2x0.5). TP1 will be at 1xATR and TP2 will automatically trail behind with 1.5XATR. You can see the red trailing line on the charts.
Other exits can be: When SSL gives opposite signal or when price crosses and closes your baseline.
I used this system for 1D timeframe.
Hopefully this can be usefull for your tradingstyle.
Would be great if you guys leave a like.
Thanks!
when bull D timeframeEcco a voi la mia strategia basata su atr con implementazioni personali per definire facilmente la condizione di mercato su btc e eth, come potete vedere punta ad identificare solo le salite più importati ignorando i falsi segnali che avvengono nelle fasi di bear market (o di incertezza). Da utilizzare con timeframe D.
Condivido una versione disponibile e funzionante gratuitamente fino al 31/12/2022 dopo tale data lo script tornerà a pagamento.
Here is my strategy based on atr with personal implementations to easily define the market condition on btc and eth, as you can see it aims to identify only the most important climbs ignoring the false signals that occur in the bear market (or uncertainty) phases. For use with timeframe D. I share a version available and working for free until 31/12/2022 after that date the script will return not for free.
Stay Tuned
Algo Trading Strategy (Nifty & BankNifty)What is Algo Trading Strategy ( Nifty & Bank Nifty )?
There are many 9 to 5 working professionals who have some spare money to invest each month but they can not do active trading because they are busy with their full time job.
So they wish to have an automated system which could take and close trades for them with a proven back-tested strategy, proper money management, ability to trade within particular timings, pre-defined maximum loss they can bear and so on.
To cater needs of such type of traders, we created from scratch; and published an 'AutoTrading Algo (Nifty & Bank Nifty) in Sep 2021. (The link is given below, please read on).
Many people who want to try this AutoTrading Algo want us to share stats of this algo with them.
In order to fulfil this demand, we have converted that "Algo Trading" Study into a Strategy whose description you are reading right now.
For all other queries related to how our "Algo Trading (Nifty & Bank Nifty)" works, what are its limitations, benefits and other features, please read the description of our main 'Algo Trading (Bank Nifty & Nifty )' study which is available at following link:
Note:
1. in order to test this strategy on longer time period, you must have a Premium TradingView account.
2. If you have premium TradingView account, the stats you generate will exactly match with our stats which we keep sharing in our channel.
3. To Enable Auto-Trading, You will need to connect this Algo with your broker's trading platform through 3rd party platforms. We will guide you on how to do this, when you contact us.
StocasticRSI EMAs ATR StrategyA scalping based strategy thats works well with EUR/USD 30 minute time frame.
This strategy uses stochasticRSI for trade entry. Uses two exponential moving averages for trend detection. The strategy uses Average True Range for stop loss and for two profit targets.
We only trade with the trend if the 50 period exponential moving averages is above the 200 period exponential moving averages. StocasticRSI must cross below 30 level by default for a long entry if the rend is up. Likewise with a short entry the stochasticRSI must crossover above 70 level and if the trend is down.
This script does not trail your stop loss as I have noticed it does not give me good results. Stop loss is a fix stoploss based on Average True Range and so are the profit targets.
This script has risk management, it risk a certain percent of the inputed capital amount in the setting. See settings for more details.
Green line is 50 period exponential moving averages and red line is the the 200 period exponential moving average. Blue line is stoploss for short trade and black line stop loss for buy trade.
Since this is a scalping strategy be caution with the commission and slippage. I have inputed 1 for commission and 1 for sllipage.
Many Thanks,
Honest Trader
Buy and Sell Signals (With Stops and TP) - No Repaint
This strategy is primarily based on the MACD-indicator, but signals are filtered with the 200 ema.
This indicator gives you for every trade a stopp loss and take profit line.
As with every other strategy risk management is key. The trades taken have all 1.5:1 risk ratios, so when you lose one trade and win one you are still in profit.
This will only work if you calculate your position size accordingly when actually trading!
Without leverage:
position_size = (portfolio * loss_per_trade) / (stop_loss_in_percent )
Leverage:
position_size = (portfolio * loss_per_trade) / (stop_loss_in_percent * leverage)
For example:
portfolio = 100000
loss_per_trade = 0.01 | I only want to lose 1% per trade
stop_loss_in_percent = 0.04 | The stoploss is 4% away from our entry
(100000 * 0.01) / 0.04 = 2500 => if this trade hits my stop, I will only lose 1 % of my portfolio.
This strategy works well with:
BTCUSD 30m
BANDUSDTPERP 5m
EUR DOLLAR 15m
Of course it can be applied to anything, but you should firstly validate the strategy via backtest for the according trading pair and timeframe as it can perform differenlty in various timeframes.
This script does not repaint.
If you are interested in this strategy dm me.
Good luck on your trades!
Y-Profit Maximizer Strategy with Exit PointsThis script based on KivancOzbilgic 's PMax indicator. I modified a bit. Added Filters, Exit (TP) Levels and few indicator in it. This script opening only Long Positions.
I have used this indicators in this strategy:
-Moving Stop Loss (Most) by ceyhun
-PMax Explorer STRATEGY & SCREENER
-Bollinger Bands on Macd
-Tillson T3 Moving Average by KIVANÇ fr3762
I am open to suggestions for improve this script.
PS: Script is in Turkish Language.
VWAP + Fibo Dev Extensions StrategyBased on my VWAP + Fibo deviations indicator, I tested some strategies to see if the indicator can be profitable; and I got it !
This strategy uses:
H1 timeframe
Weekly VWAP
+1.618 / +2.618 / -1.618 / -2.618 Deviations Extensions to create 2 bands
The value of the deviation
First, the 2 bands are plotted : +1.618/+2.618 painted in red and -1.618/-2.618 painted in lime.
Then, we wait for the deviation value to reach at least 150 (see thumbnail) to avoid littles moves when the gaps between bands are too short.
Entry long position :
first candle must crossunder the -1.618 level and low have to stay over the -2.618
low of the second one must stay in the lime band
enter the third one if the deviation value is over limit (150)
Exit long position :
TP : when a high crossover VWAP
SL : when a low crossunder -2.618
Entry short position :
first candle must crossover the +1.618 level and high have to stay under the +2.618
high of the second one must stay in the red band
enter the third one if the deviation value is over limit (150)
Exit short position :
TP : when a low crossunder VWAP
SL : when a high crossover +2.618
Notes :
this strategy uses pyramiding (5), be careful and calculate your risk management
the comission value is set to 0.08% to include slippages when entering a trade because of market orders
This strategy is not an advice to invest, make your own decisions.
RSI on VWAP Upgraded strategyFirst of all, the idea of apply RSI to VWAP was inspired by XaviZ; at least, that where I first saw that.
I simply applied the idea and searched for apply this on lower timeframe (M15) to increase the number of positions and improve the profit factor.
The conditions to enter are the same :
long : enter on RSI crossover oversold level
short : enter on RSI crossunder oversell level
To close position, I found a little change to apply :
long : close position when RSI(VWAP) went in overbought zone and crossunder the overbought level OR after being at least x bars in the overbought zone (parameter is 28 by default) => when the first condition happens
short : close position when RSI(VWAP) went in oversold zone and crossover the oversold level OR after being at least x bars in the oversell zone (parameter is 28 by default) => when the first condition happens
With this change, I got better results specially on BTCUSDTPERP (M15) where I reach a 6.8 profit factor with 119 trades closed. Not BAD !
The defaults parameters are the best found for BTCUSDTPERP (M15), but the strategy works fine for other pairs if you take time to find the rights combinations.
In this strategy you can change (with defaults in () ):
RSI length (28)
RSI overbought level (85)
RSI oversell level (30)
Number of bars before leaving as explain above (28)
The choice to take longs only, shorts only or both
The number of coin/token by position
The start date for backtesting
Please note that the script use a pyramiding parameter of 3 (can be changed in the first line of the script); that means that you can take up to 3 positions before closing. It lets you improve average enter price but increase the risk. 3 is the best I found to improve profit factor without expose myself too much.
This script would be better if automated because of the conditions of buy and sell.
It's only for educative purpose, not an advice to invest.
All my free scripts here : fr.tradingview.com
Leave a message and don't forget to follow me ;) !
Trend TradingThe strategy has two scripts coded in it. It uses $10,000 capital, 1 Share is the default quantity, commission of 0.0018.
As you can notice in the AMD chart,
The coded script can do four actions because there are two scripts together.
First script:
A-Buy on red bars
B-sell on green candles.
Second script:
A-buy on red background
B-sell on green background
(This is just to show you the statistics of both scripts).
The way my strategy works is there are multiple weights to gains from certain highs and lows using Fibonacci ratios.
The reason I combined both is I need to know what the trend is to avoid trading against it.
The background color tells me what the trend it.
The bar colors are for entries.
How I filter the signals:
When the background is red, then a down trend. However, my entry would be on green bars.
When the background is green, an uptrend, However, my entry would be on red bars.
The strategy can be used for multiple time frames, please test profitability rate and trade based on your judgment. The indicator is not perfect, and Your skills are important in the decision making. Do not depend solely on the indicator.
Other signals,
1-After a wide green background(uptrend). You could see one a red that could be an entry instead of a downtrend and vice versa.
2-In a wide red background, you could see green bars eventually that could be an overbought condition for a rally and vice versa.
The indicator can help you but will not trade for you. I suggest that you follow the certain conditions I have mentioned (How filter the signals).
If you are interested, please send me private message.
Constantius - Profitable trend analysis - Margin tradingConstantius is our new trend-following strategy based on trend and momentum detection. Best working on liquid cryptos, here is the ETH-based example.
Strategy has lot of parameters hard-coded, this makes strategy tuning simple with only two parameters remaining.
About strategy:
— No repainting
— No “security” function, so this strategy fully works on given timeframe
— No waiting for bigger candle close
Fun fact: Constantius is steadly profitable since 8 USD per ETH, check by yourself!
About high-leverage trading and reality check of backtest results:
High leverage was in mind when we were designing this strategy. In short, if we use real margin of 1.5% on Bitmex that equals real leverage of 67. Real leverage means that is no subsidy payment for the Bitmex insurance fund of exchange. Putting it simple, our stop loss is 1.5% below entry price for longs. That gives us an opportunity to trade position size that is about x3 of our initial capital when actually risking 5% percent of equity. We can also fine-tune our risk appetite, so risking 2% of equity with 1.5% stop loss gives us about x1.2 on our initial capital, and risking 2% of equity with 3% stop loss gives us tradable position of 60% of our capital. Credits for this system going to Antiliqudation tool.
We're trying to make backtest modes as realistic as we can, so there is leverage modelling:
— Initial capital: 130 USD. That means we put the price of 1 ETH in the beginning of testing.
— Fixed order size of 2.6 ETH per position. That means we're using 4% of equity per trade.
— We have more than 1000 orders. It is hard to monitor them 24/7 so automation is good thing to use.
— Commission of 0 is real in implementation, as some exchanges pays you -0.025% (negative) market maker commission. Automated order execution is necessary for zero commission, and a special type of order that tries to enter a position with a limit order that is constantly adjusted to be at the front of the order book is needed. So automation tools calls it “aggressive” order. Please look for ways of automation listed on Pine Coders site.
— Slippage can be set in “aggressive” orders, here in backtests default is zero.
There are lot more details about algotrading and leverage nuances, feel free to contact and ask for anything.
Use the link under backtesting results block to obtain access to this strategy!
Mark v2 — Modelling profitable high-leverage crypto tradingHello guys!
Here we'll post only our best of profitable code, so you can also level up your experience and profitability. This strategy uses the latest research in trend spotting and cycles detecting. Script is based on Ehlers brand-new research on market cycles, improved with trend detecting instruments, and other features to become a tradable strategy.
About this strategy
— No repainting
— No “security” function, so this strategy fully works on given timeframe
— No waiting for bigger candle close
High-leverage trading
High leverage was in mind when we were designing this strategy. In short, if we use real margin of 1.5% on Bitmex that equals real leverage of 67. Real leverage means that is no subsidy payment for the Bitmex insurance fund of exchange. Putting it simple, our stop loss is 1.5% below entry price for longs. That gives us an opportunity to trade position size that is about x3 of our initial capital when actually risking 5% percent of equity. We can also fine-tune our risk appetite, so risking 2% of equity with 1.5% stop loss gives us about x1.2 on our initial capital, and risking 2% of equity with 3% stop loss gives us tradable position of 60% of our capital. Credits for this system going to Antiliqudation tool.
Backtest
We're trying to make backtest modes as realistic as we can, so there is leverage modelling:
— Initial capital: 160 USD. That means we put the price of 1 ETH in the beginning of testing.
— Fixed order size of 2.6 ETH per position. That means we're using 4% of equity per trade.
— We have more than 1000 orders. It is hard to monitor them 24/7 so automation is good thing to use.
Automation
— Commission of 0 is real in implementation, as some exchanges pays you -0.025% (negative) market maker commission. Automated order execution is necessary for zero commission, and a special type of order that tries to enter a position with a limit order that is constantly adjusted to be at the front of the order book is needed. So automation tools calls it “aggressive” order. Please look for ways of automation listed on Pine Coders site.
— Slippage can be set in “aggressive” orders, here in backtests default is zero.
There are lot more details about algotrading and leverage nuances, feel free to contact and ask for anything.
Use the link under backtesting results block to obtain access to this strategy!
TTS Triple Threat SMA10-30-200 TLTTS Triple Threat SMA10-30-200 TL is a crossover and crossunder trading system that is based on three simple moving averages (SMA).
The default settings are optimized for 4-hour charts.
The TTS Triple Threat trading system works as follows:
1. Enters BULLISH trade when LE Trade & LONG signals are shown on the chart.
2. Enters BEARISH trade when SE Trade & SHORT signals are shown on the chart.
3. LONG and SHORT signals are shown based on SMA crosses for visual inspection but doesn't mean they are trades. Either LE Trade or SE Trade signals need to be present for a trade to take place.
4. TTS Triple Threat SMA10-30-200 TL uses trailing stop loss settings. The ratios between the profit taking settings and trailing loss stops are important to the strategy. Trailing stop loss exits are shown on the chart as XL STOP LOSS or XS STOP LOSS. Profit exits are shown as XL PROFIT EXIT and XS PROFIT EXIT.
Dominator Ladder StrategyThe Dominator is a technical indicator. Based on algorithm calculations, this indicator extrapolates the previous price for the next bar.
Here is how Dominator is calculated:
1. The study estimates the price projected for the next bar. The estimated price is based on the algorithm method.
2. The study extrapolates this value to find a projected price change for the next bar.
The resulting extrapolated value is shown as a histogram on a lower subgraph. By default, sections of the histogram where the extrapolated value is increasing are shown in green; sections corresponding to the decreasing value are shown in red.
Note: Value projection is purely mathematical as all calculations are based on algorithm averaging of previous values.
Note: lower subgraph it's just for you to understand and view the waves during the Strategy process Study it's not included in this strategy.
Overlay True
The strategy includes 3 different adjustable levels for the ladder , plus automatic adjustable stop loss and takes profit calculated from your average entry price after each ladder adds.
Adjustable BAcktest Window.
1 long signals
3 ladder long add signals
1 short signals
3 ladder short add signals
1 dynamic stop calculated from your average entry price
1 dynamic take profit calculated from your average entry price
BEST Trailing Stop StrategyHello traders
Here we go again.... with the second strategy snippet.
Reminder: the first snipper was a Trailing Profit strategy script
What's on the menu?
A trailing stop is designed to protect gains by enabling a trade to remain open and continue to profit as long as the price is moving in the investor's favor.
The order closes the trade if the price changes direction by a specified percentage or dollar amount.
Trigger me I'm famous
I developed many trading strategies in my career and often I've been asked to trigger a trailing-stop once a certain % move has been made.
On the screenshot below, the SL trigger is plotted in maroon.
Once the price goes past that level for the first time, I'll start trailing the trailing stop level.
In other words, when we see a price makes an interesting move in percentage value - we decide to trail the stop for at least not losing any more
All the BEST
Dave
Volty Expan Close Strategy with Backtest Date RangeInput Information
Length Numeric 5 Number of bars used to determine the average true range.
NumATRs Numeric .75 Factor used to calculate a percentage of the average true range, used to
Long and short entry based on a percentage of price movement beyond the average range.
Profitable and simple strategy..
TradersAI_UTBotCREDITS to @HPotter for the orginal code.
CREDITS to @Yo_adriiiiaan for recently publishing the UT Bot study based on the original code -
I just added some simple code to turn it into a strategy. Now, anyone can simply add the strategy to their chart to see the backtesting results!
While @Yo_adriiiiaan mentions it works best on a 4-hour timeframe or above, I am happy to share that this seems to be working on a 15-minute chart on e-mini S&P 500 Index (using the KeyValue setting at 10)! You can play around with the different settings, and may be you might discover even better settings.
Hope this helps. Btw, if any of you play with different settings and discover great settings for a specific instrument, please share them with the community here - it will be rewarded back multiple times!