Power Hour Money StrategyDescription of the Pine Script Code: "Power Hour Money Strategy"
This Pine Script strategy, "Power Hour Money Strategy," is designed to trade based on the alignment of multiple time frames (month, week, day, and hour). The strategy aims to enter long or short positions depending on whether all selected time frames are in sync (all green for long positions, all red for short positions). Additionally, the script includes configurations for trading during specific sessions and automatically closing positions at the end of the trading day.
Core Features:
1. Time Frame Sync Check:
- The strategy evaluates whether the current price is higher than the opening price for the month, week, day, and hour to determine if each time frame is "green" (bullish) or "red" (bearish).
2. Session Control:
- The user can select between different trading sessions:
- "NY Session 9:30-11:30"
- "Extended NY Session 8-4"
- "All Sessions"
- Trades are only executed if the current time falls within the selected session.
3. Trailing Stop Mechanism:
- The strategy includes an optional trailing stop mechanism for both long and short positions.
- The trailing stop is configured with a percentage loss from the current price to protect gains.
4. End-of-Day Position Management:
- An option is provided to automatically close all positions at the end of the trading day (5:45 PM Eastern Time).
Detailed Code Breakdown:
1. Input Settings:
- **Session Selection**: Allows the user to choose the trading session.
- **End-of-Day Close**: Option to automatically close positions at the end of the day.
- **Trailing Stop Loss**: Enables or disables the trailing stop loss feature and sets the percentage for long and short positions.
2. Time Frame Calculations:
- The script uses `request.security` to get the opening prices for higher time frames (monthly, weekly, daily, and hourly).
- It compares the current close price to these opening prices to determine if each time frame is green or red.
3. Session Time Definitions:
- Defines the start and end times for the NY session (9:30-11:30 AM) and the extended session (8:00 AM - 4:00 PM).
4. Trade Execution:
- The strategy checks if all selected time frames are in sync and if the current time falls within the trading session.
- If all conditions are met, it enters a long or short position.
5. Trailing Stop Loss Implementation:
- Adjusts the stop price based on the trailing percentage and the current position's size.
- Automatically exits positions if the trailing stop condition is met.
6. End-of-Day Close Implementation:
- Uses a timestamp to check if the current time is 5:45 PM Eastern Time.
- Closes all positions if the end-of-day condition is met.
7. Plotting and Logging:
- Plots indicators to visualize the green/red status of each time frame.
- Logs information about the status of each time frame for debugging and analysis.
Example Usage:
Entering a Long Position: If the month, week, day, and hour are all green and the current time is within the selected session, a long position is entered.
Entering a Short Position: If the month, week, day, and hour are all red and the current time is within the selected session, a short position is entered.
Trailing Stop: Protects gains by exiting the position if the price moves against the set trailing stop percentage.
End-of-Day Close: Automatically closes all open positions at 5:45 PM Eastern Time if enabled.
This strategy is particularly useful for traders who want to ensure that multiple time frames are in alignment before entering a trade and who wish to manage positions effectively throughout the trading day with specific session controls and trailing stops.
Chỉ báo và chiến lược
Gold & EUR/USD LTF liquidity Sweep + Market structure shift on a lower time frame for sniper entries
Fractal Breakout Trend Following StrategyOverview
The Fractal Breakout Trend Following Strategy is a trend-following system which utilizes the Willams Fractals and Alligator to execute the long trades on the fractal's breakouts which have a high probability to be the new uptrend phase beginning. This system also uses the normalized Average True Range indicator to filter trades after a large moves, because it's more likely to see the trend continuation after a consolidation period. Strategy can execute only long trades.
Unique Features
Trend and volatility filtering system: Strategy uses Williams Alligator to filter the counter-trend fractals breakouts and normalized Average True Range to avoid the trades after large moves, when volatility is high
Configurable Trading Periods: Users can tailor the strategy to specific market windows, adapting to different market conditions.
Flexible Risk Management: Users can choose the stop-loss percent (by default = 3%) for trades, but strategy also has the dynamic stop-loss level using down fractals.
Methodology
The strategy places stop order at the last valid fractal breakout level. Validity of this fractal is defined by the Williams Alligator indicator. If at the moment of time when price breaking the last fractal price is higher than Alligator's teeth line (8 period SMA shifted 5 bars in the future) this is a valid breakout. Moreover strategy has the additional volatility filtering system using normalized ATR. It calculates the average normalized ATR for last user-defined number of bars and if this value lower than the user-defined threshold value the long trade is executed.
When trade is opened, script places the stop loss at the price higher of two levels: user defined stop-loss from the position entry price or down fractal validation level. The down fractal is valid with the rule, opposite as the up fractal validation. Price shall break to the downside the last down fractal below the Willians Alligator's teeth line.
Strategy has no fixed take profit. Exit level changes with the down fractal validation level. If price is in strong uptrend trade is going to be active until last down fractal is not valid. Strategy closes trade when price hits the down fractal validation level.
Risk Management
The strategy employs a combined approach to risk management:
It allows positions to ride the trend as long as the price continues to move favorably, aiming to capture significant price movements. It features a user-defined stop-loss parameter to mitigate risks based on individual risk tolerance. By default, this stop-loss is set to a 3% drop from the entry point, but it can be adjusted according to the trader's preferences.
Justification of Methodology
This strategy leverages Williams Fractals to open long trade when price has broken the key resistance level to the upside. This resistance level is the last up fractal and is shall be broken above the Williams Alligator's teeth line to be qualified as the valid breakout according to this strategy. The Alligator filtering increases the probability to avoid the false breakouts against the current trend.
Moreover strategy has an additional filter using Average True Range(ATR) indicator. If average value of ATR for the last user-defined number of bars is lower than user-defined threshold strategy can open the long trade according to open trade condition above. The logic here is following: we want to open trades after period of price consolidation inside the range because before and after a big move price is more likely to be in sideways, but we need a trend move to have a profit.
Another one important feature is how the exit condition is defined. On the one hand, strategy has the user-defined stop-loss (3% below the entry price by default). It's made to give users the opportunity to restrict their losses according to their risk-tolerance. On the other hand, strategy utilizes the dynamic exit level which is defined by down fractal activation. If we assume the breaking up fractal is the beginning of the uptrend, breaking down fractal can be the start of downtrend phase. We don't want to be in long trade if there is a high probability of reversal to the downside. This approach helps to not keep open trade if trend is not developing and hold it if price continues going up.
Backtest Results
Operating window: Date range of backtests is 2023.01.01 - 2024.05.01. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 30%
Maximum Single Position Loss: -3.19%
Maximum Single Profit: +24.97%
Net Profit: +3036.90 USDT (+30.37%)
Total Trades: 83 (28.92% win rate)
Profit Factor: 1.953
Maximum Accumulated Loss: 963.98 USDT (-8.29%)
Average Profit per Trade: 36.59 USDT (+1.12%)
Average Trade Duration: 72 hours
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
How to Use
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 4h and higher time frames and the BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
TSI w SuperTrend decision - Strategy [presentTrading]This strategy aims to improve upon the performance of Traidngview's newly published "Trend Strength Index" indicator by incorporating the SuperTrend for better trade execution and risk management. Enjoy :)
█ Introduction and How it is Different
The "TSI with SuperTrend Decision - Strategy" combines the Trend Strength Index (TSI) with SuperTrend indicators to determine entry and exit points. Unlike traditional strategies that rely solely on one indicator, this method leverages the strengths of both TSI and SuperTrend to provide a more nuanced and adaptive trading strategy.
This dual approach allows for capturing trends more effectively, especially in volatile markets.
BTCUSD 8h LS Performance
█ Strategy, How it Works: Detailed Explanation
🔶 Trend Strength Index (TSI)
The TSI is a momentum oscillator that shows both the direction and strength of a trend. It is calculated by comparing the price movement with the bar index over a specified period. The formula for TSI is as follows:
```
TSI = (PC / |PC|)
where:
PC = Change in price over the period
```
In this strategy, TSI is calculated using the closing prices and a default period of 64 bars. The TSI values help identify overbought and oversold conditions, providing signals for potential market reversals.
🔶 SuperTrend Indicator
The SuperTrend is a trend-following indicator based on the average true range (ATR). It helps in identifying the direction of the market trend. The SuperTrend calculation involves:
```
SuperTrend = HLC3 ± (Factor * ATR)
where:
HLC3 = (High + Low + Close) / 3
Factor = User-defined multiplier
ATR = Average True Range over a period
```
The SuperTrend settings in this strategy include a length of 10 bars and a factor of 3.0.
Last Bull Cycle of BTC
🔶 Entry and Exit Conditions
The strategy uses the TSI and SuperTrend together to determine entry and exit points:
- Long Entry: When the SuperTrend indicates a downward trend (st.d < 0) and the TSI is above the oversold level (-0.241).
- Long Exit: When the SuperTrend indicates an upward trend (st.d > 0) and the TSI is below the overbought level (0.241).
- Short Entry: When the SuperTrend indicates an upward trend (st.d > 0) and the TSI is below the overbought level (0.241).
- Short Exit: When the SuperTrend indicates a downward trend (st.d < 0) and the TSI is above the oversold level (-0.241).
█ Trade Direction
The strategy allows users to select the trade direction through the `tradeDirection` input. The options are:
- Both: Enables both long and short trades.
- Long: Enables only long trades.
- Short: Enables only short trades.
█ Default Settings
- TSI Length: 64
- SuperTrend Length: 10
- SuperTrend Factor: 3.0
- Trade Direction: Both
- Take Profit (%): 30.0
- Stop Loss (%): 20.0
Impact of Default Settings
- TSI Length: A longer TSI period smooths out noise but may lag in identifying trends. A shorter period is more responsive but can generate false signals.
- SuperTrend Length: A shorter length provides quicker signals but can be prone to whipsaws. A longer length is more reliable but may delay entries and exits.
- SuperTrend Factor: A higher factor increases the distance of the SuperTrend from the price, reducing sensitivity to minor price fluctuations.
- Trade Direction: Allows flexibility in trading strategies by enabling both long and short trades based on market conditions.
- Take Profit and Stop Loss: These settings manage risk by automatically closing trades at predefined profit or loss levels. Higher percentages provide larger potential gains but also higher risk.
CCI and MACD Auto Trading Strategy with Risk/RewardOverview:
This strategy combines the Commodity Channel Index (CCI) and the Moving Average Convergence Divergence (MACD) indicators to automate trading decisions. It dynamically sets stop-loss and take-profit levels based on recent lows and highs, ensuring a risk/reward ratio of 1:1.5. This script aims to leverage trend and momentum signals while maintaining effective risk management.
Originality and Usefulness:
This script is not just a simple mashup of CCI and MACD indicators; it incorporates dynamic risk management by setting stop-loss and take-profit levels based on recent price action. This approach helps traders to:
・Identify potential trend reversals using the combination of CCI and MACD signals.
・Manage trades effectively by setting realistic stop-loss and take-profit levels based on recent market data.
・Maintain a balanced risk/reward ratio, which is essential for sustainable trading.
Indicators Used:
・CCI (Commodity Channel Index):
・Measures the deviation of the price from its average over a specified period, typically ranging from -100 to +100.
・Helps identify overbought and oversold conditions.
・MACD (Moving Average Convergence Divergence):
・Utilizes the difference between short-term and long-term moving averages to indicate trend strength and direction.
・Provides momentum signals that can be used for timing entries and exits.
How It Works:
Entry Conditions:
Long Entry:
・The MACD histogram is above zero.
・The CCI crosses above the -100 line.
Short Entry:
・The MACD histogram is below zero.
・The CCI crosses below the +100 line.
Exit Conditions:
Long Positions:
・The stop-loss is set at the recent low.
・The take-profit is set at 1.5 times the distance between the entry price and the stop-loss.
Short Positions:
・The stop-loss is set at the recent high.
・The take-profit is set at 1.5 times the distance between the entry price and the stop-loss.
Risk Management:
・The script dynamically adjusts stop-loss and take-profit levels based on recent market data, ensuring that the risk/reward ratio is maintained at 1:1.5.
・This approach helps in managing the risk effectively while aiming for consistent profits.
Strategy Properties:
・Account Size: Configured for a realistic account size suitable for the average trader.
・Commission and Slippage: Includes settings for realistic commission and slippage to reflect real market conditions.
・Risk per Trade: Designed to risk no more than 5-10% of equity per trade, aligning with sustainable trading practices.
・Backtesting Results: Configured to generate a sufficient sample size (ideally more than 100 trades) for reliable backtesting results.
Revised Backtesting Settings
Ensure that your backtesting settings are realistic:
・Account Size: Set a realistic initial capital suitable for the average trader.
・Commission and Slippage: Include realistic commission fees and slippage.
・Risk Management: Ensure that each trade risks no more than 5-10% of the account equity.
・Sufficient Sample Size: Choose a dataset that will generate more than 100 trades to provide a robust sample size.
Scalp Slayer (i)📊 The Foundation: Core Parameters and Inputs
Filter Number: This parameter is the cornerstone of the script’s sensitivity control. It adjusts the threshold for market volatility that the script considers significant enough for a trade. By default, it's set to 1.5, striking a balance between aggressiveness and conservatism. Traders can tweak this number to make the script more or less sensitive to price fluctuations. A higher number captures smaller, more frequent price movements, ideal for an aggressive trading style. Conversely, a lower number filters out minor noise, focusing on more substantial movements.
EMA Trend Period: The Exponential Moving Average (EMA) is critical for identifying the market's direction. The script uses an EMA calculated over a default period of 50 bars to discern whether the market is trending up or down. This helps in making decisions that align with the overall market trend, thereby increasing the likelihood of successful trades.
Lookback Period: This parameter, set to 20 periods by default, is used to calculate recent highs and lows. These values are crucial for setting realistic take profit and stop-loss levels, as they reflect recent market behavior. The lookback period helps the script adapt to current market conditions by analyzing recent price actions to identify key support and resistance levels.
Color Settings: For enhanced visualization, the script allows customization of colors for take profit and stop-loss markers. By default, take profit levels are marked in orange, and stop-loss levels in red. This color coding helps traders quickly identify important levels on the chart.
Visibility Controls: The script includes options to toggle the display of buy and sell labels, as well as to enable or disable strategy plotting for backtesting and real-time analysis. These controls help traders tailor the script’s visual output to their preferences, making it easier to focus on key trading signals.
🛠️ The Mechanics: How "Scalp Slayer (i)" Operates
1. Calculating the Trading Range and Trend EMA
True Range Calculation: The script begins by calculating the true range, which is the difference between the high and low prices of a bar. This measure of volatility is crucial for identifying significant price movements.
EMA of True Range: The script then smooths the true range using an Exponential Moving Average (EMA). This helps filter out minor price fluctuations, ensuring that the script only reacts to meaningful changes in price. The sensitivity of this filter is adjusted by the filter number, which multiplies the EMA to fine-tune the script's responsiveness to price changes.
Trend EMA: To determine the market’s trend, the script calculates an EMA over the close prices for the specified trend period (default is 50). This trend EMA acts as a benchmark for identifying whether the market is trending up or down. The script uses this trend filter to ensure trades are made in the direction of the prevailing market trend, thereby reducing the risk of trading against the trend.
2. Identifying Recent Highs and Lows
Recent Highs and Lows: The script uses the lookback period to identify the highest and lowest prices over a set number of bars. These recent highs and lows serve as reference points for setting take profit and stop-loss levels. By analyzing recent price action, the script ensures that these levels are relevant to current market conditions, providing a dynamic and contextually accurate approach to risk management.
🔄 Strategic Entry and Exit Conditions
3. Defining Buy and Sell Conditions
Buy Condition: The script establishes a set of criteria for entering a buy trade. First, the closing price must be above the trend EMA, indicating an upward trend. Additionally, the script looks for a sequence of candles showing progressively higher closes, signifying strong upward momentum. The current trading range must exceed the EMA of the true range, confirming that the market is experiencing significant movement. This combination of trend alignment and momentum ensures that buy trades are placed in favorable market conditions.
Sell Condition: Similarly, for sell trades, the script requires the closing price to be below the trend EMA, indicating a downward trend. It also checks for a sequence of candles with progressively lower closes, indicating strong downward momentum. The trading range must again exceed the EMA of the true range, ensuring that the market is moving significantly. These conditions help ensure that sell trades are only taken when the market is likely to continue moving downwards, increasing the chances of profitable trades.
4. Executing Trades and Setting Profit Targets
Long Entry: When the buy condition is met, the script enters a long position at the closing price of the confirmation bar. It then sets a take profit level at the recent high, which serves as a realistic target based on recent price action. The stop-loss level is set at the recent low, providing a safety net against adverse price movements. This approach ensures that trades are closed at optimal points, maximizing profit while minimizing risk.
Short Entry: When the sell condition is met, the script enters a short position at the closing price of the confirmation bar. The take profit level is set at the recent low, and the stop-loss level is set at the recent high. This setup ensures that short trades are closed at favorable levels, capturing gains while protecting against potential losses.
5. Managing Take Profit and Stop Loss
Take Profit and Stop Loss Mechanism: The script continually monitors the market for conditions that meet the take profit or stop-loss criteria. For long trades, the script closes the position if the price reaches or exceeds the take profit level, ensuring profits are locked in. It also closes the position if the price drops to or below the stop-loss level, preventing further losses. For short trades, the script closes the position if the price drops to or below the take profit level, or rises to or above the stop-loss level. This dynamic management of trades helps ensure that profits are maximized while risks are minimized.
🌟 Enhanced Visuals and Debugging Features
Customizable and Informative Plots
Buy and Sell Labels: The script includes options to display labels for buy and sell signals on the chart. These labels provide clear visual cues for trading opportunities, making it easy to identify entry points at a glance. Traders can customize the visibility of these labels based on their preferences, helping them focus on the most important signals.
Take Profit and Stop Loss Markers: To aid in monitoring trades, the script displays distinctive markers for take profit and stop-loss levels. These markers are color-coded for easy differentiation and are placed on the chart to provide clear indications of where trades are likely to be closed. This visual representation helps traders quickly assess the status of their trades and make informed decisions.
Trend and Price Plots: The script plots the trend EMA and recent highs/lows on the chart for quick reference. These plots provide a visual representation of key levels and trends, helping traders make more informed decisions based on current market conditions. By displaying these critical levels, the script enhances situational awareness and aids in the decision-making process.
Debugging and Validation Tools
Bar Index Plotting: For those interested in validating the script's performance, the script includes options to plot the bar index. This feature allows traders to monitor the script's behavior in real-time, ensuring that it is functioning as expected. This can be particularly useful for debugging and optimizing the script.
Condition Printing: The script also includes options to print detailed information about take profit and stop-loss conditions. This feature provides insights into the script's decision-making process, helping traders understand why certain trades were executed or closed. By providing transparency into the script's logic, this feature aids in fine-tuning and improving the script's performance.
CE_ZLSMA_5MIN_CANDLECHART-- Overview
The "CE_ZLSMA_5MIN_CANDLECHART" strategy, developed by DailyPanda, is a comprehensive trading strategy designed for analyzing trading on 5-minute candlestick charts.
It aims to use some indicators calculated from a Hekin Ashi chart, while running it on a normal candlestick chart, making sure that no price distortion affects the strategy results .
It also brings a feature to show, on the candlestick chart, where the entries would take place on the HA chart, to also be able to study the effect that the price distortion would make on your backtest.
-- Credit
The code in this script is based on open-source indicators originally written by veryfid and everget, I've made significant changes and additions to the scripts but all credit for the idea goes to them, I just built on top of it:
-- Key Features
It incorporate already built indicators (ZLSMA) and CandelierExit (CE)
-- Zero Lag Least Squares Moving Average (ZLSMA) - by veryfid
The ZLSMA is used to detect trends with minimal lag, improving the accuracy of entry and exit signals.
It incorporates a double-smoothed linear regression to minimize lag and enhance trend-following capabilities.
Buy signals are generated when the price closes above the ZLSMA together with the CE signal.
It is calculated based on the HA candlestick pattern.
-- Chandelier Exit (CE) - by everget
The Chandelier Exit indicator is used to dynamically manage stop-loss levels based on the Average True Range (ATR).
It ensures that stop-loss levels are adaptive to market volatility, protecting profits and limiting losses.
The ATR period and multiplier can be customized to fit different trading styles and risk tolerances.
It is calculated based on the HA candlestick pattern.
-- Heikin Ashi Candles
The strategy leverages Heikin Ashi candlesticks to be able identify trends more clearly and leverage this to stay on winning trades longer.
Traders can choose to display Heikin Ashi candlesticks and order fills on the chart for better visualization.
-- Risk Management
The strategy includes multiple risk management options to protect traders' capital.
Maximum intraday loss limit based on a percentage of equity.
Maximum stop-loss in points to filter out entries with excessive risk.
Daily profit target to stop trading once the goal is achieved.
Options to use fixed contract sizes or dynamically adjust based on a percentage of equity.
These features help traders manage risk and ensure sustainable trading practices.
Moving Averages
Several moving averages (EMA 9, EMA 20, EMA 50, EMA 72, EMA 200, SMA 200, and SMA 500) are plotted to provide additional context and trend confirmation.
A "Zone of Value" is highlighted between the EMA 200 and SMA 200 to identify potential support and resistance areas.
-- Customizable Inputs
The strategy includes various customizable inputs, allowing traders to tailor it to their specific needs.
Start and stop trading times.
Risk management parameters (e.g., maximum stop-loss, daily drawdown limit, and daily profit target).
Display options for Heikin Ashi candles and moving averages.
ZLSMA length and offset.
-- Usage
-- Setting Up the Strategy
Configure the start year for the strategy and the trading hours using the input fields. The first candle of each day will be filled black for easy identification, while candles that are outside the allowed time range will be filled purple.
Customize the risk management parameters to match your risk tolerance and trading style.
Enable or disable the display of Heikin Ashi candlesticks and moving averages as desired.
-- Interpreting Signals
Buy signals are indicated by a "Buy" label when the Heikin Ashi close price is above the ZLSMA and the Chandelier Exit indicates a long position.
The strategy will automatically enter a long position with a stop-loss level determined the swing low.
Positions are closed when the close price falls below the ZLSMA.
-- Risk Management
The strategy monitors the maximum intraday loss and stops trading if the loss limit is reached.
If enabled, also stops trading once the daily profit target is achieved, helping to lock in gains.
You have the option to filter operations based on a maximum accepted stop-loss level, based on your risk tolerance.
You can also operate with a fixed amount of contracts or dynamically adjust it based on your allowed risk per trade, ensuring optimal protection of capital.
-- Visual Aids
The strategy plots various moving averages to provide additional trend context.
The "Zone of Value" between the EMA 200 and SMA 200 highlights potential support and resistance areas.
Heikin Ashi candlesticks and order fills can be displayed to enhance the difference this strategy would take if you were to backtest it on a Heikin Ashi chart.
-- Table of results
This strategy also breaks down the results on a monthly basis for better understanding of your capital development along the way.
-- Conclusion
The "CE_ZLSMA_5MIN_CANDLECHART" strategy is a tool for intraday traders looking to understand and leaverage the Heikin Ashi chart while still using the normal candle chart. Traders can customize the strategy to fit their specific needs, making it a versatile addition to any trading toolkit.
Smart Money Concept Strategy - Uncle SamThis strategy combines concepts from two popular TradingView scripts:
Smart Money Concepts (SMC) : The strategy identifies key levels in the market (swing highs and lows) and draws trend lines to visualize potential breakouts. It uses volume analysis to gauge the strength of these breakouts.
Smart Money Breakouts : This part of the strategy incorporates the idea of "Smart Money" – institutional traders who often lead market movements. It looks for breakouts of established levels with significant volume, aiming to catch the beginning of new trends.
How the Strategy Works:
Identification of Key Levels: The script identifies swing highs and swing lows based on a user-defined lookback period. These levels are considered significant points where price has reversed in the past.
Drawing Trend Lines: Trend lines are drawn connecting these key levels, creating a visual representation of potential support and resistance zones.
Volume Analysis: The script analyzes the volume during the formation of these levels and during breakouts. Higher volume suggests stronger moves and increases the probability of a successful breakout.
Entry Conditions:
Long Entry: A long entry is triggered when the price breaks above a resistance line with significant volume, and the moving average trend filter (optional) is bullish.
Short Entry: A short entry is triggered when the price breaks below a support line with significant volume, and the moving average trend filter (optional) is bearish.
Exit Conditions:
Stop Loss: Customizable stop loss percentages are implemented to protect against adverse price movements.
Take Profit: Customizable take profit percentages are used to lock in profits.
Credits and Compliance:
This strategy is inspired by the concepts and code from "Smart Money Concepts (SMC) " and "Smart Money Breakouts ." I've adapted and combined elements of both scripts to create this strategy. Full credit is given to the original authors for their valuable contributions to the TradingView community.
To comply with TradingView's House Rules, I've made the following adjustments:
Clearly Stated Inspiration: The description explicitly mentions the original scripts and authors as the inspiration for this strategy.
No Direct Copying: The code has been modified and combined, not directly copied from the original scripts.
Educational Purpose: The primary purpose of this strategy is for learning and backtesting. It's not intended as financial advice.
Important Note:
This strategy is intended for educational and backtesting purposes only. It should not be used for live trading without thorough testing and understanding of the underlying concepts. Past performance is not indicative of future results.
BTC outperform atrategy### Code Description
This Pine Script™ code implements a simple trading strategy based on the relative prices of Bitcoin (BTC) on a weekly and a three-month basis. The script plots the weekly and three-month closing prices of Bitcoin on the chart and generates trading signals based on the comparison of these prices. The code can also be applied to Ethereum (ETH) with similar effectiveness.
### Explanation
1. **Inputs and Variables**:
- The user selects the trading symbol (default is "BINANCE:BTCUSDT").
- `weeklyPrice` retrieves the closing price of the selected symbol on a weekly interval.
- `monthlyPrice` retrieves the closing price of the selected symbol on a three-month interval.
2. **Plotting Data**:
- The weekly price is plotted in blue.
- The three-month price is plotted in red.
3. **Trading Conditions**:
- A long position is suggested if the weekly price is greater than the three-month price.
- A short position is suggested if the three-month price is greater than the weekly price.
4. **Strategy Execution**:
- If the long condition is met, the strategy enters a long position.
- If the short condition is met, the strategy enters a short position.
This script works equally well for Ethereum (ETH) by changing the symbol input to "BINANCE:ETHUSDT" or any other desired Ethereum trading pair.
HMA Crossover 1H with RSI, Stochastic RSI, and Trailing StopThe strategy script provided is a trading algorithm designed to help traders make informed buy and sell decisions based on certain technical indicators. Here’s a breakdown of what each part of the script does and how the strategy works:
Key Components:
Hull Moving Averages (HMA):
HMA 5: This is a Hull Moving Average calculated over 5 periods. HMAs are used to smooth out price data and identify trends more quickly than traditional moving averages.
HMA 20: This is another HMA but calculated over 20 periods, providing a broader view of the trend.
Relative Strength Index (RSI):
RSI 14: This is a momentum oscillator that measures the speed and change of price movements over a 14-period timeframe. It helps identify overbought or oversold conditions in the market.
Stochastic RSI:
%K: This is the main line of the Stochastic RSI, which combines the RSI and the Stochastic Oscillator to provide a more sensitive measure of overbought and oversold conditions. It is smoothed with a 3-period simple moving average.
Trading Signals:
Buy Signal:
Generated when the 5-period HMA crosses above the 20-period HMA, indicating a potential upward trend.
Additionally, the RSI must be below 45, suggesting that the market is not overbought.
The Stochastic RSI %K must also be below 39, confirming the oversold condition.
Sell Signal:
Generated when the 5-period HMA crosses below the 20-period HMA, indicating a potential downward trend.
The RSI must be above 60, suggesting that the market is not oversold.
The Stochastic RSI %K must also be above 63, confirming the overbought condition.
Trailing Stop Loss:
This feature helps protect profits by automatically selling the position if the price moves against the trade by 5%.
For sell positions, an additional trailing stop of 100 points is included.
Advanced Gold Scalping Strategy with RSI Divergence# Advanced Gold Scalping Strategy with RSI Divergence
## Overview
This Pine Script implements an advanced scalping strategy for gold (XAUUSD) trading, primarily designed for the 1-minute timeframe. The strategy utilizes the Relative Strength Index (RSI) indicator along with its moving average to identify potential trade setups based on divergences between price action and RSI movements.
## Key Components
### 1. RSI Calculation
- Uses a customizable RSI length (default: 60)
- Allows selection of the source for RSI calculation (default: close price)
### 2. Moving Average of RSI
- Supports multiple MA types: SMA, EMA, SMMA (RMA), WMA, VWMA, and Bollinger Bands
- Customizable MA length (default: 3)
- Option to display Bollinger Bands with adjustable standard deviation multiplier
### 3. Divergence Detection
- Implements both bullish and bearish divergence identification
- Uses pivot high and pivot low points to detect divergences
- Allows for customization of lookback periods and range for divergence detection
### 4. Entry Conditions
- Long Entry: Bullish divergence when RSI is below 40
- Short Entry: Bearish divergence when RSI is above 60
### 5. Trade Management
- Stop Loss: Customizable, default set to 11 pips
- Take Profit: Customizable, default set to 33 pips
### 6. Visualization
- Plots RSI line and its moving average
- Displays horizontal lines at 30, 50, and 70 RSI levels
- Shows Bollinger Bands when selected
- Highlights divergences with "Bull" and "Bear" labels on the chart
## Input Parameters
- RSI Length: Adjusts the period for RSI calculation
- RSI Source: Selects the price source for RSI (close, open, high, low, hl2, hlc3, ohlc4)
- MA Type: Chooses the type of moving average applied to RSI
- MA Length: Sets the period for the moving average
- BB StdDev: Adjusts the standard deviation multiplier for Bollinger Bands
- Show Divergence: Toggles the display of divergence labels
- Stop Loss: Sets the stop loss distance in pips
- Take Profit: Sets the take profit distance in pips
## Strategy Logic
1. **RSI Calculation**:
- Computes RSI using the specified length and source
- Calculates the chosen type of moving average on the RSI
2. **Divergence Detection**:
- Identifies pivot points in both price and RSI
- Checks for higher lows in RSI with lower lows in price (bullish divergence)
- Checks for lower highs in RSI with higher highs in price (bearish divergence)
3. **Trade Entry**:
- Enters a long position when a bullish divergence is detected and RSI is below 40
- Enters a short position when a bearish divergence is detected and RSI is above 60
4. **Position Management**:
- Places a stop loss order at the entry price ± stop loss pips (depending on the direction)
- Sets a take profit order at the entry price ± take profit pips (depending on the direction)
5. **Visualization**:
- Plots the RSI and its moving average
- Draws horizontal lines for overbought/oversold levels
- Displays Bollinger Bands if selected
- Shows divergence labels on the chart for identified setups
## Usage Instructions
1. Apply the script to a 1-minute XAUUSD (Gold) chart in TradingView
2. Adjust the input parameters as needed:
- Increase RSI Length for less frequent but potentially more reliable signals
- Modify MA Type and Length to change the sensitivity of the RSI moving average
- Adjust Stop Loss and Take Profit levels based on current market volatility
3. Monitor the chart for Bull (long) and Bear (short) labels indicating potential trade setups
4. Use in conjunction with other analysis and risk management techniques
## Considerations
- This strategy is designed for short-term scalping and may not be suitable for all market conditions
- Always backtest and forward test the strategy before using it with real capital
- The effectiveness of divergence-based strategies can vary depending on market trends and volatility
- Consider using additional confirmation signals or filters to improve the strategy's performance
Remember to adapt the strategy parameters to your risk tolerance and trading style, and always practice proper risk management.
MA MACD BB BackTesterOverview:
This Pine Script™ code provides a comprehensive backtesting tool that combines Moving Average (MA), Moving Average Convergence Divergence (MACD), and Bollinger Bands (BB). It is designed to help traders analyze market trends and make informed trading decisions by testing various strategies over historical data.
Key Features:
1. Customizable Indicators:
Moving Average (MA): Smooths out price data for clearer trend direction.
MACD: Measures trend momentum through MACD Line, Signal Line, and Histogram.
Bollinger Bands (BB): Identifies overbought or oversold conditions with upper and lower bands.
2. Flexible Trading Direction: Choose between long or short positions to adapt to different market conditions.
3. Risk Management: Efficiently allocate your capital with customizable position sizes.
4. Signal Generation:
Buy Signals: Triggered by crossovers for MACD, MA, and BB.
Sell Signals: Triggered by crossunders for MACD, MA, and BB.
5. Automated Trading: Automatically enter and exit trades based on signal conditions and strategy parameters.
How It Works:
1. Indicator Selection: Select your preferred indicator (MA, MACD, BB) and trading direction (Long/Short).
2. Risk Management Configuration: Set the percentage of capital to allocate per position to manage risk effectively.
3.Signal Detection: The algorithm identifies and plots buy/sell signals directly on the chart based on the chosen indicator.
4. Trade Execution: The strategy automatically enters and exits trades based on signal conditions and configured strategy parameters.
Use Cases:
- Backtesting: Evaluate the effectiveness of trading strategies using historical data to understand potential performance.
- Strategy Development: Customize and expand the strategy to incorporate additional indicators or conditions to fit specific trading styles.
ADDONS That Affect Strategy:
1. Indicator Parameters:
Adjustments to the settings of MACD (e.g., fast length, slow length), MA (e.g., length), and BB (e.g., length, multiplier) will directly impact the detection of signals and the strategy's performance.
2. Trading Direction:
Changing the trading direction (Long/Short) will alter the entry and exit conditions based on the detected signals.
3. Risk Management Settings:
Modifying the position size percentage affects capital allocation and overall risk exposure per trade.
ADDONS That Do Not Affect Strategy:
1. Visual Customizations:
Changes to the color, shape, and style of the plotted lines and signals do not impact the core functionality of the strategy but enhance visual clarity.
2. Text and Labels:
Modifying text labels for the signals (such as renaming "Buy MACD" to "MACD Buy Signal") is purely cosmetic and does not influence the strategy’s logic or outcomes.
Notes:
- Customization: The indicator is highly customizable to fit various trading styles and market conditions.
- Risk Management: Adjust position sizes and risk parameters according to your risk tolerance and account size.
- Optimization: Regularly backtest and optimize parameters to adapt to changing market dynamics for better performance.
Getting Started:
-Add the script to your chart.
-Adjust the input parameters to suit your analysis preferences.
-Observe the marked buy and sell signals on your chart to make informed trading decisions.
Uptrick:Intensity IndexPurpose:
The "Uptrick: Intensity Index" strategy is designed to provide traders with insights into the trend intensity of security by combining multiple moving averages and their relative positions. This versatile tool can be used effectively by both short-term and long-term traders to identify potential buy and sell signals based on specific conditions.
Explanation:
Input Parameters and Customization:
Moving Averages Lengths:
Adjust MA1, MA2, and MA3 lengths to change the calculation periods for the moving averages.
Trend Intensity Index SMA Length:
Adjust the length of the SMA applied to the TII.
Plot Colors:
Change the colors of the TII and TII MA plots for better visualization.
Background Colors and Transparency:
Set different colors for positive and negative TII MA values.
Control the transparency of the background color.
---------------------------------------------------------------------------
MA1 (Length 10): Short-term moving average, useful for capturing short-term market trends.
MA2 (Length 20): Medium-term moving average, providing a balanced view of market trends.
MA3 (Length 50): Long-term moving average, offering insights into long-term market trends.
The script calculates the relative positions of the closing price to each moving average (rel1, rel2, rel3) to determine how far the current price deviates from each average.
Trend Intensity Index (TII):
The TII is calculated as the average of the relative positions (rel1, rel2, rel3), multiplied by 100 to convert it into a percentage. This index reflects the overall intensity of the trend, considering short-term, medium-term, and long-term perspectives.
The TII is plotted in blue, providing a visual representation of trend intensity.
SMA of TII:
An additional SMA is applied to the TII (matii) to smooth out fluctuations and provide a clearer long-term trend signal.
The SMA of TII is plotted in orange, offering a reference for long-term trend analysis.
Determining Potential Price Movements:
For Short-Term Traders:
When the blue TII line crosses above the orange SMA of TII line, it indicates a potential buy signal.
When the blue TII line crosses below the orange SMA of TII line, it indicates a potential sell signal.
For Long-Term Traders:
When the orange SMA of TII line crosses above the highlighted 0 line, it indicates a potential buy signal.
When the orange SMA of TII line crosses below the highlighted 0 line, it indicates a potential sell signal.
Plotting and Visualization:
The TII and its SMA are plotted with distinct colors for easy identification.
A horizontal line at 0 is plotted in gray to serve as a reference point for long-term trend signals.
The background color changes based on the value of the SMA of TII (matii):
Green background for matii values above 0, indicating bullish conditions.
Red background for matii values below 0, indicating bearish conditions.
Utility and Potential Usage:
The "Uptrick: Intensity Index" indicator is a powerful tool for both short-term and long-term traders, offering clear buy and sell signals based on the crossover of the TII and its SMA, as well as the position of the SMA relative to the zero line.
By consolidating multiple moving averages and their relative positions into a single indicator, traders can gain comprehensive insights into market trends and intensity.
The ability to adjust all inputs and toggle visibility options enhances the flexibility and utility of the indicator, making it suitable for various trading styles and market conditions.
Through its versatile design and advanced features, the "Uptrick: Intensity Index" indicator equips traders with actionable insights into trend intensity and potential price movements. By integrating this robust tool into their trading strategies, traders can navigate the markets with greater precision and confidence, thereby enhancing their trading outcomes.
WHAT SETTINGS TO HAVE FOR THE MOVING AVERAGE:
Short-term traders (day traders) might prefer a shorter SMA length (e.g., 5-20 periods) as they are looking for quick signals and react to price changes more rapidly.
Medium-term traders (swing traders) might opt for a medium SMA length (e.g., 20-50 periods) which can filter out some noise and provide a clearer signal on the trend.
Long-term traders (position traders) might choose a longer SMA length (e.g., 50-200 periods) to get a broader view of the market trend and avoid reacting to short-term fluctuations.
Versatile Moving Average StrategyVersatile Moving Average Strategy (VMAS)
Overview:
The Versatile Moving Average Strategy (VMAS) is designed to provide traders with a flexible approach to trend-following, utilizing multiple types of moving averages. This strategy allows for customization in choosing the moving average type and length, catering to various market conditions and trading styles.
Key Features:
- Multiple Moving Average Types: Choose from SMA, EMA, SMMA (RMA), WMA, VWMA, HULL, LSMA, and ALMA to best suit your trading needs.
- Customizable Inputs: Adjust the moving average length, source of price data, and stop-loss source to fine-tune the strategy.
- Target Percent: Set the percentage difference between successive profit targets to manage your risk and rewards effectively.
- Position Management: Enable or disable long and short positions, allowing for versatility in different market conditions.
- Commission and Slippage: The strategy includes realistic commission settings to ensure accurate backtesting results.
Strategy Logic:
1. Moving Average Calculation: The selected moving average is calculated based on user-defined parameters.
2. Entry Conditions:
- A long position is entered when the entry source crosses over the moving average, if long positions are enabled.
- A short position is entered when the entry source crosses under the moving average, if short positions are enabled.
3. Stop-Loss: Positions are closed if the stop-loss source crosses the moving average in the opposite direction.
4. Profit Targets: Multiple profit targets are defined, with each target set at an incremental percentage above (for long positions) or below (for short positions) the entry price.
Default Properties:
- Account Size: $10000
- Commission: 0.01% per trade
- Risk Management: Positions are sized to risk 80% of the equity per trade, because we get very tight stoploss when position is open.
- Sample Size: Backtesting has been conducted to ensure a sufficient sample size of trades, ideally more than 100 trades.
How to Use:
1. Configure Inputs: Set your preferred moving average type, length, and other input parameters.
2. Enable Positions: Choose whether to enable long, short, or both types of positions.
3. Backtest and Analyze: Run backtests with realistic settings and analyze the results to ensure the strategy aligns with your trading goals.
4. Deploy and Monitor: Once satisfied with the backtesting results, deploy the strategy in a live environment and monitor its performance.
This strategy is suitable for traders looking to leverage moving averages in a versatile and customizable manner. Adjust the parameters to match your trading style and market conditions for optimal results.
Note: Ensure the strategy settings used for publication are the same as those described here. Always conduct thorough backtesting before deploying any strategy in a live trading environment.
Strategic Multi-Step Supertrend - Strategy [presentTrading]The code is mainly developed for me to stimulate the multi-step taking profit function for strategies. The result shows the drawdown can be reduced but at the same time reduced the profit as well. It can be a heuristic for futures leverage traders.
█ Introduction and How it is Different
The "Strategic Multi-Step Supertrend" is a trading strategy designed to leverage the power of multiple steps to optimize trade entries and exits across the Supertrend indicator. Unlike traditional strategies that rely on single entry and exit points, this strategy employs a multi-step approach to take profit, allowing traders to lock in gains incrementally. Additionally, the strategy is adaptable to both long and short trades, providing a comprehensive solution for dynamic market conditions.
This template strategy lies in its dual Supertrend calculation, which enhances the accuracy of trend detection and provides more reliable signals for trade entries and exits. This approach minimizes false signals and increases the overall profitability of trades by ensuring that positions are entered and exited at optimal points.
BTC 6h L/S Performance
█ Strategy, How It Works: Detailed Explanation
The "Strategic Multi-Step Supertrend Trader" strategy utilizes two Supertrend indicators calculated with different parameters to determine the direction and strength of the market trend. This dual approach increases the robustness of the signals, reducing the likelihood of entering trades based on false signals. Here is a detailed breakdown of how the strategy operates:
🔶 Supertrend Indicator Calculation
The Supertrend indicator is a trend-following overlay on the price chart, typically used to identify the direction of the trend. It is calculated using the Average True Range (ATR) to ensure that the indicator adapts to market volatility. The formula for the Supertrend indicator is:
Upper Band = (High + Low) / 2 + (Factor * ATR)
Lower Band = (High + Low) / 2 - (Factor * ATR)
Where:
- High and Low are the highest and lowest prices of the period.
- Factor is a user-defined multiplier.
- ATR is the Average True Range over a specified period.
The Supertrend changes its direction based on the closing price in relation to these bands.
🔶 Entry-Exit Conditions
The strategy enters long positions when both Supertrend indicators signal an uptrend, and short positions when both indicate a downtrend. Specifically:
- Long Condition: Supertrend1 < 0 and Supertrend2 < 0
- Short Condition: Supertrend1 > 0 and Supertrend2 > 0
- Long Exit Condition: Supertrend1 > 0 and Supertrend2 > 0
- Short Exit Condition: Supertrend1 < 0 and Supertrend2 < 0
🔶 Multi-Step Take Profit Mechanism
The strategy features a multi-step take profit mechanism, which allows traders to lock in profits incrementally. This is achieved through four user-configurable take profit levels. For each level, the strategy specifies a percentage increase (for long trades) or decrease (for short trades) in the entry price at which a portion of the position is exited:
- Step 1: Exit a portion of the trade at Entry Price * (1 + Take Profit Percent1 / 100)
- Step 2: Exit a portion of the trade at Entry Price * (1 + Take Profit Percent2 / 100)
- Step 3: Exit a portion of the trade at Entry Price * (1 + Take Profit Percent3 / 100)
- Step 4: Exit a portion of the trade at Entry Price * (1 + Take Profit Percent4 / 100)
This staggered exit strategy helps in locking profits at multiple levels, thereby reducing risk and increasing the likelihood of capturing the maximum possible profit from a trend.
BTC Local
█ Trade Direction
The strategy is highly flexible, allowing users to specify the trade direction. There are three options available:
- Long Only: The strategy will only enter long trades.
- Short Only: The strategy will only enter short trades.
- Both: The strategy will enter both long and short trades based on the Supertrend signals.
This flexibility allows traders to adapt the strategy to various market conditions and their own trading preferences.
█ Usage
1. Add the strategy to your trading platform and apply it to the desired chart.
2. Configure the take profit settings under the "Take Profit Settings" group.
3. Set the trade direction under the "Trade Direction" group.
4. Adjust the Supertrend settings in the "Supertrend Settings" group to fine-tune the indicator calculations.
5. Monitor the chart for entry and exit signals as indicated by the strategy.
█ Default Settings
- Use Take Profit: True
- Take Profit Percentages: Step 1 - 6%, Step 2 - 12%, Step 3 - 18%, Step 4 - 50%
- Take Profit Amounts: Step 1 - 12%, Step 2 - 8%, Step 3 - 4%, Step 4 - 0%
- Number of Take Profit Steps: 3
- Trade Direction: Both
- Supertrend Settings: ATR Length 1 - 10, Factor 1 - 3.0, ATR Length 2 - 11, Factor 2 - 4.0
These settings provide a balanced starting point, which can be customized further based on individual trading preferences and market conditions.
Chande Momentum Oscillator (CMO) Buy Sell Strategy [TradeDots]The "Chande Momentum Oscillator (CMO) Buy Sell Strategy" leverages the CMO indicator to identify short-term buy and sell opportunities.
HOW DOES IT WORK
The standard CMO indicator measures the difference between recent gains and losses, divided by the total price movement over the same period. However, this version of the CMO has some limitations.
The primary disadvantage of the original CMO is its responsiveness to short-term volatility, making the signals less smooth and more erratic, especially in fluctuating markets. This instability can lead to misleading buy or sell signals.
To address this, we integrated the concept from the Moving Average Convergence Divergence (MACD) indicator. By applying a 9-period exponential moving average (EMA) to the CMO line, we obtained a smoothed signal line. This line acts as a filter, identifying confirmed overbought or oversold states, thereby reducing the number of false signals.
Similar to the MACD histogram, we generate columns representing the difference between the CMO and its signal line, reflecting market momentum. We use this momentum indicator as a criterion for entry and exit points. Trades are executed when there's a convergence of CMO and signal lines during an oversold state, and they are closed when the CMO line diverges from the signal line, indicating increased selling pressure.
APPLICATION
Since the 9-period EMA smooths the CMO line, it's less susceptible to extreme price fluctuations. However, this smoothing also makes it more challenging to breach the original +50 and -50 benchmarks.
To increase trading opportunities, we've tightened the boundary ranges. Users can customize the target benchmark lines in the settings to adjust for the volatility of the underlying asset.
The 'cool down period' is essentially the number of bars that await before the next signal generation. This feature is employed to dodge the occurrence of multiple signals in a short period.
DEFAULT SETUP
Commission: 0.01%
Initial Capital: $10,000
Equity per Trade: 80%
Signal Cool Down Period: 5
RISK DISCLAIMER
Trading entails substantial risk, and most day traders incur losses. All content, tools, scripts, articles, and education provided by TradeDots serve purely informational and educational purposes. Past performances are not definitive predictors of future results.
VAWSI and Trend Persistance Reversal Strategy SL/TPThis is a completely revamped version of my "RSI and ATR Trend Reversal Strategy."
What's New?
The RSI has been replaced with an original indicator of mine, the "VAWSI," as I've elected to call it.
The standard RSI measures a change in an RMA to determine the strength of a movement.
The VAWSI performs very similarly, except it uses another original indicator of mine, the VAWMA.
VAWMA stands for "Volume (and) ATR Weight Moving Average." It takes an average of the volume and ATR and uses the ratio of each bar to weigh a moving average of the source.
It has the same formula as an RSI, but uses the VAWMA instead of an RMA.
Next we have the Trend Persistence indicator, which is an index on how long a trend has been persisting for. It is another original indicator. It takes the max deviation the source has from lowest/highest of a specified length. It then takes a cumulative measure of that amount, measures the change, then creates a strength index with that amount.
The VAWSI is a measure of an emerging trend, and the Trend Persistence indicator is a measure of how long a trend has persisted.
Finally, the 3rd main indicator, is a slight variation of an ATR. Rather than taking the max of source - low or high- source and source - source , it instead takes the max of high-low and the absolute value of source - the previous source. It then takes the absolute value of the change of this, and normalizes it with the source.
Inputs
Minimum SL/TP ensures that the Stop Loss and Take Profit still exist in untrendy markets. This is the minimum Amount that will always be applied.
VAWSI Weight is a divided by 100 multiplier for the VAWSI. So value of 200 means it is multiplied by 2. Think of it like a percentage.
Trend Persistence weight and ATR Weight are applied the same. Higher the number, the more impactful on the final calculation it is.
Combination Mult is an outright multiplier to the final calculation. So a 2.0 = * 2.0
Trend Persistence Smoothing Length is the length of the weighted moving average applied to the Trend Persistence Strength index.
Length Cycle Decimal is a replacement of length for the script.
Here we used BlackCat1402's Dynamic Length Calculation, which can be found on his page. With his permission we have implemented it into this script. Big shout out to them for not only creating, but allowing us to use it here.
The Length Cycle Decimal is used to calculate the dynamic length. Because TradingView only allows series int for their built-in library, a lot of the baseline indicators we use have to be manually recreated as functions in the following section.
The Strategy
As usual, we use Heiken Ashi values for calculations.
We begin by establishing the minimum SL/TP for use later.
Next we determine the amount of bars back since the last crossup or crossdown of our threshold line.
We then perform some normalization of our multipliers. We want a larger trend or larger VAWSI amount to narrow the threshold, so we have 1 divide them. This way, a higher reading outputs a smaller number and vice versa. We do this for both Trend Persistence, and the VAWSI.
The VAWSI we also normalize, where rather than it being a 0-100 reading of trend direction and strength, we absolute it so that as long as a trend is strong, regardless of direction, it will have a higher reading. With these normalized values, we add them together and simply subtract the ATR measurement rather than having 1 divide it.
Here you can see how the different measurements add up. A lower final number suggests imminent reversal, and a higher final number suggests an untrendy or choppy market.
ATR is in orange, the Trend Persistence is blue, the VAWSI is purple, and the final amount is green.
We take this final number and depending on the current trend direction, we multiply it by either the Highest or Lowest source since the last crossup or crossdown. We then take the highest or lowest of this calculation, and have it be our Stop Loss or Take Profit. This number cannot be higher/lower than the previous source to ensure a rapid spike doesn't immediately close your position on a still continuing trend. As well, the threshold cannot be higher/ lower than the the specified Stop Loss and Take Profit
Only after the source has fully crossed these lines do we consider it a crossup or crossdown. We confirm this with a barstate.isconfirmed to prevent repainting. Next, each time there is a crossup or crossdown we enter a long or a short respectively and plot accordingly.
I have the strategy configured to "process on order close" to ensure an accurate backtesting result. You could also set this to false and add a 1 bar delay to the "if crossup" and "if crossdown" lines under strategy so that it is calculated based on the open of the next bar.
Final Notes
The amounts have been preconfigured for performance on RIOT 5 Minute timeframe. Other timeframes are viable as well. With a few changes to the parameters, this strategy has backtested well on NVDA, AAPL, TSLA, and AMD. I recommend before altering settings to try other timeframes first.
This script does not seem to perform nearly as well in typically untrendy and choppy markets such as crypto and forex. With some setting changes, I have seen okay results with crypto, but overfitting could be the cause there.
Thank you very much, and please enjoy.
Custom Signal Oscillator StrategyThe CSO is made to help traders easily test their theories by subtracting the difference between two customizable plots(indicators) without having to search for strategies. The general purpose is to provide a tool to users without coding knowledge.
How to use :
Apply the indicator(s) to test
Go to the CSO strategy input settings and select the desired plots from the added indicators. (The back test will enter long or short depending on the fast signal crosses on the slow signal)
Pull up the strategy tester
Adjust the input settings on the selected indicator(s) to back test
For example, the published strategy is using the basis lines from two Donchian channels with varying length. This can be utilized with multiple overlays on the chart and oscillators that are operating on the same scale with each other. Since chart glows aren't extremely common, a glow option is included to stand out on the chart as the chain operator. A long only option for is also included for versatility.
Chande Kroll Trend Strategy (SPX, 1H) | PINEINDICATORSThe "Chande Kroll Stop Strategy" is designed to optimize trading on the SPX using a 1-hour timeframe. This strategy effectively combines the Chande Kroll Stop indicator with a Simple Moving Average (SMA) to create a robust method for identifying long entry and exit points. This detailed description will explain the components, rationale, and usage to ensure compliance with TradingView's guidelines and help traders understand the strategy's utility and application.
Objective
The primary goal of this strategy is to identify potential long trading opportunities in the SPX by leveraging volatility-adjusted stop levels and trend-following principles. It aims to capture upward price movements while managing risk through dynamically calculated stops.
Chande Kroll Stop Parameters:
Calculation Mode: Offers "Linear" and "Exponential" options for position size calculation. The default mode is "Exponential."
Risk Multiplier: An adjustable multiplier for risk management and position sizing, defaulting to 5.
ATR Period: Defines the period for calculating the Average True Range (ATR), with a default of 10.
ATR Multiplier: A multiplier applied to the ATR to set stop levels, defaulting to 3.
Stop Length: Period used to determine the highest high and lowest low for stop calculation, defaulting to 21.
SMA Length: Period for the Simple Moving Average, defaulting to 21.
Calculation Details:
ATR Calculation: ATR is calculated over the specified period to measure market volatility.
Chande Kroll Stop Calculation:
High Stop: The highest high over the stop length minus the ATR multiplied by the ATR multiplier.
Low Stop: The lowest low over the stop length plus the ATR multiplied by the ATR multiplier.
SMA Calculation: The 21-period SMA of the closing price is used as a trend filter.
Entry and Exit Conditions:
Long Entry: A long position is initiated when the closing price crosses over the low stop and is above the 21-period SMA. This condition ensures that the market is trending upward and that the entry is made in the direction of the prevailing trend.
Exit Long: The long position is exited when the closing price falls below the high stop, indicating potential downward movement and protecting against significant drawdowns.
Position Sizing:
The quantity of shares to trade is calculated based on the selected calculation mode (linear or exponential) and the risk multiplier. This ensures position size is adjusted dynamically based on current market conditions and user-defined risk tolerance.
Exponential Mode: Quantity is calculated using the formula: riskMultiplier / lowestClose * 1000 * strategy.equity / strategy.initial_capital.
Linear Mode: Quantity is calculated using the formula: riskMultiplier / lowestClose * 1000.
Execution:
When the long entry condition is met, the strategy triggers a buy signal, and a long position is entered with the calculated quantity. An alert is generated to notify the trader.
When the exit condition is met, the strategy closes the position and triggers a sell signal, accompanied by an alert.
Plotting:
Buy Signals: Indicated with an upward triangle below the bar.
Sell Signals: Indicated with a downward triangle above the bar.
Application
This strategy is particularly effective for trading the SPX on a 1-hour timeframe, capitalizing on price movements by adjusting stop levels dynamically based on market volatility and trend direction.
Default Setup
Initial Capital: $1,000
Risk Multiplier: 5
ATR Period: 10
ATR Multiplier: 3
Stop Length: 21
SMA Length: 21
Commission: 0.01
Slippage: 3 Ticks
Backtesting Results
Backtesting indicates that the "Chande Kroll Stop Strategy" performs optimally on the SPX when applied to the 1-hour timeframe. The strategy's dynamic adjustment of stop levels helps manage risk effectively while capturing significant upward price movements. Backtesting was conducted with a realistic initial capital of $1,000, and commissions and slippage were included to ensure the results are not misleading.
Risk Management
The strategy incorporates risk management through dynamically calculated stop levels based on the ATR and a user-defined risk multiplier. This approach ensures that position sizes are adjusted according to market volatility, helping to mitigate potential losses. Trades are sized to risk a sustainable amount of equity, adhering to the guideline of risking no more than 5-10% per trade.
Usage Notes
Customization: Users can adjust the ATR period, ATR multiplier, stop length, and SMA length to better suit their trading style and risk tolerance.
Alerts: The strategy includes alerts for buy and sell signals to keep traders informed of potential entry and exit points.
Pyramiding: Although possible, the strategy yields the best results without pyramiding.
Justification of Components
The Chande Kroll Stop indicator and the 21-period SMA are combined to provide a robust framework for identifying long trading opportunities in trending markets. Here is why they work well together:
Chande Kroll Stop Indicator: This indicator provides dynamic stop levels that adapt to market volatility, allowing traders to set logical stop-loss levels that account for current price movements. It is particularly useful in volatile markets where fixed stops can be easily hit by random price fluctuations. By using the ATR, the stop levels adjust based on recent market activity, ensuring they remain relevant in varying market conditions.
21-Period SMA: The 21-period SMA acts as a trend filter to ensure trades are taken in the direction of the prevailing market trend. By requiring the closing price to be above the SMA for long entries, the strategy aligns itself with the broader market trend, reducing the risk of entering trades against the overall market direction. This helps to avoid false signals and ensures that the trades are in line with the dominant market movement.
Combining these two components creates a balanced approach that captures trending price movements while protecting against significant drawdowns through adaptive stop levels. The Chande Kroll Stop ensures that the stops are placed at levels that reflect current volatility, while the SMA filter ensures that trades are only taken when the market is trending in the desired direction.
Concepts Underlying Calculations
ATR (Average True Range): Used to measure market volatility, which informs the stop levels.
SMA (Simple Moving Average): Used to filter trades, ensuring positions are taken in the direction of the trend.
Chande Kroll Stop: Combines high and low price levels with ATR to create dynamic stop levels that adapt to market conditions.
Risk Disclaimer
Trading involves substantial risk, and most day traders incur losses. The "Chande Kroll Stop Strategy" is provided for informational and educational purposes only. Past performance is not indicative of future results. Users are advised to adjust and personalize this trading strategy to better match their individual trading preferences and risk tolerance.
Intelle_city - World Cycle - Ath & Atl - Logarithmic - Strategy.Overview
Indicators: Strategy !
INTELLECT_city - World Cycle - ATH & ATL - Timeframe 1D and 1W - Logarithmic - Strategy - The Pi Cycle Top and Bottom Oscillator is an adaptation of the original Pi Cycle Top chart. It compares the 111-Day Moving Average circle and the 2 * 350-Day Moving Average circle of Bitcoin’s Price. These two moving averages were selected as 350 / 111 = 3.153; An approximation of the important mathematical number Pi.
When the 111-Day Moving Average circle reaches the 2 * 350-Day Moving Average circle, it indicates that the market is becoming overheated. That is because the mid time frame momentum reference of the 111-Day Moving Average has caught up with the long timeframe momentum reference of the 2 * 350-Day Moving Average.
Historically this has occurred within 3 days of the very top of each market cycle.
When the 111 Day Moving Average circle falls back beneath the 2 * 350 Day Moving Average circle, it indicates that the market momentum of that cycle is significantly cooling down. The oscillator drops down into the lower green band shown where the 111 Day Moving Average is moving at a 75% discount relative to the 2 * 350 Day Moving Average.
Historically, this has highlighted broad areas of bear market lows.
IMPORTANT: You need to set a LOGARITHMIC graph. (The function is located at the bottom right of the screen)
IMPORTANT: The INTELLECT_city indicator is made for a buy-sell strategy; there is also a signal indicator from INTELLECT_city
IMPORTANT: The Chart shows all cycles, both buying and selling.
IMPORTANT: Suitable timeframes are 1 daily (recommended) and 1 weekly
-----------------------------
Описание на русском:
-----------------------------
Обзор индикатора
INTELLECT_city - World Cycle - ATH & ATL - Timeframe 1D and 1W - Logarithmic - Strategy - Логарифмический - Сигнал - Осциллятор вершины и основания цикла Пи представляет собой адаптацию оригинального графика вершины цикла Пи. Он сравнивает круг 111-дневной скользящей средней и круг 2 * 350-дневной скользящей средней цены Биткойна. Эти две скользящие средние были выбраны как 350/111 = 3,153; Приближение важного математического числа Пи.
Когда круг 111-дневной скользящей средней достигает круга 2 * 350-дневной скользящей средней, это указывает на то, что рынок перегревается. Это происходит потому, что опорный моментум среднего временного интервала 111-дневной скользящей средней догнал опорный момент импульса длинного таймфрейма 2 * 350-дневной скользящей средней.
Исторически это происходило в течение трех дней после вершины каждого рыночного цикла.
Когда круг 111-дневной скользящей средней опускается ниже круга 2 * 350-дневной скользящей средней, это указывает на то, что рыночный импульс этого цикла значительно снижается. Осциллятор опускается в нижнюю зеленую полосу, показанную там, где 111-дневная скользящая средняя движется со скидкой 75% относительно 2 * 350-дневной скользящей средней.
Исторически это высветило широкие области минимумов медвежьего рынка.
ВАЖНО: Выставлять нужно ЛОГАРИФМИЧЕСКИЙ график. (Находиться функция с правой нижней части экрана)
ВАЖНО: Индикатор INTELLECT_city сделан для стратегии покупок продаж, есть также и сигнальный от INTELLECT_сity
ВАЖНО: На Графике видны все циклы, как на покупку так и на продажу.
ВАЖНО: Подходящие таймфреймы 1 дневной (рекомендовано) и 1 недельный
-----------------------------
Beschreibung - Deutsch
-----------------------------
Indikatorübersicht
INTELLECT_city – Weltzyklus – ATH & ATL – Zeitrahmen 1T und 1W – Logarithmisch – Strategy – Der Pi-Zyklus-Top- und Bottom-Oszillator ist eine Anpassung des ursprünglichen Pi-Zyklus-Top-Diagramms. Er vergleicht den 111-Tage-Gleitenden-Durchschnittskreis und den 2 * 350-Tage-Gleitenden-Durchschnittskreis des Bitcoin-Preises. Diese beiden gleitenden Durchschnitte wurden als 350 / 111 = 3,153 ausgewählt; eine Annäherung an die wichtige mathematische Zahl Pi.
Wenn der 111-Tage-Gleitenden-Durchschnittskreis den 2 * 350-Tage-Gleitenden-Durchschnittskreis erreicht, deutet dies darauf hin, dass der Markt überhitzt. Das liegt daran, dass der Momentum-Referenzwert des 111-Tage-Gleitenden-Durchschnitts im mittleren Zeitrahmen den Momentum-Referenzwert des 2 * 350-Tage-Gleitenden-Durchschnitts im langen Zeitrahmen eingeholt hat.
Historisch gesehen geschah dies innerhalb von 3 Tagen nach dem Höhepunkt jedes Marktzyklus.
Wenn der Kreis des 111-Tage-Durchschnitts wieder unter den Kreis des 2 x 350-Tage-Durchschnitts fällt, deutet dies darauf hin, dass die Marktdynamik dieses Zyklus deutlich nachlässt. Der Oszillator fällt in das untere grüne Band, in dem der 111-Tage-Durchschnitt mit einem Abschlag von 75 % gegenüber dem 2 x 350-Tage-Durchschnitt verläuft.
Historisch hat dies breite Bereiche mit Tiefstständen in der Baisse hervorgehoben.
WICHTIG: Sie müssen ein logarithmisches Diagramm festlegen. (Die Funktion befindet sich unten rechts auf dem Bildschirm)
WICHTIG: Der INTELLECT_city-Indikator ist für eine Kauf-Verkaufs-Strategie konzipiert; es gibt auch einen Signalindikator von INTELLECT_city
WICHTIG: Das Diagramm zeigt alle Zyklen, sowohl Kauf- als auch Verkaufszyklen.
WICHTIG: Geeignete Zeitrahmen sind 1 täglich (empfohlen) und 1 wöchentlich
BBTrend w SuperTrend decision - Strategy [presentTrading]This strategy aims to improve upon the performance of Traidngview's newly published "BB Trend" indicator by incorporating the SuperTrend for better trade execution and risk management. Enjoy :)
█Introduction and How it is Different
The "BBTrend w SuperTrend decision - Strategy " is a trading strategy designed to identify market trends using Bollinger Bands and SuperTrend indicators. What sets this strategy apart is its use of two Bollinger Bands with different lengths to capture both short-term and long-term market trends, providing a more comprehensive view of market dynamics. Additionally, the strategy includes customizable take profit (TP) and stop loss (SL) settings, allowing traders to tailor their risk management according to their preferences.
BTCUSD 4h Long Performance
█ Strategy, How It Works: Detailed Explanation
The BBTrend strategy employs two key indicators: Bollinger Bands and SuperTrend.
🔶 Bollinger Bands Calculation:
- Short Bollinger Bands**: Calculated using a shorter period (default 20).
- Long Bollinger Bands**: Calculated using a longer period (default 50).
- Bollinger Bands use the standard deviation of price data to create upper and lower bands around a moving average.
Upper Band = Middle Band + (k * Standard Deviation)
Lower Band = Middle Band - (k * Standard Deviation)
🔶 BBTrend Indicator:
- The BBTrend indicator is derived from the absolute differences between the short and long Bollinger Bands' lower and upper values.
BBTrend = (|Short Lower - Long Lower| - |Short Upper - Long Upper|) / Short Middle * 100
🔶 SuperTrend Indicator:
- The SuperTrend indicator is calculated using the average true range (ATR) and a multiplier. It helps identify the market trend direction by plotting levels above and below the price, which act as dynamic support and resistance levels. * @EliCobra makes the SuperTrend Toolkit. He is GOAT.
SuperTrend Upper = HL2 + (Factor * ATR)
SuperTrend Lower = HL2 - (Factor * ATR)
The strategy determines market trends by checking if the close price is above or below the SuperTrend values:
- Uptrend: Close price is above the SuperTrend lower band.
- Downtrend: Close price is below the SuperTrend upper band.
Short: 10 Long: 20 std 2
Short: 20 Long: 40 std 2
Short: 20 Long: 40 std 4
█ Trade Direction
The strategy allows traders to choose their trading direction:
- Long: Enter long positions only.
- Short: Enter short positions only.
- Both: Enter both long and short positions based on market conditions.
█ Usage
To use the "BBTrend - Strategy " effectively:
1. Configure Inputs: Adjust the Bollinger Bands lengths, standard deviation multiplier, and SuperTrend settings.
2. Set TPSL Conditions: Choose the take profit and stop loss percentages to manage risk.
3. Choose Trade Direction: Decide whether to trade long, short, or both directions.
4. Apply Strategy: Apply the strategy to your chart and monitor the signals for potential trades.
█ Default Settings
The default settings are designed to provide a balance between sensitivity and stability:
- Short BB Length (20): Captures short-term market trends.
- Long BB Length (50): Captures long-term market trends.
- StdDev (2.0): Determines the width of the Bollinger Bands.
- SuperTrend Length (10): Period for calculating the ATR.
- SuperTrend Factor (12): Multiplier for the ATR to adjust the SuperTrend sensitivity.
- Take Profit (30%): Sets the level at which profits are taken.
- Stop Loss (20%): Sets the level at which losses are cut to manage risk.
Effect on Performance
- Short BB Length: A shorter length makes the strategy more responsive to recent price changes but can generate more false signals.
- Long BB Length: A longer length provides smoother trend signals but may be slower to react to price changes.
- StdDev: Higher values create wider bands, reducing the frequency of signals but increasing their reliability.
- SuperTrend Length and Factor: Shorter lengths and higher factors make the SuperTrend more sensitive, providing quicker signals but potentially more noise.
- Take Profit and Stop Loss: Adjusting these levels affects the risk-reward ratio. Higher take profit percentages can increase gains but may result in fewer closed trades, while higher stop loss percentages can decrease the likelihood of being stopped out but increase potential losses.
Momentum Alligator 4h Bitcoin StrategyOverview
The Momentum Alligator 4h Bitcoin Strategy is a trend-following trading system that operates on dual time frames. It utilizes the 1D Williams Alligator indicator to identify the prevailing major price trend and seeks trading opportunities on the 4-hour (4h) time frame when the momentum is turning up. The strategy is designed to close trades if the trend fails to develop or holding position if price continues increasing without any significant correction. Note that this strategy is specifically tailored for the 4-hour time frame.
Unique Features
2-layers market noise filtering system: Trades are only initiated in the direction of the 1D trend, determined by the Williams Alligator indicator. This higher time frame confirmation filters out minor trade signals, focusing on more substantial opportunities. At the same time, strategy has additional filter on 4h time frame with Awesome Oscillator which is showing the current price momentum.
Flexible Risk Management: The strategy exclusively opens long positions, resulting in fewer trades during bear markets. It incorporates a dynamic stop-loss mechanism, which can either follow the jaw line of the 4h Alligator or a user-defined fixed stop-loss. This flexibility helps manage risk and avoid non-trending markets.
Methodology
The strategy initiates a long position when the d-line of Stochastic RSI crosses up it's k-line. It means that there is a high probability that price momentum reversed from down to up. To avoid overtrading in potentially choppy markets, it skips the next two trades following a winning trade, anticipating sideways movement after a significant price surge.
This strategy has two layers trades filtering system: 4h and 1D time frames. The first one is awesome oscillator. It shall be increasing and value has to be higher than it's 5-period SMA. This is an additional confirmation that long trade is opened in the direction of the current momentum. As it was mentioned above, all entry signals are validated against the 1D Williams Alligator indicator. A trade is only opened if the price is above all three lines of the 1D Alligator, ensuring alignment with the major trend.
A trade is closed if the price hits the 4h jaw line of the Alligator or reaches the user-defined stop-loss level.
Risk Management
The strategy employs a combined approach to risk management:
It allows positions to ride the trend as long as the price continues to move favorably, aiming to capture significant price movements. It features a user-defined stop-loss parameter to mitigate risks based on individual risk tolerance. By default, this stop-loss is set to a 2% drop from the entry point, but it can be adjusted according to the trader's preferences.
Justification of Methodology
This strategy leverages Stochastic RSI on 4h time frame to open long trade when momentum started reversing to the upside. On the one hand, Stochastic RSI is one of the most sensitive indicator, which allows to react fast on the potential trend reversal. On the other hand, this indicator can be too sensitive and provide a lot of false trend changing signals. To eliminate this weakness we use two-layers trades filtering system.
The first layer is the 4h Awesome oscillator. This is less sensitive momentum indicator. Usually it starts increasing when price has already passed significant distance from the actual reversal point. The strategy opens long trade only is Awesome oscillator is increasing and above it's 5-period SMA. This approach increases the probability to filter the false signals during the choppy market or if the reversal is false.
The second layer filter is the Williams Alligator indicator on 1D time frame. The 1D Alligator serves as a filter for identifying the primary trend and increases probability to avoid the trades with low potential because trading against major trend usually is more risky. It's much better to catch the trend continuation than local bounce.
Last but not least feature of this strategy is close trades condition. It uses the flexible approach. First of all, user can set up the fixed stop-loss according to his own risk-tolerance, by default this value is 2% of price movement. It restricts the potential loss at the moment when trade has just been opened. Moreover strategy utilizes the 4h Williams Alligator's jaw line to exit the trade. If price fell below it trade is closed. This approach helps to not keep open trade if trend is not developing and hold it if price continues going up.
Backtest Results:
Operating window: Date range of backtests is 2021.01.01 - 2024.05.01. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 50%
Maximum Single Position Loss: -3.04%
Maximum Single Profit: +29.67%
Net Profit: +6228.01 USDT (+62.28%)
Total Trades: 118 (24.58% win rate)
Profit Factor: 1.71
Maximum Accumulated Loss: 1527.69 USDT (-11.52%)
Average Profit per Trade: 52.78 USDT (+0.89%)
Average Trade Duration: 60 hours
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
How to Use:
Add the script to favorites for easy access.
Apply to the 4h timeframe desired chart (optimal performance observed on the BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
Random Entry and ExitStrategy for Researching Whether It Is Possible to Earn Consistently by Opening Random Trades
The essence of the strategy lies in generating random entries and exits based on pseudorandom numbers. The generation of pseudorandom numbers is performed by the function random_number based on the value of the seed variable. The variables entry_threshold and exit_threshold control the frequency of entries and exits. Lower values mean less frequent trades. To increase the number of trades, increase the values of these variables.
The strategy was created as part of research into whether it is possible to earn randomly in financial markets by making chaotic actions of opening and closing trades. However, it adheres to a few rules: open only long positions (in the direction of the global trend) and do not use leverage. Positions are opened with the entire available capital.
100 generations of the strategy on the daily chart of the S&P 500 (seed 1-101) give 100% positive mathematical expectations. Similar results are observed on higher timeframes of assets that are in a global uptrend.
There is also the possibility of opening only short positions for the research. Note that the logic of the strategy is built in such a way that only one trading direction can operate simultaneously (either longs or shorts). On higher timeframes, random shorts show negative results. Positive mathematical expectations for short positions can be found on lower timeframes (1 min, etc.), where a large amount of noise is observed.
---------------------------------------------------------------------------------------------------
Стратегия для исследования, можно ли стабильно зарабатывать при открытии случайных сделок
Суть стратегии заключается в генерации случайных входов и выходов на основе псевдослучайных чисел. Генерация псевдослучайных чисел происходит функцией random_number на основе значения переменной seed. Переменные entry_threshold и exit_threshold контролируют частоту входов и выходов. Более низкие значения означают менее частые сделки. Для увеличения количества сделок - увеличивайте значения переменных.
Стратегия создавалась в рамках исследования вопроса, можно ли случайным образом зарабатывать на фин. рынках, совершая хаотичные открытия и закрытия сделок. НО, придерживаясь нескольких правил: открывать только длинные позиции (в сторону глобального тренда) и не использовать кредитные плечи. Открытие позиций происходит на весь доступный капитал.
100 генераций стратегии на дневном графике S&P500 (seed 1-101) дают 100% положительных математических ожиданий. Похожие результаты наблюдаются на высоких таймфреймах активов, которые глобально находятся в восходящем тренде.
Также для исследования предусмотрена возможность открытия только коротких позиций. Обратите внимание, что логика стратегии построена таким образом, что одновременно может работать только одно направление торговли (либо лонги, либо шорты). На старших таймфреймах случайные шорты показывают негативные результаты. Положительное математическое ожидание для коротких позиций можно обнаружить на младших таймфреймах (1 min, etc), где наблюдается большое количество шумов.