Flux Charts - S&D Automation💎 GENERAL OVERVIEW
The MTF Supply & Demand Zones (S&D) Automation is a powerful and versatile tool designed to help traders rigorously test their trading strategies against historical market data. With various advanced settings, traders can fine-tune their strategies, assess performance, and identify key improvements before deploying in live trading environments. This tool offers a wide range of configurable settings, explained within this write-up.
Features of the new S&D Automation:
Step By Step : Configure your strategy step by step, which will allow you to have OR & AND logic in your strategies.
Highly Configurable : Offers multiple parameters for fine-tuning trade entry and exit conditions.
Multi-Timeframe Analysis : Allows traders to analyze multiple timeframes simultaneously for enhanced accuracy.
Provides advanced stop-loss, take-profit, and break-even settings.
Incorporates Supply & Demand Zone conditions, with settings like Sensitivity, Zone Invalidation, Minimum Zone Width & Minimum Zone Length settings for refined strategy execution.
🚩 UNIQUENESS
The S&D Automation stands out from conventional backtesting tools due to its unparalleled flexibility, precision, and advanced trading logic integration. Key factors that make it unique include:
✅ Comprehensive Strategy Customization – Unlike traditional backtesters that offer basic entry and exit conditions, S&D Automation provides a highly detailed parameter set, allowing traders to fine-tune their strategies with precision.
✅ Multi-Timeframe Supply & Demand Zones – This is the first-ever tool that allows traders to backtest Supply & Demand zones on multiple timeframes.
✅ Customizable Take-Profit Conditions – Offers various methods to set take-profit exits, including using core features from Supply & Demand Zones, and fixed exits like ATR, % change or price change, enabling traders to tailor their exit strategies to specific market behaviors.
✅ Customizable Stop-Loss Conditions – Provides several ways to set up stop losses, including using concepts from Supply & Demand Zones and trailing stops or fixed exits like ATR, % change or price change, allowing for dynamic risk management tailored to individual strategies.
✅ Integration of External Indicators – Allows the inclusion of other indicators or data sources from TradingView for creating strategy conditions, enabling traders to enhance their strategies with additional insights and data points.
By integrating these advanced features, S&D Automation ensures that traders can rigorously test and optimize their strategies with great accuracy and efficiency.
📌 HOW DOES IT WORK ?
The first setting you will want to set it the pyramiding setting. This setting controls the number of simultaneous trades in the same direction allowed in the strategy. For example, if you set it to 1, only one trade can be active in any time, and the second trade will not be entered unless the first one is exited. If it is set to 2, the script will handle both of them at the same time. Note that you should enter the same value to this pyramiding setting, and the pyramiding setting in the "Properties" tab of the script for this to work.
You can enable and set a backtesting window that will limit the entries to between the start date & end date.
Then, you can enter your desired settings for Supply & Demand Zones. You can also enable and set up to 3 timeframes, which you can use later on when customizing your strategies enter / exit conditions.
Entry Conditions
From the "Long Conditions" or the "Short Conditions" groups, you can set your position entry conditions. For settings like "initial capital" or "order size", you can open the "Properties" tab, where these are handled.
The S&D Automation can use the following conditions for entry conditions :
1. Demand Zone
Detection: Triggered when a Demand Zone forms or is detected
Retest: Triggered when price retests a Demand Zone. A retest is confirmed when a candle enters a Demand Zone and closes outside of it.
2nd Retest: Triggered when price retests a Demand Zone for the second time. A retest is confirmed when a candle enters a Demand Zone and closes outside of it.
3rd Retest: Triggered when price retests a Demand Zone for the third time. A retest is confirmed when a candle enters a Demand Zone and closes outside of it.
Retracement: Triggered when price touches a Demand Zone
Break: Triggered when a Demand Zone is invalidated by candle close or wick, depending on the user's input.
2. Supply Zone
Detection: Triggered when a Supply Zone forms or is detected
Retest: Triggered when price retests a Supply Zone. A retest is confirmed when a candle enters a Supply Zone and closes outside of it.
2nd Retest: Triggered when price retests a Supply Zone for the second time. A retest is confirmed when a candle enters a Supply Zone and closes outside of it.
3rd Retest: Triggered when price retests a Supply Zone for the third time. A retest is confirmed when a candle enters a Supply Zone and closes outside of it.
Retracement: Triggered when price touches a Supply Zone
Break: Triggered when a Supply Zone is invalidated by candle close or wick, depending on the user's input.
3. Any Zone
Detection: Triggered when any Supply or Demand Zone forms or is detected
Retest: Triggered when price retests any Supply or Demand Zone. A retest is confirmed when a candle enters any Supply or Demand Zone and closes outside of it.
2nd Retest: Triggered when price retests any Supply or Demand Zone for the second time. A retest is confirmed when a candle enters any Supply or Demand Zone and closes outside of it.
3rd Retest: Triggered when price retests any Supply or Demand Zone for the third time. A retest is confirmed when a candle enters any Supply or Demand Zone and closes outside of it.
Retracement: Triggered when price touches any Supply or Demand Zone
Break: Triggered when any Supply or Demand Zone is invalidated by candle close or wick, depending on the user's input.
🕒 TIMEFRAME CONDITIONS
The S&D Automation supports Multi-Timeframe (MTF) features, just like the Supply & Demand indicator. When setting an entry condition, you can also choose the timeframe.
To set up MTF conditions, navigate to the 'Timeframes' section in the settings, select your desired timeframes, and enable them. You can choose up to three timeframes.
Once you've selected your timeframes, you can use them in your strategy. When setting long and short entry/exit conditions, you can choose from Timeframe 1, Timeframe 2, or Timeframe 3.
External Conditions
Users can use external indicators on the chart to set entry conditions.
The second dropdown in the external condition settings allows you to choose a conditional operator to compare external outputs. Available options include:
Less Than or Equal To: <=
Less Than: <
Equal To: =
Greater Than: >
Greater Than or Equal To: >=
The position entry conditions work like this ;
Each side has 5 S&D Zone conditions and 1 Source condition. Each condition can be enabled or disabled using the checkbox on the left side of them.
The next selection is the alert type, which you can select between "Detection", "Retest", "Retracement" or "Break".
You can select which timeframe this condition should work on from Timeframe 1, 2, or 3. If you select "Any Timeframe", the condition will work for all timeframes.
Lastly select the step of this condition from 1 to 6.
The Source Condition
The last condition on each side is a source condition that is different from the others. Using this condition, you can create your own logic using other indicators' outputs on your chart. For example, suppose that you have an EMA indicator in your chart. You can have the source condition to something like "EMA > high".
The Step System
Each condition has a step number, and conditions are in topological order based on them.
The conditions are executed step by step. This means the condition with step 2 cannot be executed before the condition with step 1 is executed.
Conditions with the same step numbers have "OR" logic. This means that if you have 2 conditions with step 3, the condition with step 4 can trigger after only one of the step 3 conditions is executed.
➕ OTHER ENTRY FEATURES
The S&D Automation allows traders to choose when to execute trades and when not to execute trades.
1. Only Take Trades
This setting lets users specify the time period when their strategy can open or execute trades.
2. Don't Take Trades
This setting lets users specify time periods when their strategy can't open or execute trades.
↩️ EXIT CONDITIONS
1. Exit on Opposite Signal
When enabled, a long position will close when short entry conditions are met, and a short position will close when long entry conditions are met.
2. Exit on Session End
When enabled, positions will be closed at the end of the trading session.
📈 TAKE PROFIT CONDITIONS
There are several methods available for setting take profit exits and conditions.
1. Entry Condition TP
Users can use entry conditions as triggers for take-profit exits. This setting can be found under the long and short exit conditions.
2. Fixed TP
Users can set a fixed TP for exits. This setting can be found under the long and short exit conditions. Users can choose between the following:
Price: This method triggers a TP exit when price reaches a specified level. For example, if you set the Price TP to 10 and buy NASDAQ:TSLA at $190, the trade will automatically exit when the price reaches $200 ($190 + $10).
Ticks: This method triggers a TP exit when price moves a specified number of ticks.
Percentage (%): This method triggers a TP exit when price moves a specified percentage.
ATR: This method triggers a TP exit based on a specified multiple of the Average True Range (ATR).
📉 STOP LOSS CONDITIONS
There are several methods available for setting stop-loss exits and conditions.
1. Entry Condition SL
Users can use entry conditions as triggers for stop-loss exits. This setting can be found under the long and short exit conditions.
2. Fixed SL
Users can set a fixed SL for exits. This setting can be found under the long and short exit conditions. Users can choose between the following:
Price: This method triggers a SL exit when price reaches a specified level. For example, if you set the Price SL to 10 and buy NASDAQ:TSLA at $200, the trade will automatically exit when the price reaches $190 ($200 - $10).
Ticks: This method triggers a SL exit when price moves a specified number of ticks.
Percentage (%): This method triggers a SL exit when price moves a specified percentage.
ATR: This method triggers a SL exit based on a specified multiple of the Average True Range (ATR).
3. Trailing Stop
An explanation & example for the trailing stop feature is present on the write-up within the next section.
Exit conditions have the same logic of constructing conditions like the entry ones. You can construct a Take-Profit Condition & a Stop-Loss Condition. Note that the Take-Profit condition will only work if the position is in profit, regardless of if it's triggered or not. The same applies for the Stop-Loss condition, meaning that it will only work if the position is in loss.
You can also set a Fixed TP & Fixed SL based on the price movement after the position is entered. You have options like "Price", "Ticks", "%", or "Average True Range". For example, you can set a Fixed TP like "5%", and the position will be entered once it moves 5% up in a long position.
Trailing Stop
For the Fixed SL, you also have a "Trailing" stop option, for which you can set its activation level as well. The Trailing stop activation level and its value are expressed in ticks. Check this scenario for an example :
We have a ticker with a tick value of $1. Our Trailing Stop is set to 10 ticks, and the activation level is set to 30 ticks.
We buy 1 contract when the price is $100.
When the price becomes $110, we are in $10 (10 ticks) profit and the trailing stop is now activated.
The current price our stop's on is $110 - $30 (30 ticks), which is the level of $80.
The trailing stop will only move if the price moves up the highest high the price has been after we entered the position.
Let's suppose that price moves up $40 right after our trailing stop is activated. The price will now be $150, and our trailing stop will sit on $150 - $30 (30 ticks) = $120.
If the price is down the $120 level, our stop loss will be triggered.
There is also a "Hard SL" option designed for a backup stop-loss when trailing stops are enabled. You can enable & set this option and if the price goes down before our trailing stop even activates, the position will be exited.
You can also move stop-loss to the break-even (entry price of the position) after a certain profit is achieved using the last setting of the exit conditions. Note that for this to work, you must have a Fixed SL set-up.
➕ OTHER EXIT FEATURES
1. Move Stop Loss to Breakeven
This setting allows the strategy to automatically move the SL to Breakeven (BE) when the position is in profit by a certain amount. Users can choose between the following:
Price: This method moves the SL to BE when price reaches a specified level.
Ticks: This method moves the SL to BE when price moves a specified number of ticks.
Percentage (%): This method moves the SL to BE when price moves a specified percentage.
ATR: This method moves the SL to BE when price moves a specified multiple of the Average True Range (ATR).
Example Entry Scenario
To give an example , check this scenario; out conditions are :
LONG CONDITIONS
Demand Zone Detection, Step 1
Supply Zone Retest, Step 2
Demand Zone Break, Step 2
open > close, Step 3
First, the strategy needs to detect a Demand Zone Detection in order to start working.
After it's detected, now it's looking for either a Supply Zone Retest, or a Demand Zone Break to proceed to the next step, the reason for this is that they both have the same step number.
After one of them is detected, the strategy will consistently check candlesticks for the condition open > close. If a bullish candlestick occurs, a long position will be entered.
⏰ ALERTS
This indicator uses TradingView's strategy alert system. All entries and exits will be sent as an alert if configured. It's possible to further customize these alerts to your liking. For more information check TradingView's strategy alert customization page : www.tradingview.com
⚙️ SETTINGS
1. Backtesting Settings
Pyramiding: Controls the number of simultaneous trades allowed in the strategy. This setting must have the same value that is entered on the script's properties tab on the settings pane.
Enable Custom Backtesting Period: Restricts backtesting to a specific date range.
Start & End Time Configuration: Define precise start and end dates for historical analysis.
2. General Configuration
Detection Method: There are two detection methods you can choose from for identifying Supply & Demand Zones. Both methods aim to identify key areas where price is likely to react, but they do so using different approaches. Traders can choose the method that aligns with their trading style and time horizon.
Sensitivity: The Sensitivity setting allows traders to adjust how aggressively the script identifies supply and demand zones when using the Momentum Detection Method. This setting directly impacts the threshold for detecting zones when using the momentum detection method.
Zone Invalidation: The Zone Invalidation setting determines how supply and demand zones are invalidated.
Wick -> A zone is invalidated if a candle’s wick goes below a demand zone or above a supply zone.
Close -> A zone is invalidated if a candle closes below a demand zone or above a supply zone.
Zone Visibility Range: The Zone Visibility Range setting controls how far from the current price supply and demand zones are displayed on the chart. It helps traders focus on relevant zones while avoiding clutter from distant or less impactful areas.
Minimum Zone Width: The Minimum Zone Width setting defines the smallest size a supply or demand zone must have to be displayed on the chart. It uses the Average True Range (ATR) as a reference to ensure zones are proportionate to current market volatility.
Minimum Zone Length: The Minimum Zone Length setting determines the minimum number of bars a supply or demand zone must span to be displayed on the chart. This setting helps filter out short-lived or insignificant zones, ensuring only meaningful areas of supply or demand are highlighted.
3. Multi-Timeframe Analysis
Enable Up to Three Timeframes: Select and analyze trades across multiple timeframes.
4. Entry Conditions for Long & Short Trades
Multiple Conditions (1-6): Configure up to six independent conditions per trade direction.
Condition Types: Options include Detection, Retest, 2nd Retest, 3rd Retest, Retracement, and Break.
Timeframe Specification: Choose between "Any Timeframe", "Timeframe 1", "Timeframe 2", or "Timeframe 3".
Trade Execution Filters: Restrict trades within specific trading sessions.
5. Exit Conditions for Long & Short Trades
Exit on Opposite Signal: Automatically exit trades upon opposite trade conditions.
Exit on Session End: Closes all positions at the end of the trading session.
Multiple Take-Profit (TP) and Stop-Loss (SL) Configurations:
TP/SL based on % move, ATR, Ticks, or Fixed Price.
Hard SL option for additional risk control.
Move SL to BE (Break Even) after a certain profit threshold.
Automation
Flux Charts - PAT Automation💎 GENERAL OVERVIEW
The PAT Automation is a powerful and versatile tool designed to help traders rigorously test their trading strategies against historical market data. With an array of advanced settings, traders can fine-tune their strategies, assess performance, and identify key improvements before deploying in live trading environments. This backtester offers a wide range of configurable settings, explained within this write-up.
Features of the PAT Automation:
Step By Step : Configure your strategy step by step, which will allow you to have OR & AND logic in your strategies.
Highly Configurable : Offers multiple parameters for fine-tuning trade entry and exit conditions.
Multi-Timeframe Analysis : Allows traders to analyze multiple timeframes simultaneously for enhanced accuracy.
Provides advanced stop-loss, take-profit, and break-even settings.
Incorporates volume-based conditions, liquidity grabs , order blocks , market structures and fair value gaps for refined strategy execution.
🚩 UNIQUENESS
The PAT Automation stands out from conventional backtesting tools due to its unparalleled flexibility, precision, and advanced trading logic integration. Key factors that make it unique include:
✅ Comprehensive Strategy Customization – Unlike traditional backtesters that offer basic entry and exit conditions, PAT Automation provides a highly detailed parameter set, allowing traders to fine-tune their strategies with precision.
✅ Multi-Timeframe Price Action Features – This is the first-ever tool that allows traders to backtest price action with multi-timeframe features such as Fair Value Gaps (FVGs), Inversion Fair Value Gaps (IFVGs), Order Blocks & Breaker Blocks.
✅ Customizable Take-Profit Conditions – Offers various methods to set take-profit exits, including using core features from price action, and fixed exits like ATR, % change or price change, enabling traders to tailor their exit strategies to specific market behaviors.
✅ Customizable Stop-Loss Conditions – Provides several ways to set up stop losses, including using concepts from price action and trailing stops or fixed exits like ATR, % change or price change, allowing for dynamic risk management tailored to individual strategies.
✅ Integration of External Indicators – Allows the inclusion of other indicators or data sources from TradingView for creating strategy conditions, enabling traders to enhance their strategies with additional insights and data points.
By integrating these advanced features, PAT Automation ensures that traders can rigorously test and optimize their strategies with great accuracy and efficiency.
📌 HOW DOES IT WORK?
The first setting you will want to set it the pyramiding setting. This setting controls the number of simultaneous trades in the same direction allowed in the strategy. For example, if you set it to 1, only one trade can be active in any time, and the second trade will not be entered unless the first one is exited. If it is set to 2, the script will handle both of them at the same time. Note that you should enter the same value to this pyramiding setting, and the pyramiding setting in the "Properties" tab of the script for this to work.
For deep backtesting, you can set "Max Distance To Last Bar" to "Unlimited". If you encounter any memory issues, try decreasing this setting to a lower value.
You can enable and set a backtesting window that will limit the entries to between the start date & end date.
Then, you can enter your desired settings to Price Action features like FVGs, IFVGs, Order Blocks, Breaker Blocks, Liquidity Grabs, Market Structures, EQH & EQL and Volume Imbalances. You can also enable and set up to 3 timeframes, which you can use later on when customizing your strategies enter / exit conditions.
Entry Conditions
From the "Long Conditions" or the "Short Conditions" groups, you can set your position entry conditions. For settings like "initial capital" or "order size", you can open the "Properties" tab, where these are handled.
The PAT Automation can use the following conditions for entry conditions :
1. Order Block (OB)
Detection: Triggered when an Order Block forms or is detected
Retest: Triggered when price retests an Order Block. A retest is confirmed when a candle enters an Order Block and closes outside of it.
Retracement: Triggered when price touches an Order Block
Break: Triggered when an Order Block is invalidated by candle close or wick, depending on the user's input.
2. Breaker Block (BB)
Detection: Triggered when a Breaker Block forms or is detected
Retest: Triggered when price retests a Breaker Block. A retest is confirmed when a candle enters a Breaker Block and closes outside of it.
Retracement: Triggered when price touches a Breaker Block
Break: Triggered when a Breaker Block is invalidated by candle close or wick, depending on the user's input.
3. Fair Value Gap (FVG)
Detection: Triggered when an FVG forms or is detected
Retest: Triggered when price retests an FVG. A retest is confirmed when a candle enters an FVG and closes outside of it.
Retracement: Triggered when price touches an FVG
Break: Triggered when an FVG is invalidated by candle close or wick, depending on the user's input.
4. Inversion Fair Value Gap (IFVG)
Detection: Triggered when an IFVG forms or is detected
Retest: Triggered when price retests an IFVG. A retest is confirmed when a candle enters an IFVG and closes outside of it.
Retracement: Triggered when price touches an IFVG
Break: Triggered when an IFVG is invalidated by candle close or wick, depending on the user's input.
5. Break of Structure (BOS)
Detection: Triggered when a BOS forms or is detected
6. Change of Character (CHoCH)
Detection: Triggered when a CHoCH forms or is detected
7. Change of Character Plus (CHoCH+)
Detection: Triggered when a CHoCH+ forms or is detected
8. Volume Imbalance (VI)
Detection: Triggered when a Volume Imbalance forms or is detected
9. Equal High (EQH)
Detection: Triggered when an EQH is detected
10. Equal Low (EQL)
Detection: Triggered when an EQL is detected
11. Buyside Liquidity Grab
Detection: Triggered when a liquidity grab occurs at Buyside Liquidity (BSL).
12. Sellside Liquidity Grab
Detection: Triggered when a liquidity grab occurs at Sellside Liquidity (SSL).
🕒 TIMEFRAME CONDITIONS
The PAT Automation supports Multi-Timeframe (MTF) features, just like the Price Action Toolkit. When setting an entry condition, you can also choose the timeframe.
To set up MTF conditions, navigate to the 'Timeframes' section in the settings, select your desired timeframes, and enable them. You can choose up to three timeframes.
Once you've selected your timeframes, you can use them in your strategy. When setting long and short entry / exit conditions, you can choose from Timeframe 1, Timeframe 2, or Timeframe 3.
External Conditions
Users can use external indicators on the chart to set entry conditions.
The second dropdown in the external condition settings allows you to choose a conditional operator to compare external outputs. Available options include:
Less Than or Equal To: <=
Less Than: <
Equal To: =
Greater Than: >
Greater Than or Equal To: >=
The position entry conditions work like this ;
Each side has 5 Price Action conditions and 1 Source condition. Each condition can be enabled or disabled using the checkbox on the left side.
For Price Action Conditions, you can set a direction: "Any", "Bullish" or "Bearish".
Then a Price Action Feature, like "FVG" or "Order Block".
The last part of our constructed condition is the alert type, which you can select between "Detection", "Retest", "Retracement" or "Break".
Now you should have a constructed condition, which should look like "Bullish Order Block Retest".
You can select which timeframe should this condition work on from Timeframe 1, 2 or 3. If you select "Any Timeframe", the condition will work for all timeframes.
Lastly select the step of this condition from 1 to 6.
The Source Condition
The last condition on each side is a source condition that is different from the others. Using this condition, you can create your own logic using other indicators' outputs on your chart. For example, suppose that you have an EMA indicator in your chart. You can have the source condition to something like "EMA > high".
The Step System
Each condition has a step number, and conditions are in topological order based on them.
The conditions are executed step by step. This means the condition with step 2 cannot be executed before the condition with step 1 is executed.
Conditions with the same step numbers have "OR" logic. This means that if you have 2 conditions with step 3, the condition with step 4 can trigger after only one of the step 3 conditions is executed.
➕ OTHER ENTRY FEATURES
The PAT Automation allows traders to choose when to execute trades and when not to execute trades.
1. Only Take Trades
This setting lets users specify the time period when their strategy can open or execute trades.
2. Don't Take Trades
This setting lets users specify time periods when their strategy can't open or execute trades.
↩️ EXIT CONDITIONS
1. Exit on Opposite Signal
When enabled, a long position will close when short entry conditions are met, and a short position will close when long entry conditions are met.
2. Exit on Session End
When enabled, positions will be closed at the end of the trading session.
📈 TAKE PROFIT CONDITIONS
There are several methods available for setting take profit exits and conditions.
1. Entry Condition TP
Users can use entry conditions as triggers for take-profit exits. This setting can be found under the long and short exit conditions.
2. Fixed TP
Users can set a fixed TP for exits. This setting can be found under the long and short exit conditions. Users can choose between the following:
Price: This method triggers a TP exit when price reaches a specified level. For example, if you set the Price TP to 10 and buy NASDAQ:TSLA at $190, the trade will automatically exit when the price reaches $200 ($190 + $10).
Ticks: This method triggers a TP exit when price moves a specified number of ticks.
Percentage (%): This method triggers a TP exit when price moves a specified percentage.
ATR: This method triggers a TP exit based on a specified multiple of the Average True Range (ATR).
📉 STOP LOSS CONDITIONS
There are several methods available for setting stop-loss exits and conditions.
1. Entry Condition SL
Users can use entry conditions as triggers for stop-loss exits. This setting can be found under the long and short exit conditions.
2. Fixed SL
Users can set a fixed SL for exits. This setting can be found under the long and short exit conditions. Users can choose between the following:
Price: This method triggers a SL exit when price reaches a specified level. For example, if you set the Price SL to 10 and buy NASDAQ:TSLA at $200, the trade will automatically exit when the price reaches $190 ($200 - $10).
Ticks: This method triggers a SL exit when price moves a specified number of ticks.
Percentage (%): This method triggers a SL exit when price moves a specified percentage.
ATR: This method triggers a SL exit based on a specified multiple of the Average True Range (ATR).
3. Trailing Stop
An explanation & example for the trailing stop feature is present on the write-up within the next section.
Exit conditions have the same logic of constructing conditions like the entry ones. You can construct a Take-Profit Condition & a Stop-Loss Condition. Note that the Take-Profit condition will only work if the position is in profit, regardless of if it's triggered or not. The same applies for the Stop-Loss condition, meaning that it will only work if the position is in loss.
You can also set a Fixed TP & Fixed SL based on the price movement after the position is entered. You have options like "Price", "Ticks", "%", or "Average True Range". For example, you can set a Fixed TP like "5%", and the position will be entered once it moves 5% up in a long position.
Trailing Stop
For the Fixed SL, you also have a "Trailing" stop option, which you can set it's activation level as well. The Trailing stop activation level and it's value are expressed in ticks. Check this scenerio for an example :
We have a ticker with a tick value of $1. Our Trailing Stop is set to 10 ticks and activation level is set to 30 ticks.
We buy 1 contract when the price is $100.
When the price becomes $110, we are in $10 (10 ticks) profit and the trailing stop is now activated.
The current price our stop's on is $110 - $30 (30 ticks), which is the level of $80.
The trailing stop will only move if the price moves up the highest high the price has been after we entered the position.
Let's suppose that price moves up $40 right after our trailing stop is activated. The price will now be $150, and our trailing stop will sit on $150 - $30 (30 ticks) = $120.
If the price is down the $120 level, our stop loss will be triggered.
There is also a "Hard SL" option designed for a backup stop-loss when trailing stops are enabled. You can enable & set this option and if the price goes down before our trailing stop even activates, the position will be exited.
You can also move stop-loss to the break-even (entry price of the position) after a certain profit is achieved using the last setting of the exit conditions. Note that for this to work, you will need to have a Fixed SL set-up.
➕ OTHER EXIT FEATURES
1. Move Stop Loss to Breakeven
This setting allows the strategy to automatically move the SL to Breakeven (BE) when the position is in profit by a certain amount. Users can choose between the following:
Price: This method moves the SL to BE when price reaches a specified level.
Ticks: This method moves the SL to BE when price moves a specified number of ticks.
Percentage (%): This method moves the SL to BE when price moves a specified percentage.
ATR: This method moves the SL to BE when price moves a specified multiple of the Average True Range (ATR).
Example Entry Scenario
To give an example , check this scenario; out conditions are :
LONG CONDITIONS
Bullish Order Block Detection, Step 1
Bullish CHoCH Detection, Step 2
Bullish Volume Imbalance Detection, Step 2
Bullish IFVG Retest, Step 3
First, the strategy needs to detect a Bullish Order Block in order to start working.
After it's detected, now it's looking for either a CHoCH, or a Volume Imbalance to proceed to the next step, the reason for this is that they both have the same step number.
After one of them is detected, the strategy will consistently check all IFVGs for a retest. If the retest occurs, a long position will be entered.
⏰ ALERTS
This indicator uses TradingView's strategy alert system. All entries and exits will be sent as an alert if configured. It's possible to further customize these alerts to your liking. For more information check TradingView's strategy alert customization page: www.tradingview.com
⚙️ SETTINGS
1. Backtesting Settings
Pyramiding: Controls the number of simultaneous trades allowed in the strategy. This setting must have the same value that is entered on the script's properties tab on the settings pane.
Max Distance to Last Bar: Determines the depth of historical data used to prevent memory overload.
Enable Custom Backtesting Period: Restricts backtesting to a specific date range.
Start & End Time Configuration: Define precise start and end dates for historical analysis.
2. Fair Value Gaps Settings
Zone Invalidation: Select between "Wick" and "Close" invalidation.
Filtering: Choose between "Average Range" and "Volume Threshold".
FVG Sensitivity: Ranges from Extreme to Low to detect FVGs with varying strictness.
Allow Gaps: Enables analysis on tickers that have different open-close price gaps.
3. Inversion Fair Value Gaps Settings
Zone Invalidation: Choose between "Wick" and "Close".
4. Order Block Settings
Swing Length: Adjusts the minimum number of bars required for OB formation.
Zone Invalidation Method: Select between "Wick" and "Close".
5. Breaker Block Settings
Zone Invalidation: Set invalidation method as "Wick" or "Close".
6. Liquidity Grabs Settings
Pivot Length: Adjusts the number of bars used to detect liquidity grabs.
Wick-Body Ratio: Defines the proportion of wick-to-body size for liquidity grab detection.
7. Multi-Timeframe Analysis
Enable Up to Three Timeframes: Select and analyze trades across multiple timeframes.
8. Market Structures
Swing Length: Defines the number of bars required for structure shifts.
Includes BOS, CHoCH, CHoCH+ Detection.
9. Equal Highs & Lows
ATR Multiplier: Defines the sensitivity of equal highs/lows detection.
10. Volume Imbalances
Gap Size Sensitivity: Ranges from "Ultra" to "Low".
Disable Overnight Gaps: Filters out volume imbalances occurring due to overnight gaps.
11. Entry Conditions for Long & Short Trades
Multiple Conditions (1-6): Configure up to six independent conditions per trade direction.
Condition Types: Options include Detection, Retest, Retracement, and Break.
Timeframe Specification: Choose between "Any Timeframe", "Timeframe 1", "Timeframe 2", or "Timeframe 3".
Trade Execution Filters: Restrict trades within specific trading sessions.
12. Exit Conditions for Long & Short Trades
Exit on Opposite Signal: Automatically exit trades upon opposite trade conditions.
Exit on Session End: Closes all positions at the end of the trading session.
Multiple Take-Profit (TP) and Stop-Loss (SL) Configurations:
TP/SL based on % move, ATR, Ticks, or Fixed Price.
Hard SL option for additional risk control.
Move SL to BE (Break Even) after a certain profit threshold.
Flux Charts - SFX Automation💎 GENERAL OVERVIEW
The SFX Automation is a powerful and versatile tool designed to help traders rigorously test their trading strategies against historical market data. With various advanced settings, traders can fine-tune their strategies, assess performance, and identify key improvements before deploying in live trading environments. This tool offers a wide range of configurable settings, explained within this write-up.
Features of the new SFX Automation :
Step By Step : Configure your strategy step by step, which will allow you to have OR & AND logic in your strategies.
Highly Configurable : Offers multiple parameters for fine-tuning trade entry and exit conditions.
Multi-Timeframe Analysis : Allows traders to analyze multiple timeframes simultaneously for enhanced accuracy.
Provides advanced stop-loss, take-profit, and break-even settings.
Incorporates Buy & Sell signals, with settings like Signal Sensitivity, Strength, Time Weighting, Dynamic TP & SL Methods and more for refined strategy execution.
🚩 UNIQUENESS
The SFX Automation stands out from conventional backtesting tools due to its unparalleled flexibility, precision, and advanced trading logic integration. Key factors that make it unique include:
✅ Comprehensive Strategy Customization – Unlike traditional backtesters that offer basic entry and exit conditions, SFX Automation provides a highly detailed parameter set, allowing traders to fine-tune their strategies with precision.
✅ Multi-Timeframe Signals – This is the first-ever tool that allows traders to backtest Buy & Sell Signals on multiple timeframes.
✅ Customizable Take-Profit Conditions – Offers various methods to set take-profit exits, including using core features from SFX Algo, and dynamic exits like signal rating upgrades/downgrades, enabling traders to tailor their exit strategies to specific market behaviors.
✅ Customizable Stop-Loss Conditions – Provides several ways to set up stop losses, including using concepts from SFX Algo and trailing stops or dynamic exits like signal rating upgrades/downgrades, allowing for dynamic risk management tailored to individual strategies.
✅ Integration of External Indicators – Allows the inclusion of other indicators or data sources from TradingView for creating strategy conditions, enabling traders to enhance their strategies with additional insights and data points.
By integrating these advanced features, SFX Automation ensures that traders can rigorously test and optimize their strategies with great accuracy and efficiency.
📌 HOW DOES IT WORK ?
The first setting you will want to set it the pyramiding setting. This setting controls the number of simultaneous trades in the same direction allowed in the strategy. For example, if you set it to 1, only one trade can be active in any time, and the second trade will not be entered unless the first one is exited. If it is set to 2, the script will handle both of them at the same time. Note that you should enter the same value to this pyramiding setting, and the pyramiding setting in the "Properties" tab of the script for this to work.
You can enable and set a backtesting window that will limit the entries to between the start date & end date.
Entry Conditions
From the "Long Conditions" or the "Short Conditions" groups, you can set your position entry conditions. For settings like "initial capital" or "order size", you can open the "Properties" tab, where these are handled.
The SFX Algo can use the following conditions for entry conditions :
1. Buy Signal (Any, or 1-5 ☆)
This condition is triggered when a Buy Signal occurs. Other timeframes are supported with this condition.
2. Buy | TP (1, 2 or 3)
This condition is triggered when a TP signal of any Buy signal occurs.
3. Buy | SL
This condition is triggered when a SL signal of any Buy signal occurs.
4. Buy | Rating Upgrade
This condition is triggered when the rating of a buy signal is increased.
5. Buy | Rating Downgrade
This condition is triggered when the rating of a buy signal is decreased.
6. Sell Signal (Any, or 1-5 ☆)
This condition is triggered when a Sell Signal occurs. Other timeframes are supported with this condition.
7. Sell | TP (1, 2 or 3)
This condition is triggered when a TP signal of any Sell signal occurs.
8. Sell | SL
This condition is triggered when a SL signal of any Sell signal occurs.
9. Sell | Rating Upgrade
This condition is triggered when the rating of a sell signal is increased.
10. Sell | Rating Downgrade
This condition is triggered when the rating of a sell signal is decreased.
11. Retracement Wave Retest (Bullish or Bearish)
A retest on the Retracement Wave occurs when the price temporarily moves against the prevailing trend, touching or entering the wave before continuing in the original trend direction. This retest serves as a confirmation that the wave is acting as dynamic support or resistance.
12. Retracement Wave Retracement (Bullish or Bearish)
A retracement on the Retracement Wave occurs when the price touches the wave, the condition is triggered immediately.
13. Volatility Bands Retest (Bullish or Bearish)
A retest of Volatility Bands occurs when the price initially moves beyond the bands, then pulls back to "retest" the band it just broke through before continuing its move. This can provide traders with confirmation of a breakout or signal a potential reversal.
14. Volatility Bands Retracement (Bullish or Bearish)
A retracement on the Volatility Bands occur when the price touches the band, the condition is triggered immediately.
🕒 TIMEFRAME CONDITIONS
The SFX Automation supports Multi-Timeframe (MTF) features for Buy & Sell signals. When setting an entry condition, you can also choose the timeframe.
External Conditions
Users can use external indicators on the chart to set entry conditions.
The second dropdown in the external condition settings allows you to choose a conditional operator to compare external outputs. Available options include:
Less Than or Equal To: <=
Less Than: <
Equal To: =
Greater Than: >
Greater Than or Equal To: >=
The position entry conditions work like this ;
Each side has 3 SFX Algo conditions and 2 Source conditions. Each condition can be enabled or disabled using the checkbox on the left side of them.
You can select which timeframe this condition should work on for Buy & Sell signals. If you select "Chart", the condition will work for the chart's current timeframe.
Lastly select the step of this condition from 1 to 6.
The Source Condition
The last condition on each side is a source condition that is different from the others. Using this condition, you can create your own logic using other indicators' outputs on your chart. For example, suppose that you have an EMA indicator in your chart. You can have the source condition to something like "EMA > high".
The Step System
Each condition has a step number, and conditions are in topological order based on them.
The conditions are executed step by step. This means the condition with step 2 cannot be executed before the condition with step 1 is executed.
Conditions with the same step numbers have "OR" logic. This means that if you have 2 conditions with step 3, the condition with step 4 can trigger after only one of the step 3 conditions is executed.
➕ OTHER ENTRY FEATURES
The SFX Automation allows traders to choose when to execute trades and when not to execute trades.
1. Only Take Trades
This setting lets users specify the time period when their strategy can open or execute trades.
2. Don't Take Trades
This setting lets users specify time periods when their strategy can't open or execute trades.
↩️ EXIT CONDITIONS
1. Exit on Opposite Signal
When enabled, a long position will close when short entry conditions are met, and a short position will close when long entry conditions are met.
2. Exit on Session End
When enabled, positions will be closed at the end of the trading session.
📈 TAKE PROFIT CONDITIONS
There are several methods available for setting take profit exits and conditions.
1. Entry Condition TP
Users can use entry conditions as triggers for take profit exits. This setting can be found under the long and short exit conditions.
2. Fixed TP
Users can set a fixed TP for exits. This setting can be found under the long and short exit conditions. Users can choose between the following:
Price: This method triggers a TP exit when price reaches a specified level. For example, if you set the Price TP to 10 and buy NASDAQ:TSLA at $190, the trade will automatically exit when the price reaches $200 ($190 + $10).
Ticks: This method triggers a TP exit when price moves a specified number of ticks.
Percentage (%): This method triggers a TP exit when price moves a specified percentage.
ATR: This method triggers a TP exit based on a specified multiple of the Average True Range (ATR).
🧩EXIT PERCENTAGES
For each 3 dynamic take-profit conditions, you can set the amount of the position to exit in terms of percentage. It's important to make sure that the total of the exit percentages are 100%.
📉 STOP LOSS CONDITIONS
There are several methods available for setting stop-loss exits and conditions.
1. Entry Condition SL
Users can use entry conditions as triggers for stop-loss exits. This setting can be found under the long and short exit conditions.
2. Fixed SL
Users can set a fixed SL for exits. This setting can be found under the long and short exit conditions. Users can choose between the following:
Price: This method triggers a SL exit when price reaches a specified level. For example, if you set the Price SL to 10 and buy NASDAQ:TSLA at $200, the trade will automatically exit when the price reaches $190 ($200 - $10).
Ticks: This method triggers a SL exit when price moves a specified number of ticks.
Percentage (%): This method triggers a SL exit when price moves a specified percentage.
ATR: This method triggers a SL exit based on a specified multiple of the Average True Range (ATR).
3. Trailing Stop
An explanation & example for the trailing stop feature is present on the write-up within the next section.
Exit conditions have the same logic of constructing conditions like the entry ones. You can construct a Take-Profit Condition & a Stop-Loss Condition. Note that the Take-Profit condition will only work if the position is in profit, regardless of if it's triggered or not. The same applies for the Stop-Loss condition, meaning that it will only work if the position is in loss.
You can also set a Fixed TP & Fixed SL based on the price movement after the position is entered. You have options like "Price", "Ticks", "%", or "Average True Range". For example, you can set a Fixed TP like "5%", and the position will be entered once it moves 5% up in a long position.
Trailing Stop
For the Fixed SL, you also have a "Trailing" stop option, which you can set it's activation level as well. The Trailing stop activation level and it's value are expressed in ticks. Check this scenerio for an example :
We have a ticker with a tick value of $1. Our Trailing Stop is set to 10 ticks, and the activation level is set to 30 ticks.
We buy 1 contract when the price is $100.
When the price becomes $110, we are in $10 (10 ticks) profit and the trailing stop is now activated.
The current price our stop's on is $110 - $30 (30 ticks), which is the level of $80.
The trailing stop will only move if the price moves up the highest high the price has been after we entered the position.
Let's suppose that price moves up $40 right after our trailing stop is activated. The price will now be $150, and our trailing stop will sit on $150 - $30 (30 ticks) = $120.
If the price is down the $120 level, our stop loss will be triggered.
There is also a "Hard SL" option designed for a backup stop-loss when trailing stops are enabled. You can enable & set this option and if the price goes down before our trailing stop even activates, the position will be exited.
You can also move stop-loss to the break-even (entry price of the position) after a certain profit is achieved using the last setting of the exit conditions. Note that for this to work, you will need to have a Fixed SL setup.
➕ OTHER EXIT FEATURES
1. Move Stop Loss to Breakeven
This setting allows the strategy to automatically move the SL to Breakeven (BE) when the position is in profit by a certain amount. Users can choose between the following:
Price: This method moves the SL to BE when price reaches a specified level.
Ticks: This method moves the SL to BE when price moves a specified number of ticks.
Percentage (%): This method moves the SL to BE when price moves a specified percentage.
ATR: This method moves the SL to BE when price moves a specified multiple of the Average True Range (ATR).
Example Entry Scenario
To give an example , check this scenario; out conditions are :
LONG CONDITIONS
Buy Signal Any☆, Step 1
Bullish R. Wave Retest, Step 2
Bullish V. Bands Retest, Step 2
open > close, Step 3
First, the strategy needs to detect a Buy Signal with any star rating in order to start working.
After it's detected, now it's looking for either a Bullish R. Wave Retest, or a Bullish V. Bands Retest to proceed to the next step, the reason for this is that they both have the same step number.
After one of them is detected, the strategy will consistently check candlesticks for the condition open > close. If a bullish candlestick occurs, a long position will be entered.
⏰ ALERTS
This indicator uses TradingView's strategy alert system. All entries and exits will be sent as an alert if configured. It's possible to further customize these alerts to your liking. For more information, check TradingView's strategy alert customization page: www.tradingview.com
⚙️ SETTINGS
1. Backtesting Settings
Pyramiding: Controls the number of simultaneous trades allowed in the strategy. This setting must have the same value that is entered on the script's properties tab on the settings pane.
Enable Custom Backtesting Period: Restricts backtesting to a specific date range.
Start & End Time Configuration: Define precise start and end dates for historical analysis.
2. Algorithm Settings
Sensitivity: The sensitivity setting is a key parameter that influences the number of signals the SFX Algo generates. By adjusting this parameter, you can control the frequency of signals produced by the algorithm.
Signal Strength: The Signal Strength setting filters signals based on their quality, allowing traders to focus on the most reliable opportunities. This feature helps traders balance the quantity and reliability of the algorithm’s signals to suit their trading strategy.
Time Weighting: The Time Weighting setting determines how the SFX Algo evaluates historical market data to generate signals.
a) Recent Trends
Focuses on the most recent movements for short-term analysis. This setting is good for scalpers and intraday traders who need to react quickly to market changes.
b) Mixed Trends
Balances recent and historical price movements for a comprehensive market view. This setting is well-suited for swing traders and those who want to capture medium-term opportunities by combining the benefits of short-term responsiveness with the reliability of long-term trends.
c) Long-term Trends
Relies on extended historical market data to identify broader market trends, making it an excellent choice for traders focused on long-term strategies.
Minimum Star Rating: The Minimum Star Rating setting allows you to filter signals based on their strength, showing only those that meet or exceed your chosen threshold. For instance, setting the minimum star rating to 3 ensures you only receive signals with a rating of 3 stars or higher.
3. Take Profit / Stop Loss Methods
Key Levels
The Key Levels method uses pivot points to set take profit and stop-loss levels. The TP and SL levels are shown when a new signal is generated.
Volatility Bands
This TP/SL method uses the Volatility Bands overlay to set dynamic TP and SL levels. These levels are not predetermined so they will not be shown in advance when a signal is generated.
Signal Rating
Sets take profit and stop-loss levels based on changes in a signal's rating strength. These levels are not predetermined so they will not be shown in advance when a signal is generated.
Auto Stop-Loss
The auto method can only be applied to the SL. The auto method allows the algorithm to detect SL automatically when a momentum shift is detected. You can adjust the risk tolerance of the Auto SL by adjusting the ‘Auto Risk Tolerance’ setting. You can choose between Low, Medium, and High. A high-risk tolerance will result in stop losses being triggered less often.
4. Entry Conditions for Long & Short Trades
Multiple Conditions (1-6): Configure up to six independent conditions per trade direction.
Timeframe Specification: Choose between timeframes for Buy & Sell signals.
Trade Execution Filters: Restrict trades within specific trading sessions.
5. Exit Conditions for Long & Short Trades
Exit on Opposite Signal: Automatically exit trades upon opposite trade conditions.
Exit on Session End: Closes all positions at the end of the trading session.
Multiple Take-Profit (TP) and Stop-Loss (SL) Configurations:
TP/SL based on % move, ATR, Ticks, or Fixed Price.
Hard SL option for additional risk control.
Move SL to BE (Break Even) after a certain profit threshold.
Equilibrium Candles + Pattern [Honestcowboy]The Equilibrium Candles is a very simple trend continuation or reversal strategy depending on your settings.
How an Equilibrium Candle is created:
We calculate the equilibrium by measuring the mid point between highest and lowest point over X amount of bars back.
This now is the opening price for each bar and will be considered a green bar if price closes above equilibrium.
Bars get shaded by checking if regular candle close is higher than open etc. So you still see what the normal candles are doing.
Why are they useful?
The equilibrium is calculated the same as Baseline in Ichimoku Cloud. Which provides a point where price is very likely to retrace to. This script visualises the distance between close and equilibrium using candles. To provide a clear visual of how price relates to this equilibrium point.
This also makes it more straightforward to develop strategies based on this simple concept and makes the trader purely focus on this relationship and not think of any Ichimoku Cloud theories.
Script uses a very simple pattern to enter trades:
It will count how many candles have been one directional (above or below equilibrium)
Based on user input after X candles (7 by default) script shows we are in a trend (bg colors)
On the first pullback (candle closes on other side of equilibrium) it will look to enter a trade.
Places a stop order at the high of the candle if bullish trend or reverse if bearish trend.
If based on user input after X opposite candles (2 by default) order is not filled will cancel it and look for a new trend.
Use Reverse Logic:
There is a use reverse logic in the settings which on default is turned on. It will turn long orders into short orders making the stop orders become limit orders. It will use the normal long SL as target for the short. And TP as stop for the short. This to provide a means to reverse equity curve in case your pair is mean reverting by nature instead of trending.
ATR Calculation:
Averaged ATR, which is using ta.percentile_nearest_rank of 60% of a normal ATR (14 period) over the last 200 bars. This in simple words finds a value slightly above the mean ATR value over that period.
Big Candle Exit Logic:
Using Averaged ATR the script will check if a candle closes X times that ATR from the equilibrium point. This is then considered an overextension and all trades are closed.
This is also based on user input.
Simple trade management logic:
Checks if the user has selected to use TP and SL, or/and big candle exit.
Places a TP and SL based on averaged ATR at a multiplier based on user Input.
Closes trade if there is a Big Candle Exit or an opposite direction signal from indicator.
Script can be fully automated to MT5
There are risk settings in % and symbol settings provided at the bottom of the indicator. The script will send alert to MT5 broker trying to mimic the execution that happens on tradingview. There are always delays when using a bridge to MT5 broker and there could be errors so be mindful of that. This script sends alerts in format so they can be read by tradingview.to which is a bridge between the platforms.
Use the all alert function calls feature when setting up alerts and make sure you provide the right webhook if you want to use this approach.
There is also a simple buy and sell alert feature if you don't want to fully automate but still get alerts. These are available in the dropdown when creating an alert.
Almost every setting in this indicator has a tooltip added to it. So if any setting is not clear hover over the (?) icon on the right of the setting.
The backtest uses a 4% exposure per trade and a 10 point slippage. I did not include a commission cause I'm not personaly aware what the commissions are on most forex brokers. I'm only aware of minimal slippage to use in a backtest. Trading conditions vary per broker you use so always pay close attention to trading costs on your own broker. Use a full automation at your own risk and discretion and do proper backtesting.
NNFX RSI EMA FVMA MACD ALGOThis Pine Script introduces a cutting-edge trading strategy that seamlessly integrates multiple technical indicators—namely, the Flexible Variable Moving Average ( FVMA ), Relative Strength Index ( RSI ), Moving Average Convergence Divergence ( MACD ), and Exponential Moving Average ( EMA )—to deliver a sophisticated trading experience. This script stands out due to its comprehensive approach, robust risk management, and the inclusion of crucial data tables for various timeframes, making it an invaluable tool for traders seeking to enhance their market performance.
Originality of the Strategy:
The originality of this script lies in its unique combination of multiple powerful indicators, enabling traders to benefit from diverse perspectives on market dynamics. This mashup enhances decision-making processes, providing multiple layers of confirmation for trade entries and exits. The strategy is designed to offer an innovative solution for traders looking to improve their performance through well-defined rules and a solid framework.
Flexible Variable Moving Average (FVMA):
The FVMA adapts dynamically to market conditions, offering a more responsive trend line than traditional moving averages. This flexibility allows for quick identification of trends and reversals, crucial for fast-paced trading environments.
Exponential Moving Average (EMA):
By giving greater weight to recent price data, the EMA enhances sensitivity to price changes, allowing for more accurate entries and exits when used alongside the FVMA. This combination maximizes the effectiveness of the strategy in identifying optimal trading opportunities.
Relative Strength Index (RSI):
The RSI helps identify overbought or oversold conditions, integrating seamlessly with other indicators to enhance the strategy's ability to pinpoint potential reversal points. This aspect of the strategy ensures that traders can make informed decisions based on market momentum.
Moving Average Convergence Divergence (MACD):
The MACD serves as an essential confirmation tool, providing insights into trend strength and momentum. This enhances the accuracy of entry and exit signals, allowing traders to make more informed decisions based on robust technical analysis.
Multi-Take Profit (TP) and Stop Loss (SL) Levels:
The strategy supports multiple TPs, allowing traders to lock in profits at various levels while effectively managing risk through a robust SL system. This flexibility caters to diverse trading styles and risk profiles, ensuring that the strategy can adapt to individual trader needs.
Default Properties:
Take Profit Levels: TP1 is set to 2.0, and TP2 is set to 2.9, which is designed to enhance profit potential while maintaining a solid risk-reward ratio.
Stop Loss: A SL is set at 2% of the 5% account balance, which helps to preserve capital and manage risk effectively, adhering to the guideline of not risking more than 5-10% of the account balance per trade.
Labeling System for Exits: Automatic labeling of TP and SL exits on the chart provides clear visualization of trading outcomes. This feature supports informed decision-making and performance tracking, aligning with the guideline of providing transparent results.
Custom Alerts System:
The inclusion of customizable alerts for trade entries, exits, and SL/TP hits keeps traders informed in real-time, enabling prompt actions without constant market monitoring. This is crucial for effective trade management and helps traders respond quickly to market changes.
API Boxes for Automated Trading:
The strategy features API boxes, allowing traders to set up automated trading based on indicator signals. This functionality enables seamless integration with trading platforms, enhancing efficiency and streamlining the trading process, which is particularly valuable for traders looking to optimize their execution.
Data Tables for Enhanced Analysis:
The script includes data tables displaying critical insights across various timeframes: 2-hour, daily, weekly, and monthly. These tables provide a comprehensive overview of market conditions, allowing traders to analyze trends and make informed decisions based on a broad spectrum of data. By leveraging this information, traders can identify high-probability setups and align their strategies with prevailing market trends, significantly increasing their chances of success.
Default Properties:
Initial Capital: £1,000, ensuring a realistic starting point for traders.
Risk per Trade: 5% of the account balance, promoting sustainable trading practices.
Commission: 0.1%, reflecting realistic transaction costs that traders may encounter.
Slippage: 1%, accounting for potential market volatility during trade execution.
Take Profit Levels:
TP1: 2.0
TP2: 2.9
Stop Loss (SL): 2% of the 5% account balance, which is well within acceptable risk parameters.
Compliance with TradingView Guidelines:
This script fully complies with TradingView's guidelines, specifically:
Strategy Results:
The strategy is designed to publish backtesting results that do not mislead traders. The realistic parameters outlined in the default properties ensure that traders have a clear understanding of potential outcomes.
The dataset used for backtesting has sufficient trades to produce a reliable sample size, aligning with the guideline of ideally having more than 100 trades.
Any deviations from recommended practices are justified in the script description, ensuring transparency and adherence to best practices.
The script explains the default properties in detail, providing a thorough understanding of how these settings influence performance.
Why This Script is Worth Paying For:
This Pine Script offers an unparalleled trading experience through its unique combination of technical indicators, comprehensive trade management features, and detailed data tables for multiple timeframes. Here are compelling reasons to invest in this strategy:
Holistic Approach: The integration of multiple indicators ensures a well-rounded perspective on market conditions, increasing the likelihood of successful trades.
Advanced Risk Management: The flexibility of multiple TPs and SLs empowers traders to tailor their risk profiles according to individual strategies, enhancing overall profitability.
Automated Trading Capability: The inclusion of API boxes for automated trading streamlines execution, allowing traders to capitalize on opportunities without the need for manual intervention.
Comprehensive Data Analysis: The detailed data tables provide invaluable insights across different timeframes, enabling traders to make informed decisions based on robust market analysis.
In summary, this innovative Pine Script represents a powerful tool designed to empower traders at all levels. Its originality, synergistic functionality, and comprehensive features create a dynamic and effective trading environment, justifying its value and positioning it as a must-have for anyone serious about achieving consistent trading success.
Calculus Free Trend Strategy for Crypto & StocksObjective :
The Correlation Channel Trading Strategy is designed to identify potential entry points based on the relationship between price movements and a correlation channel. The strategy aims to capture trends within the channel while managing risk effectively.
Parameters :
Length: Determines the period for calculating moving averages and the true range, influencing the sensitivity of the strategy to price movements.
Multiplier: Adjusts the width of the correlation channel, providing flexibility to adapt to different market conditions.
Inputs :
Asset Symbol: Allows users to specify the financial instrument for analysis.
Timeframe: Defines the timeframe for data aggregation, enabling customization based on trading preferences.
Plot Correlation Channel: Optional input to visualize the correlation channel on the price chart.
Methodology :
Data Acquisition: The strategy fetches OHLC (Open, High, Low, Close) data for the specified asset and timeframe. In this case we use COINBASE:BTCUSD
Calculation of Correlation Channel: It computes the squared values for OHLC data, calculates the average value (x), and then calculates the square root of x to derive the source value. Additionally, it calculates the True Range as the difference between high and low prices.
Moving Averages: The strategy calculates moving averages (MA) for the source value and the True Range, which form the basis for defining the correlation channel.
Upper and Lower Bands: Using the MA and True Range, the strategy computes upper and lower bands of the correlation channel, with the width determined by the multiplier.
Entry Conditions: Long positions are initiated when the price crosses above the upper band, signaling potential overbought conditions. Short positions are initiated when the price crosses below the lower band, indicating potential oversold conditions.
Exit Conditions: Stop-loss mechanisms are incorporated directly into the entry conditions to manage risk. Long positions are exited if the price falls below a predefined stop-loss level, while short positions are exited if the price rises above the stop-loss level.
Strategy Approach: The strategy aims to capitalize on trends within the correlation channel, leveraging systematic entry signals while actively managing risk through stop-loss orders.
Backtest Details : For the purpose of this test I used the entire data available for BTCUSD Coinbase, with 10% of capital allocation and 0.1% comission for entry/exit(0.2% total). Can be also used with other both directly correlated with current settings of BTC or with new ones
Advantages :
Provides a systematic approach to trading based on quantifiable criteria.
Offers flexibility through customizable parameters to adapt to various market conditions.
Integrates risk management through predefined stop-loss mechanisms.
Limitations :
Relies on historical price data and technical indicators, which may not always accurately predict future price movements.
May generate false signals during periods of low volatility or erratic price behavior.
Requires continuous monitoring and adjustment of parameters to maintain effectiveness.
Conclusion :
The Correlation Channel Trading Strategy offers traders a structured framework for identifying potential entry points within a defined price channel. By leveraging moving averages and true range calculations, the strategy aims to capture trends while minimizing risk through stop-loss mechanisms. While no strategy can guarantee success in all market conditions, the Correlation Channel Trading Strategy provides a systematic approach to trading that can enhance decision-making and risk management for traders.
ORB Heikin Ashi SPY 5min Correlation StrategyOverview:
The ORB (Opening Range Breakout) strategy combined with Heikin Ashi candles and Relative Volume (RVOL) indicator aims to capitalize on significant price movements that occur shortly after the market opens. This strategy identifies breakouts above or below the opening range, using Heikin Ashi candles for smoother price visualization and RVOL to gauge the strength of the breakout.
Components:
Opening Range Breakout (ORB): The strategy starts by defining the opening range, typically the first few minutes of the trading session. It then identifies breakouts above the high or below the low of this range as potential entry points.
Heikin Ashi Candles: Heikin Ashi candles are used to provide a smoother representation of price movements compared to traditional candlesticks. By averaging open, close, high, and low prices of the previous candle, Heikin Ashi candles reduce noise and highlight trends more effectively.
Relative Volume (RVOL): RVOL compares the current volume of a stock to its average volume over a specified period. It helps traders identify abnormal trading activity, which can signal potential price movements.
Candle for correlation : In this case we are using SPY candles. It can also use different asset
Strategy Execution:
Initialization: The strategy initializes by setting up variables and parameters, including the ORB period, session timings, and Heikin Ashi candle settings.
ORB Calculation: It calculates the opening range by identifying the high and low prices during the specified session time. These values serve as the initial reference points for potential breakouts. For this we are looking for the first 30 min of the US opening session.
After that we are going to use the next 2 hours to check for breakout opportunities.
Heikin Ashi Transformation: Optionally, the strategy transforms traditional candlestick data into Heikin Ashi format for smoother visualization and trend identification.
Breakout Identification: It continuously monitors price movements within the session and checks if the current high breaches the ORB high or if the current low breaches the ORB low. These events trigger potential long or short entry signals, respectively.
RVOL Analysis: Simultaneously, the strategy evaluates the relative volume of the asset to gauge the strength of the breakout. A surge in volume accompanying the breakout confirms the validity of the signal. In this case we are looking for at least a 1 value of the division between currentVolume and pastVolume
Entry and Exit Conditions: When a breakout occurs and is confirmed by RVOL and is within our session time, the strategy enters a long or short position accordingly. It does not have a stop loss or a takie profit level, instead it will always exit at the end of the trading session, 5 minutes before
Position Sizing and Commissions: For the purpose of this backtest, the strategy allocated 10% of the capital for each trade and assumes a trading commission of 0.01$ per share ( twice the IBKR broker values)
Session End: At the end of the trading session, the strategy closes all open positions to avoid overnight exposure.
Conclusion:
The combination of ORB breakout strategy, Heikin Ashi candles, and RVOL provides traders with a robust framework for identifying and capitalizing on early trends in the market. By leveraging these technical indicators together, traders can make more informed decisions and improve the overall performance of their trading strategies. However, like any trading strategy, it's essential to backtest thoroughly and adapt the strategy to different market conditions to ensure its effectiveness over time.
Martingale + Grid DCA Strategy [YinYangAlgorithms]This Strategy focuses on strategically Martingaling when the price has dropped X% from your current Dollar Cost Average (DCA). When it does Martingale, it will create a Purchase Grid around this location to likewise attempt to get you a better DCA. Likewise following the Martingale strategy, it will sell when your Profit has hit your target of X%.
Martingale may be an effective way to lower your DCA. This is due to the fact that if your initial purchase; or in our case, initial Grid, all went through and the price kept going down afterwards, that you may purchase more to help lower your DCA even more. By doing so, you may bring your DCA down and effectively may make it easier and quicker to reach your target profit %.
Grid trading may be an effective way of reducing risk and lowering your DCA as you are spreading your purchases out over multiple different locations. Likewise we offer the ability to ‘Stack Grids’. What this means, is that if a single bar was to go through 20 grids, the purchase amount would be 20x what each grid is valued at. This may help get you a lower DCA as rather than creating 20 purchase orders at each grid location, we create a single purchase order at the lowest grid location, but for 20x the amount.
By combining both Martingale and Grid DCA techniques we attempt to lower your DCA strategically until you have reached your target profit %.
Before we start, we just want to make it known that first off, this Strategy features 8% Commission Fees, you may change this in the Settings to better reflect the Commission Fees of your exchange. On a similar note, due to Commission Fees being one of the number one profit killers in fast swing trade strategies, this strategy doesn’t focus on low trades, but the ideology of it may result in low amounts of trades. Please keep in mind this is not a bad thing. Since it has the ability to ‘Stack Grid Purchases’ it may purchase more for less and result in more profit, less commission fees, and likewise less # of trades.
Tutorial:
In this example above, we have it set so we Martingale twice, and we use 100 grids between the upper and lower level of each martingale; for a total of 200 Grids. This strategy will take total capital (initial capital + net profit) and divide it by the amount of grids. This will result in the $ amount purchased per grid. For instance, say you started with $10,000 and you’ve made $2000 from this Strategy so far, your total capital is $12,000. If you likewise are implementing 200 grids within your Strategy, this will result in $12,000 / 200 = $60 per grid. However, please note, that the further down the grid / martingale is, the more volume it is able to purchase for $60.
The white line within the Strategy represents your DCA. As the Strategy makes purchases, this will continue to get lower as will your Target Profit price (Blue Line). When the Close goes above your Target Profit price, the Strategy will close all open positions and claim the profit. This profit is then reinvested back into the Strategy, which may exponentially help the Strategy become more profitable the longer it runs for.
In the example above, we’ve zoomed in on the first example. In this we want to focus on how the Strategy got back into the trades shortly after it sold. Currently within the Settings we have it set so our entry is when the Lowest with a length of 3 is less than the previous Lowest with a length of 3. This is 100% customizable and there are multiple different entry options you can choose from and customize such as:
EMA 7 Crossover EMA 21
EMA 7 Crossunder EMA 21
RSI 14 Crossover RSI MA 14
RSI 14 Crossunder RSI MA 14
MFI 14 Crossover MFI MA 14
MFI 14 Crossunder MFI MA 14
Lowest of X Length < Previous Lowest of X Length
Highest of X Length > Previous Highest of X Length
All of these entry options may be tailored to be checked for on a different Time Frame than the one you are currently using the Strategy on. For instance, you may be running the Strategy on the 15 minute Time Frame yet decide you want the RSI to cross over the RSI MA on the 1 Day to be a valid entry location.
Please keep in mind, this Strategy focuses on DCA, this means you may not want the initial purchase to be the best location. You may want to buy when others think it is a good time to sell. This is because there may be strong bearish momentum which drives the price down drastically and potentially getting you a good DCA before it corrects back up.
We will continue to add more Entry options as time goes on, and if you have any in mind please don’t hesitate to let us know.
Now, back to the example above, if we refer to the Yellow circle, you may see that the Lowest of a length of 3 was less than its previous lowest, this triggered the martingales to create their grids. Only a few bars later, the price went into the first grid and went a little lower than its midpoint (Yellow line). This caused about 60% of the first grid to be purchased. Shortly after the price went even lower into this grid and caused the entire first martingale grid to be purchased. However, if you notice, the white line (your DCA) is lower than the midpoint of the first grid. This is due to the fact that we have ‘Stack Grid Purchases’ enabled. This allows the Strategy to purchase more when a single bar crosses through multiple grid locations; and effectively may lower your average more than if it simply executed a purchase order at each grid.
Still looking at the same location within our next example, if we simply increase the Martingale amount from 2 to 3 we can see something strange happens. What happened is our Target Profit price was reached, then our entry condition was met, which caused all of the martingale grids to be formed; however, the price continued to increase afterwards. This may not be a good thing, sure the price could correct back down to these grid locations, but what if it didn’t and it just kept increasing? This would result in this Strategy being stuck and unable to make any trades. For this reason we have implemented a Failsafe in the Settings called ‘Reset Grids if no purchase happens after X bars’.
We have enabled our Failsafe ‘Reset Grids if no purchase happens after X bars’ in this example above. By default it is set to 100 bars, but you can change this to whatever works best for you. If you set it to 0, this Failsafe will be disabled and act like the example prior where it is possible to be stuck with no trades executing.
This Failsafe may be an important way to ensure the Strategy is able to make purchases, however it may also mean the Grids increase in price when it is used, and if a massive correction were to occur afterwards, you may lose out on potential profit.
This Strategy was designed with WebHooks in mind. WebHooks allow you to send signals from the Strategy to your exchange. Simply set up a Custom TradingView Bot within the OKX exchange or 3Commas platform (which has your exchange API), enter the data required from the bot into the settings here, select your bot type in ‘Webhook Alert Type’, and then set up the alert. After that you’re good to go and this Strategy will fully automate all of its trades within your exchange for you. You need to format the Alert a certain way for it to work, which we will go over in the next example.
Add an alert for this Strategy and simply modify the alert message so all it says is:
{{strategy.order.alert_message}}
Likewise change from the Alert ‘Settings’ to Alert ‘Notifications’ at the top of the alert popup. Within the Notifications we will enable ‘Webhook URL’ and then we will pass the URL we are sending the Webhook to. In this example we’ve put OKX exchange Webhook URL, however if you are using 3Commas you’ll need to change this to theirs.
OKX Webhook URL:
www.okx.com
3Commas Webhook URL:
app.3commas.io
Make sure you click ‘Create’ to actually create this alert. After that you’re all set! There are many Tutorials videos you can watch if you are still a little confused as to how Webhook trading works.
Due to the nature of this Strategy and how it is designed to work, it has the ability to never sell unless there it will make profit. However, because of this it also may be stuck waiting in trades for quite a long period of time (usually a few months); especially when your Target Profit % is 15% like in the example above. However, this example above may be a good indication that it may maintain profitability for a long period of time; considering this ‘Deep Backtest’ is from 2017-8-17.
We will conclude the tutorial here. Hopefully you understand how this Strategy has the potential to make calculated and strategic DCA Grid purchases for you and then based on a traditional Martingale fashion, bulk sell at the desired Target Profit Percent.
Settings:
Purchase Settings:
Only Purchase if its lower than DCA: Generally speaking, we want to lower our Average, and therefore it makes sense to only buy when the close is lower than our current DCA and a Purchase Condition is met.
Purchase Condition: When creating the initial buy location you must remember, you want to Buy when others are Fearful and Sell when others are Greedy. Therefore, many of the Buy conditions involve times many would likewise Sell. This is one of the bonuses to using a Strategy like this as it will attempt to get you a good entry location at times people are selling.
Lower / Upper Change Length: This Lower / Upper Length is only used if the Purchase Condition is set to 'Lower Changed' or 'Upper Changed'. This is when the Lowest or Highest of this length changes. Lowest would become lower or Highest would become higher.
Purchase Resolution: Purchase Resolution is the Time Frame that the Purchase Condition is calculated on. For instance, you may only want to start a new Purchase Order when the RSI Crosses RSI MA on the 1 Day, but yet you run this Strategy on the 15 minutes.
Sell Settings:
Trailing Take Profit: Trailing Take Profit is where once your Target Profit Percent has been hit, this will trail up to attempt to claim even more profit.
Target Profit Percent: What is your Target Profit Percent? The Strategy will close all positions when the close price is greater than your DCA * this Target Profit Percent.
Grid Settings:
Stack Grid Purchases: If a close goes through multiple Buy Grids in one bar, should we amplify its purchase amount based on how many grids it went through?
Reset Grids if no purchase happens after X Bars: Set this to 0 if you never want to reset. This is very useful in case the price is very bullish and continues to increase after our Target Profit location is hit. What may happen is, Target Profit location is hit, then the Entry condition is met but the price just keeps increasing afterwards. We may not want to be sitting waiting for the price to drop, which may never happen. This is more of a failsafe if anything. You may set it very large, like 500+ if you only want to use it in extreme situations.
Grid % Less than Initial Purchase Price: How big should our Buy Grid be? For instance if we bought at 0.25 and this value is set to 20%, that means our Buy Grid spans from 0.2 - 0.25.
Grid Amounts: How many Grids should we create within our Buy location?
Martingale Settings:
Amount of Times 'Planned' to Martingale: The more Grids + the More Martingales = the less $ spent per grid, however the less risk. Remember it may be better to be right and take your time than risk too much and be stuck too long.
Martingale Percent: When the current price is this percent less than our DCA, lets create another Buy Grid so we can lower our average more. This will make our profit location less.
Webhook Alerts:
Webhook Alert Type: How should we format this Alert? 3Commas and OKX take their alerts differently, so please select the proper one or your webhooks won't work.
3Commas Webhook Alerts:
3Commas Bot ID: The 3Commas Bot ID is needed so we know which BOT ID we are sending this webhook too.
3Commas Email Token: The 3Commas Email Token is needed for your webhooks to work properly as it is linked to your account.
OKX Webhook Alerts:
OKX Signal Token: This Signal Token is attached to your OKX bot and will be used to access it within OKX.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
TENKAN SCALPER STRATEGYTENKAN SCALP is a fully automatic trading system.
It is a continuation of our previous ichimoku release. This time however we throw out the rule book and use ICHIMOKU in a very different way.
It applies non traditional money management tactics.
While most trading strategies rely on a stop loss and a take profit target to manage risk. This strategy uses either no stop loss at all or a time based stop loss.
You might ask yourself the question why would you keep a trade open if it goes against you? Here are a phew reasons why the script does what it does.
Forex Markets consolidate most of the time. If you wait long enough your Take Profit will get hit anyways most of the time
You don't have to risk everything per trade. I keep my orders small so to keep some powder to get into some more trades
All the extra trades you take while one trade is in drawdown limit the drawdown as they provide cashflow
On lower timeframes the markets are so chaotic that a stop loss is very likely to get hit by a wick
About backtest below
This backtest uses a spread of 2 pips for entries and a default position size of 100% of equity. This is only possible on exchanges where spread is low and you have 10:1 leverage or more. It does not represent results obtainable without leverage. Do take into account that there are a lot of forex exchanges that provide this leverage, however a 2 pip spread is not always guaranteed and only applies to major pairs.
This backtest does not use the TIME BASED STOPS functionality.
Always start with small position sizing and see how the strategy performs before adding risk.
Explanation of variables:
Chikou(lagging span): pink line, this is price plotted 26 bars ago. People ignore the power of this it is crucial to see how chikou behaves towards past price action as seen in the chart below where we got an entry at red arrow because chikou bounced from past fractal bottom.
Kijun-Sen(base line): Black line or color coded line. This is the equilibrium of last 26 candles. To me this is the most important line in the system as it attracts price.
Kijun = (Highest high of 26 periods + Lowest low of 26 periods) ÷ 2
Tenkan-Sen(conversion line): Blue line. This is the equilibrium of last 9 candles. In a strong uptrend price stays above this line.
Tenkan = (Highest high of 9 periods + Lowest low of 9 periods) ÷ 2
Senkou A (Leading span A)= Pink cloud line, this is the average of the 2 components projected 26 bars in the future.
Senkou A = (Tenkan + Kijun) ÷ 2
Senkou B (Leading span B) = Green cloud line, this is the 52 day equilibrium projected 26 bars in the future.
Senkou B = (Highest high of prior 52 periods + Lowest low of prior 52 periods) ÷ 2
projection: Script uses same function for variable calculation and substracts a number on each next bar as to make a projection of where the variable will be in future bars if price stayed the same. This works as ICHIMOKU calculations use the middle point of a past set of data. The shorter that amount of bars will be in line with the data that it will be restricted to in future if price stayed the same.
Detection of Market Environment
To enter trades the script uses a lot of ICHIMOKU concepts. Contrary to how most people trade ICHIMOKU this script takes an environment that ICHIMOKU identifies as trending upwards and shorts in that environment. The same will be applied to a downtrend where it will open LONGS.
List of CRITERIA for a trend:
Grapling Hook: this is a component based on the chikou span (closing price displaced 26 bars into the past). The script will use an ATR based range to define a possible future projection to the CHIKOU line. For a market to be bullish there should be no price action happening within this area. Market is free to move upwards. Vice versa for bearish .
Kumo Cloud: script will check if price is above the cloud for bullish trend and below cloud for bearish trend .
Chikou above Kijun: script will check if the chikou line is above the KIJUN line of 26 bars ago. This is further confirmation that price is trending high enough compared to it's past data. Vice versa for downtrend.
Kijun projection: script will check if past Kijun is lower than future projected Kijun. This to ensure we get an equilibrium in our favour in the future. Vice versa for downtrend
Tenkan projection: script will check if future Tenkan-sen will be higher than Kijun-sen for an uptrend. Vice versa for downtrend.
Cloud projection: script will check if in 9 bars the Senkou Span A will be higher than Senkou Span B for an uptrend. Vice versa for downtrend.
Example:
This script does not visualise the prediction lines like I show in the example. I show them here to clarify how the script works.
Usage
Backtests are not indicative of future results, although a trader may want to use a strategy script to have a deeper understanding of how their strategy responds to varying market conditions, or as a tool for identifying possible flaws for a strategy that may be indicative of good or bad performance in the future.
Strategy Settings:
Minimum Body Size (atr): this is the minimum ATR a signal bar needs to be for entry. This is useful because our TP is based on previous bar.
Lot size per trade: this setting does not impact backtest. It is used to for the signals to let tradingconnect.com know your position size.
Direction: do you want to trade longs or shorts. I personally use both a long bot and a short bot at the same time.
Positions Allowed: the amount of positions the script will keep open as a maximum. You do not want to open too many positions, this is for risk management.
Close all positions at drawdown: if total open positions loss gets to this % target it will close all positions.
MetaTrader Prefix: when the script sends a signal it will put this text right before the symbol name from syminfo.ticker
MetaTrader Suffix: when the script sends a signal it will put this text right after the symbol name from syminfo.ticker
Charts below are some examples on how the script handles orders on default settings:
without time based SL
with time based SL
how it handles pyramiding
www.tradingview.com
Tradingconnector.com:
For full automation of the forex market the script uses this connector to execute trade on MT4. The alerts the script sends using the alerts() function call are structured in a way tradingconnector will recognise and send directly to MT4. You can find documentation about this tool on their own website.
Personal recommendation is to start with a minimum lot size and track performance, if you are comfortable scale the size up. You can do that by increasing the lot size setting in the script and making a new alert. Make sure to delete the old one.
How to access
You can see the Author's Instructions below to visit our telegram to get more information on how to get access.
Heikin Ashi SupertrendAbout this Strategy
This supertrend strategy uses the Heikin Ashi candles to generate the supertrend but enters and exits trades using normal candle close prices. If you use the standard built in Supertrend indicator on Heikin Ashi candles, it will produce very unrealistic backtesting results because it uses the Heikin Ashi prices instead of the real prices. However, by signaling the supertrend reversals using Heikin Ashi while using standard candle close prices for the entries and exits, it corrects the backtesting errors and gives you a more realistic equity curve. You should set the chart to use standard candles and then hide them (the strategy creates the candles).
This strategy includes:
Plotting of Heikin Ashi candles
Heikin Ashi Supertrend
Long and Short Entry Signals
Move stop loss after trade is X% in profit
Profit Target
Stop Loss
Built in Alertatron automation
Alertatron Trade Automation Integration
For Alertatron integration, be sure to configure the strategy settings and "Enable Webhook Messages" before creating an alert with {{strategy.order.alert_message}} in the body of your alert message. Be sure to enable webhooks and point it to your Incoming Alertatron webhook URL.
Notes
While this strategy does pretty well during trending markets, It's worth noting that the Buy and Hold ROI is much better during peak times of the bull market
Not financial advice. Do not risk more than you can afford to lose.
SuperTrend Multi Time Frame Long and Short Trading Strategy
Hello All
This is non-repainting Supertrend Multi Time Frame script, I got so many request on Supertrend with Multi Time Frame. This is for all of them ..I am making it open for all so you can change its coding according to your need.
How the Basic Indicator works
SuperTrend is one of the most common ATR based trailing stop indicators.
In this version you can change the ATR calculation method from the settings. Default method is RMA.
The indicator is easy to use and gives an accurate reading about an ongoing trend. It is constructed with two parameters, namely period and multiplier. The default values used while constructing a Supertrend indicator are 10 for average true range or trading period and three for its multiplier.
The average true range (ATR) plays an important role in 'Supertrend' as the indicator uses ATR to calculate its value. The ATR indicator signals the degree of price volatility .
The buy and sell signals are generated when the indicator starts plotting either on top of the closing price or below the closing price. A buy signal is generated when the ‘Supertrend’ closes above the price and a sell signal is generated when it closes below the closing price.
It also suggests that the trend is shifting from descending mode to ascending mode. Contrary to this, when a ‘Supertrend’ closes above the price, it generates a sell signal as the colour of the indicator changes into red.
A ‘Supertrend’ indicator can be used on spot, futures, options or forex, or even crypto markets and also on daily, weekly and hourly charts as well, but generally, it fails in a sideways-moving market.
How the Strategy works
This is developed based on SuperTrend.
Use two time frame for confirm all entry signals.
Two time frame SuperTrend works as Trailing stop for both long and short positions.
More securely execute orders, because it is wait until confine two time frames(example : daily and 30min)
Each time frame developed as customisable for user to any timeframe.
User can choose trading position side from Long, Short, and Both.
Custom Stop Loss level, user can enter Stop Loss percentage based on timeframe using.
Multiple Take Profit levels with customisable TP price percentage and position size.
Back-testing with custom time frame.
This strategy is develop for specially for automation purpose.
The strategy includes:
Entry for Long and Short.
Take Profit.
Stop Loss.
Trailing Stop Loss.
Position Size.
Exit Signal.
Risk Management Feature.
Backtesting.
Trading Alerts.
Use the strategy with alerts
This strategy is alert-ready. All you have to do is:
Go on a pair you would like to trade
Create an alert
Select the strategy as a Trigger
Wait for new orders to be sent to you
This is develop for specially for automating trading on any exchange, if you need to get that automating service for this strategy or any Tradingview strategy or indicator please contact me I am have 8 year experience on that field.
I hope you enjoy it!
Thanks,
Ranga
Trailing Stop SnippetThis is an example snippet that should allow for adding a trailing stop and trailing stop activation to almost any script.
You can use it by setting a trailing stop alone. This will provide you standard trailing stop functionality allowing you to lock in profits and increase your stop-loss as the price moves in your direction.
You can also set the trailing stop activation to trigger the original trailing stop at a certain level. "Once price rises 5%, set a trailing stop at break even". This would be set as 5 and 5 in the settings.
AlphaTrend For ProfitViewThis strategy is based on the AlphaTrend indicator by KivancOzbilgic A full description of this algorithm functionality may be found by clicking the linked image above.
Changes and/or additions:
It is now a backtestable strategy
Updated alert trigger logic
Easy integration with ProfitView to use this algorithm for automated trading
When you create an alert, and you are using ProfitView, select " alert() function calls only " as the condition option. If you would rather set your own custom alert message, select " Order fills only " instead.
There is a selectable setting in the options to trigger alert() function calls immediately, that you may use to see what text it will send.
EMA Stoch Strategy For ProfitViewThis strategy will enter positions when the set stochastic conditions are met, and uses the moving average to filter the direction of the trades (long/short). The background is used to illustrate the strength of the stochastic values.
The following is a step by step guide in order to automate the trading of the strategy with ProfitView:
In the indicator settings, set the desired stochastic and ema values, and the stochastic condition you want to use to enter a trade.
In the indicator, set which exchange, symbol, and account to execute trades on.
In the indicator, set the PV Alert names you intend to use. If you want to use the same names as provided in the pastebin below, you may set the three names to Market Long, Market Short, TP SL Hit.
In PV, create two new PV Alerts in the PV Alert tab in accordance to these specifics pastebin.com .
On the Tradingview chart you want the indicator run on, create a new TV alert with this script as its condition, and specify the alert to "alert() function calls only".
DCA Bot for ProfitViewThe base for this strategy is the "Backtesting 3commas DCA Bot v2" script by rouxam. I have made some additions, edits, and fixes, as well as tailored it for usage with ProfitView.
The strategy works in such a way that you select one or multiple rules together, in order to determine when a trade should be initiated.
The selectable rules are:
RSI-7: Initiate trading when the 7 period RSI goes below a specified threshold.
Technicals: This is essentially the TradingView screener strength. A multitude of technical indicators combined that range from Strong Sell - Sell - Buy - Strong Buy.
QFL: Find a support/resistance line on a specified timeframe, and initiate trading only when the price is below a certain point from this line.
Once the deal start rule is met, trading will initiate, and a series of additional orders will be placed and spaced out according to the order settings set in the indicator. These orders includes Take Profit, Stoploss, Trailing Take Profit, and specified additional entry orders to DCA your way into a position.
The indicator is set up so that by hooking this up to ProfitView, all of the signals should automatically be replicated to your assigned exchange, along with discord/telegram notifications for when the deals start and end, and the resulting pnl.
If you want to use it for spot markets, while technically possible, you will need to significantly edit the PV Alert syntax that i have supplied below.
Run this on your testnet of choice, it is likely that there are undiscovered issues at this point.
The strategy currently only works with 'Longs' at the time of publishing, but may be subject to change.
==ProfitView Setup==
!!Important!!
The assigned PV Alert name must contain the keyword 'Long', fex "DCA Long"
Uncheck the Once per Bar advanced filter option on the PV Alert you use for this.
Copy/Paste the text into the PV Alert: pastebin.com
SuperTrend Multiple Risk Management SystemThis is an improved SuperTrend strategy that makes use of multiple types of risk management options.
We have for example :
1. Take profit and stop loss levels based on support and resistence created with RSI and Pivot Lines(dynamic)
For example, if we have an oversold level and a pivot low , we can take that low point for support.(or resistence for short)
If instead we have an overbought level and a pivot high, we can take that high point for resistence.(orsupport for short)
2. Take profit and stop loss levels based on swing low and swing high points calculated with highest high and lowest low function(dynamic)
For example we take the lowest point in the last 100 candles. We calculate the distance from the current point to that one, and we apply this value as a take profit point. Same for stop loss
3. Take profit and stop loss levels based on % movements(fixed)
For example we have a tp or sl of 10%. If either of them make a movement of 10% from the entry point, they will get triggered.
4. Break even stop loss once the asset moves certain % in our direction.
For example we have a long breakeven of 5%. If the asset moves 5% in our direction, we move the stop loss on the entry point so if the trade pullback and crosses with this point it will exit from the trade.
Notes:
All the exits from the strategy are happening at the end of the candle close, since we are checking if inside the current candle we cross with either high or low of the candles parts the set prices from any of the above options.
At the same time we can combine multiple of them into one, and we can either exit based on which one was hit first, or use a quantity reduction of the trade and exit multiple times when we hit any of the levels.
This tool is for educational purpose only.
Its main purpose is to show the difference between having a risk management or without.
For example on this scenario of BTC USD 4h, I found out that the drawdawn was reduced by more than half when using different type of risk management, compared to not use one at all, while at the same time increasing the profits by a huge margin.
RSI Rising Crypto Trending StrategyThis is crypto and stock market trending strategy designed for long timeframes such as 4h+
From my tests it looks like it works better to trade crypto against crypto than trading against fiat.
Indicators used:
RSI for rising/falling of the trend
BB sidemarket
ROC sidemarket
Rules for entry
For long: RSI values are rising, and bb and roc tells us we are not in a sidemarket
For long: RSI values are falling, and bb and roc tells us we are not in a sidemarket
Rules for exit
We exit when we receive an opposite direction.
Cuation: Because this strategy uses no risk management, I recommend you takje care with it.
If you have any questions, let me know !
Crypto Scalper Divergence Macd Psar Ema 200This is a very efficient crypto scalper adapted to very short timeframes, however it can be optimized for other timeframes and assests as well.
Its components are
MACD
P SAR
EMA 200
Risk management
Rules for entry:
For short : we have an uptrend on PSAR , histogram is positive (divergence MACD) and close of a candle is below EMA 200
For long : we dont have an uptrend on PSAR, histogram is negative(divergence MACD) and close of a candle is above EMA 200
Rules for exit:
We exit when we either find a reverse condition than the entry one, or based on stop loss/take profit that are calculated on % movements of the price.
If you have any questions, let me know !
High/Low Channel Multi averages Crypto Swing strategyThis is a swing strategy designed for trending markets such as crypto and stock, with big timeframes , like 8h.
For this strategy we take SMA, EMA, VWMA, ALMA, SMMA, LSMA and VWMA and make an apply them all to both HIGH and LOW separately and make 2 averages, 1 applied to high and the other applied to low.
With them we make a channel.
Rules for entry
For long: close of a candle is above avg applied to high.
For short: close of a candle is below avg applied to low.
Rules for exit
We exit when we either hit TP or SL or when we receive a different condition than the entry one.(long- > short and viceversa)
If you have any questions, let me know !
3 RSI 6sma/ema ribbon crypto strategyThis is a very efficient swing trading strategy designed for crypto long timeframes like 2h+.
Initially we have 3 RSI .
AFter that we use them as source for 6 SMA/EMA for each RSI, 5, 30, 50, 70, 90, 100. With those we create a ribbon that we are going to use in order to check the direction of the trend.
Rules for entry:
For long : if either all the SMA/EMA's from the 2nd RSI are telling us to go long, or all the all SMA/EMA's from the 3rd rsi are telling us to go long F
For short : if either all the SMA/EMA's from the 2nd RSI are telling us to go short, or all the all SMA/EMA's from the 3rd rsi are telling us to go short
We exit when we get an opposite condition than the entry one.
Caution: this strategy has no risk management inside, so use it with caution. If you have any questions , let me know !
BTC Candle Correlation Strategy This is a special strategy adapted for crypto market, which instead of using the current chart candles, we use inside calculation a candle from different charts.
For best usage I recommend a big timeframe like 1-4h+.
In this case we take the high, low, open and close candles from different brokers for BTC, and with it we form up the candle that we are going to use for the logic of entry.
At the same time we are going to create an upper and lower bands using a moving average and the difference between high and low.
So in a way to put it, if BTC triggers a sell or buy order, we input instead these orders on the current chart, like in this example with ETH.
Rules for entry
For long : if we have a crossover of the btc source value with the upper band .
For short: if we have a crossunder of the btc source vale with the lower band.
For exit, we do it when we receive a different signal than the initial one.
This strategy does not have any other risk management inside, so use it with caution.
If you have any other questions, let me know !
Scalp - 50/200 EMAWorks on any timeframe but was built originally for scalping. Uses 50EMA and 200EMA to define the trend and touch backs on to the 50 EMA for entry.
200 EMA - White Line
50 EMA - Yellow Line
ATR: Length 14 Smoothing RMA
1. Wait for 50ema to crossover 200 ema – Then wait for candle to touch 50 ema after the cross.
2. Entry: Green candle that closes above 50 ema without getting more than 3 candles closing below(BUY) or above (SELL) 50ema.
3. Stop loss: 2x ATR value below entry candle.
4. Take profit: 1.5x the risk.
Settings allow for # of Entries allowed per trend as well as EMA periods.
Opposite for Sell Entries (Stop Loss: 2x ATR value above entry candle)
Companion::InsurgentCompanion::Insurgent is a combined indicators strategy. Performances are pretty good on 1D, 4H and 1H timeframes and it can be used on Bitcoin and Altcoin markets.
Mainly, it is a trategy based on Ehlers formulas.
Used indicators:
- Ehlers Instantaneous Trend: trendline analysis;
- Ehlers Super Bandpass Filter: momentum detection;
- EMA: Long/Short time selector.
What the script does:
- determines trendlines combining mulitple indicators;
- automaticlally calculates Take profit and Stop Loss levels;
- permits automation generating Autoview signals (create an alert with {{strategy.order.alert_message}} in message text field to trap Autoview commands;
- supports for margin trading. Spot trading will be added in the future.
BACKTESTING
Backtest is not leveraged. Defaults are set as follow:
Capital: 10000
Percent of equity used for trades: 10%
Commission: 0.18% this is Bitfinex commission on orders
Change them accordingly on how you trade to get a more realistic backtest results.