INVITE-ONLY SCRIPT
已更新

Flux Charts - SFX Automation

1 599
💎 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 ;
  1. 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.
  2. 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.
  3. 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
  1. Each condition has a step number, and conditions are in topological order based on them.
  2. 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.
  3. 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 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 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 :

  1. 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.
  2. We buy 1 contract when the price is $100.
  3. When the price becomes $110, we are in $10 (10 ticks) profit and the trailing stop is now activated.
  4. The current price our stop's on is $110 - $30 (30 ticks), which is the level of $80.
  5. The trailing stop will only move if the price moves up the highest high the price has been after we entered the position.
  6. 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.
  7. 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


  1. First, the strategy needs to detect a Buy Signal with any star rating in order to start working.
  2. 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.
  3. 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: tradingview.com/support/solutions/43000531021-how-to-use-a-variable-value-in-alert/

快照

⚙️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.
發行說明
PROPERTIES TAB
The strategy properties tab in the settings modal is an important aspect for backtesting results & strategy automation. We suggest all traders to enter realistic values to these inputs aligned with their trading platforms and conditions. The charts in this write-up use these settings & properties :

⚙️ Algorithm Settings
Sensitivity -> 50
Signal Strength -> 25
Time Weighting -> Recent Trends
Minimum Star Rating -> 1

Entry Conditions
Long Condition -> Buy Any☆ (Step 1)
Exit On Opposite Signal -> Enabled.

Short Condition -> Sell Any☆ (Step 1)
Exit On Opposite Signal -> Enabled.

🔢 Strategy Conditions
Initial Capital -> 100,000
Base Currency -> Default
Order Size -> 1 Contract
Pyramiding -> 1
Commission -> 0.25%
Verify price for limit orders: 0 Ticks
Slippage -> 2 Ticks
Margin for long positions -> 0%
Margin for short positions -> 0%

Note that default properties may vary so the indicator works on all tickers initially without problems. It's suggested that the trader adjusts them depending on the platform. Also, backtests.

Also note: Backtesting does NOT guarantee future results and should be used as a tool for evaluating past market behavior under specific conditions. Market dynamics, liquidity, and unforeseen events can impact live trading performance, making it essential to combine backtesting with real-time analysis and risk management.
發行說明
  • Various Optimizations

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。