Original Bravo SwingThe Bravo Swing is based on the methods taught by YouTube celebrity J Bravo.
It uses the 9 day moving average as a base for selecting optimal entry and exit points.
Buy indicator:
A full candle closing above the 9 day moving average generally indicates a bullish signal for an entry.
If conditions are right, this can be seen as a great opportunity to buy.
Sell indicator:
If the candles continue to close above the 9 day moving average, the trend appears to remain bullish.
However, an exit is to be considered once a candle closes below the 9 day moving average, as this indicates a bearish signal may be approaching.
If you you're feeling confident about the uptrend continuing and choose to ignore the exit signal, a candle close below the 20 day exponential moving average should be used as a definite exit point.
Options:
Color code option to display the 180 day moving average in gray during downtrends and white during an uptrend.
The 50 day moving average can be turned on to help better visualize conflicting trends.
Cerca negli script per "entry"
Average True Range BandsAverage True Range Bands
The 30-day Average True Range is useful in Futures and Forex trading for placing stop orders for entry.
In the example above, a trader may want to initiate a Short position on a break below the support trendline.
A good place to enter this trade would be a price break below the support trendline minus 50 to 100% of the current ATR value.
ATR Bands provides a useful visual overlay of the current ATR value above and below the current price to speed up order entry decisions.
ScalpyScalpy is made up of a 2 main parts.
- The cloud comprising of a 10 period SMA and a 30 period SMA.
- When the cloud is green you should be looking for long entries.
- When the cloud is red you should be looking for short entries.
- Price is most bullish above a green cloud and most bearish below a red cloud.
- Being within the cloud indicates indecision.
The blue and white lines on the indicator show the relationship between price and momentum.
They can be used to spot reversals in two ways:
- The first is a divergence between price (blue line) and RSI (white line)
- If the price makes a lower low but the RSI makes a higher low this shows the trend is weakening and may be reversing soon (as can be seen by the two yellow lines on the chart).
The second is a simple crossover:
- When the white line crosses the blue line to the upside this signals a long entry.
- When the white line crosses the blue line to the downside this signals a short entry.
Study for Squeeze Momentum Indicator [LazyBear]This study is based on LazyBear Squeeze Momentum Indicator and my strategy developed using it.
I added some custom feature and filters.
Main improvements are:
1- study is updated to version 4 of pine script;
2- I added alerts for entry rules and exit rules.
3- Alert syntax can be customized for webhooks: I added one example only for long entry.
You can customize a lot of features to get a profitable strategy.
Here is a link to original study.
Please use comment section for any feedback.
DW-RSI EMA with EMA of RSIThis is an RSI Oscillator with an EMA of the RSI for a signal line. The RSI line is Green when above the signal line and Red when below the signal line.
This does not use the traditional 30% / 70% over sold / over bought analysis. Therefore the levels are not shown.
The analysis is this:
When the RSI is above the signal line then price has a bullish bias.
When the RSI is below the signal line then price has a bearish bias.
I wrote use this for Forex Spot Currencies where I feel overbought and oversold may be less valid than it may be in other markets such as stocks.
As with all indicators, do not use as your sole reason to enter the market, but use with other indicators or price action signals to get a confluence of signals to confirm your entry.
I use it with an 8, 21 and 50 EMA to confirm entry and exit. I give it more weight for exits than I do for entries.
PPO Divergence and Aggregate Signal ComboThis is a further development of the last two posts on aggregated signal generation. It shows how to implement the idea in conjunction with another indicator. In this case general rule for long and short entry: the aggregated curve (gray) must cross the mid-line. Colored columns serve as an early warning. Settings were tested with EURUSD in 5m, 30m and 1H TFs.
On Balance Volume +This is the standard On Balance Volume indicator, with the addition of four things:
10-SMA
20-SMA
100-SMA
Bollinger Bands
I have found intriguing and surprising results with this indicator.
I often see OBV bouncing off of the Moving Average lines, much like support and resistance points.
More interesting is the fact that it "obeys" the bollinger bands. Often times, if OBV sneaks outside of the Bollinger Band, it will almost always correct and get back in the next day.
I would recommend that you find your own method, and PLEASE post in the comments as to how you use this, but I'll tell you
How I use this indicator:
I usually use this on the daily view. I tend to wait until OBV has moved above the red 20-Day SMA before considering an entry. Below that doesn't show enough positive volume for me to identify enough interest in the security. Once it breaks the red SMA, I'll look at other indicators for confirmation. If price is above the Bollinger Band up above, and my OBV is above Bollinger Band, I will not buy. Also, if MACD is dropping, or if the Stochastic RSI is pegged out in overbought land, I won't buy that either.
If, however, I'm seeing good stuff from Stochastic RSI, RSI, MACD, and price BB, then I'll take a long entry at that OBV + 20SMA crossover.
If I'm in a long position and I see a few signals like the OBV is above the BB, and price is above BB, and StochRSI or RSI are in/near overbought land, I'll often sell that day, expecting a pullback on price.
I really like this one, it's been quite helpful in my trading. This is my first venture into using Volume for trading, and it's been good so far.
Leave me a note in the comments to tell me how it goes and how you use this thing!
Hoffman A/D BreakoutStudy based on Rob Hoffman's Accumulation/Distribution Breakout strategy.
- Green circle on the top wick indicates a "Distribution" wick
- Red circle on the bottom wick indicates an "Accumulation" wick
- A distribution wick in an uptrend gets marked as a Key Resistance. This is marked with green crosses
- An Accumulation wick in a downtrend gets marked as a Key Support. This is marked with red crosses
- Breaking above the Key Resistance indicates a buy entry. This is marked by a green background.
- Breaking below the Key Support indicates a sell entry. This is marked by a red background
Ichimoku-Hausky_v2.1Made a little update to my trading system. This system is made so that you can easily follow the trend and know when to get out. You still have to know basic market structure to find a good entry.
NB!! I see that i placed the entry wrong on the example, you have too wait for the EMA to go below the MA :)
I have posted the right one at the bottom.
Take profit can be set at last low or you can use trail stop on the EMA, MA, Kijun-sen or Tenkan-sen.
Example rules:
Buy:
IF Market is in a trend or are possibly close to break out of range
THEN see if price has closed above cloud
IF price has closed above cloud
THEN see if EMA has crossed above MA
IF EMA has crossed above MA
THEN buy or wait for pullback
Sell:
IF Market is in a trend or are possibly close to break out of range
THEN see if price has closed below cloud
IF price has closed below cloud
THEN see if EMA has crossed below MA
IF EMA has crossed below MA
THEN buy or wait for pullback
Vervoort Heiken-Ashi LongTerm Candlestick Oscillator [LazyBear]HACOLT (Heikin Ashi Candles Oscillator Long Term) is a technical indicator designed by Sylvain Vervoort. It is based on Mr.Vervoort's other indicator, HACO (Heikin-Ashi Candles Oscillator - posted here: ).
Optimized for long-term trading, HACOLT shows three levels: -1, 0 and 1. These levels suggest "an open short position", "no open position", and "an open long position", respectively. Passing from a certain level to another is viewed as a trading signal:
- Rising from -1 or 0 to 1 suggests a Long Entry and Short exit;
- Falling from 1 to 0 or -1 suggests a Long Exit;
- Falling from 1 or 0 to -1 indicates a Short Entry.
Fits in nicely with any trading setup as a confirmation indicator
More info:
- tlc.thinkorswim.com
- www.motivewave.com
List of my other indicators:
- GDoc: docs.google.com
- Chart:
Backtesting & Trading Engine [PineCoders]The PineCoders Backtesting and Trading Engine is a sophisticated framework with hybrid code that can run as a study to generate alerts for automated or discretionary trading while simultaneously providing backtest results. It can also easily be converted to a TradingView strategy in order to run TV backtesting. The Engine comes with many built-in strats for entries, filters, stops and exits, but you can also add you own.
If, like any self-respecting strategy modeler should, you spend a reasonable amount of time constantly researching new strategies and tinkering, our hope is that the Engine will become your inseparable go-to tool to test the validity of your creations, as once your tests are conclusive, you will be able to run this code as a study to generate the alerts required to put it in real-world use, whether for discretionary trading or to interface with an execution bot/app. You may also find the backtesting results the Engine produces in study mode enough for your needs and spend most of your time there, only occasionally converting to strategy mode in order to backtest using TV backtesting.
As you will quickly grasp when you bring up this script’s Settings, this is a complex tool. While you will be able to see results very quickly by just putting it on a chart and using its built-in strategies, in order to reap the full benefits of the PineCoders Engine, you will need to invest the time required to understand the subtleties involved in putting all its potential into play.
Disclaimer: use the Engine at your own risk.
Before we delve in more detail, here’s a bird’s eye view of the Engine’s features:
More than 40 built-in strategies,
Customizable components,
Coupling with your own external indicator,
Simple conversion from Study to Strategy modes,
Post-Exit analysis to search for alternate trade outcomes,
Use of the Data Window to show detailed bar by bar trade information and global statistics, including some not provided by TV backtesting,
Plotting of reminders and generation of alerts on in-trade events.
By combining your own strats to the built-in strats supplied with the Engine, and then tuning the numerous options and parameters in the Inputs dialog box, you will be able to play what-if scenarios from an infinite number of permutations.
USE CASES
You have written an indicator that provides an entry strat but it’s missing other components like a filter and a stop strategy. You add a plot in your indicator that respects the Engine’s External Signal Protocol, connect it to the Engine by simply selecting your indicator’s plot name in the Engine’s Settings/Inputs and then run tests on different combinations of entry stops, in-trade stops and profit taking strats to find out which one produces the best results with your entry strat.
You are building a complex strategy that you will want to run as an indicator generating alerts to be sent to a third-party execution bot. You insert your code in the Engine’s modules and leverage its trade management code to quickly move your strategy into production.
You have many different filters and want to explore results using them separately or in combination. Integrate the filter code in the Engine and run through different permutations or hook up your filtering through the external input and control your filter combos from your indicator.
You are tweaking the parameters of your entry, filter or stop strat. You integrate it in the Engine and evaluate its performance using the Engine’s statistics.
You always wondered what results a random entry strat would yield on your markets. You use the Engine’s built-in random entry strat and test it using different combinations of filters, stop and exit strats.
You want to evaluate the impact of fees and slippage on your strategy. You use the Engine’s inputs to play with different values and get immediate feedback in the detailed numbers provided in the Data Window.
You just want to inspect the individual trades your strategy generates. You include it in the Engine and then inspect trades visually on your charts, looking at the numbers in the Data Window as you move your cursor around.
You have never written a production-grade strategy and you want to learn how. Inspect the code in the Engine; you will find essential components typical of what is being used in actual trading systems.
You have run your system for a while and have compiled actual slippage information and your broker/exchange has updated his fees schedule. You enter the information in the Engine and run it on your markets to see the impact this has on your results.
FEATURES
Before going into the detail of the Inputs and the Data Window numbers, here’s a more detailed overview of the Engine’s features.
Built-in strats
The engine comes with more than 40 pre-coded strategies for the following standard system components:
Entries,
Filters,
Entry stops,
2 stage in-trade stops with kick-in rules,
Pyramiding rules,
Hard exits.
While some of the filter and stop strats provided may be useful in production-quality systems, you will not devise crazy profit-generating systems using only the entry strats supplied; that part is still up to you, as will be finding the elusive combination of components that makes winning systems. The Engine will, however, provide you with a solid foundation where all the trade management nitty-gritty is handled for you. By binding your custom strats to the Engine, you will be able to build reliable systems of the best quality currently allowed on the TV platform.
On-chart trade information
As you move over the bars in a trade, you will see trade numbers in the Data Window change at each bar. The engine calculates the P&L at every bar, including slippage and fees that would be incurred were the trade exited at that bar’s close. If the trade includes pyramided entries, those will be taken into account as well, although for those, final fees and slippage are only calculated at the trade’s exit.
You can also see on-chart markers for the entry level, stop positions, in-trade special events and entries/exits (you will want to disable these when using the Engine in strategy mode to see TV backtesting results).
Customization
You can couple your own strats to the Engine in two ways:
1. By inserting your own code in the Engine’s different modules. The modular design should enable you to do so with minimal effort by following the instructions in the code.
2. By linking an external indicator to the engine. After making the proper selections in the engine’s Settings and providing values respecting the engine’s protocol, your external indicator can, when the Engine is used in Indicator mode only:
Tell the engine when to enter long or short trades, but let the engine’s in-trade stop and exit strats manage the exits,
Signal both entries and exits,
Provide an entry stop along with your entry signal,
Filter other entry signals generated by any of the engine’s entry strats.
Conversion from strategy to study
TradingView strategies are required to backtest using the TradingView backtesting feature, but if you want to generate alerts with your script, whether for automated trading or just to trigger alerts that you will use in discretionary trading, your code has to run as a study since, for the time being, strategies can’t generate alerts. From hereon we will use indicator as a synonym for study.
Unless you want to maintain two code bases, you will need hybrid code that easily flips between strategy and indicator modes, and your code will need to restrict its use of strategy() calls and their arguments if it’s going to be able to run both as an indicator and a strategy using the same trade logic. That’s one of the benefits of using this Engine. Once you will have entered your own strats in the Engine, it will be a matter of commenting/uncommenting only four lines of code to flip between indicator and strategy modes in a matter of seconds.
Additionally, even when running in Indicator mode, the Engine will still provide you with precious numbers on your individual trades and global results, some of which are not available with normal TradingView backtesting.
Post-Exit Analysis for alternate outcomes (PEA)
While typical backtesting shows results of trade outcomes, PEA focuses on what could have happened after the exit. The intention is to help traders get an idea of the opportunity/risk in the bars following the trade in order to evaluate if their exit strategies are too aggressive or conservative.
After a trade is exited, the Engine’s PEA module continues analyzing outcomes for a user-defined quantity of bars. It identifies the maximum opportunity and risk available in that space, and calculates the drawdown required to reach the highest opportunity level post-exit, while recording the number of bars to that point.
Typically, if you can’t find opportunity greater than 1X past your trade using a few different reasonable lengths of PEA, your strategy is doing pretty good at capturing opportunity. Remember that 100% of opportunity is never capturable. If, however, PEA was finding post-trade maximum opportunity of 3 or 4X with average drawdowns of 0.3 to those areas, this could be a clue revealing your system is exiting trades prematurely. To analyze PEA numbers, you can uncomment complete sets of plots in the Plot module to reveal detailed global and individual PEA numbers.
Statistics
The Engine provides stats on your trades that TV backtesting does not provide, such as:
Average Profitability Per Trade (APPT), aka statistical expectancy, a crucial value.
APPT per bar,
Average stop size,
Traded volume .
It also shows you on a trade-by-trade basis, on-going individual trade results and data.
In-trade events
In-trade events can plot reminders and trigger alerts when they occur. The built-in events are:
Price approaching stop,
Possible tops/bottoms,
Large stop movement (for discretionary trading where stop is moved manually),
Large price movements.
Slippage and Fees
Even when running in indicator mode, the Engine allows for slippage and fees to be included in the logic and test results.
Alerts
The alert creation mechanism allows you to configure alerts on any combination of the normal or pyramided entries, exits and in-trade events.
Backtesting results
A few words on the numbers calculated in the Engine. Priority is given to numbers not shown in TV backtesting, as you can readily convert the script to a strategy if you need them.
We have chosen to focus on numbers expressing results relative to X (the trade’s risk) rather than in absolute currency numbers or in other more conventional but less useful ways. For example, most of the individual trade results are not shown in percentages, as this unit of measure is often less meaningful than those expressed in units of risk (X). A trade that closes with a +25% result, for example, is a poor outcome if it was entered with a -50% stop. Expressed in X, this trade’s P&L becomes 0.5, which provides much better insight into the trade’s outcome. A trade that closes with a P&L of +2X has earned twice the risk incurred upon entry, which would represent a pre-trade risk:reward ratio of 2.
The way to go about it when you think in X’s and that you adopt the sound risk management policy to risk a fixed percentage of your account on each trade is to equate a currency value to a unit of X. E.g. your account is 10K USD and you decide you will risk a maximum of 1% of it on each trade. That means your unit of X for each trade is worth 100 USD. If your APPT is 2X, this means every time you risk 100 USD in a trade, you can expect to make, on average, 200 USD.
By presenting results this way, we hope that the Engine’s statistics will appeal to those cognisant of sound risk management strategies, while gently leading traders who aren’t, towards them.
We trade to turn in tangible profits of course, so at some point currency must come into play. Accordingly, some values such as equity, P&L, slippage and fees are expressed in currency.
Many of the usual numbers shown in TV backtests are nonetheless available, but they have been commented out in the Engine’s Plot module.
Position sizing and risk management
All good system designers understand that optimal risk management is at the very heart of all winning strategies. The risk in a trade is defined by the fraction of current equity represented by the amplitude of the stop, so in order to manage risk optimally on each trade, position size should adjust to the stop’s amplitude. Systems that enter trades with a fixed stop amplitude can get away with calculating position size as a fixed percentage of current equity. In the context of a test run where equity varies, what represents a fixed amount of risk translates into different currency values.
Dynamically adjusting position size throughout a system’s life is optimal in many ways. First, as position sizing will vary with current equity, it reproduces a behavioral pattern common to experienced traders, who will dial down risk when confronted to poor performance and increase it when performance improves. Second, limiting risk confers more predictability to statistical test results. Third, position sizing isn’t just about managing risk, it’s also about maximizing opportunity. By using the maximum leverage (no reference to trading on margin here) into the trade that your risk management strategy allows, a dynamic position size allows you to capture maximal opportunity.
To calculate position sizes using the fixed risk method, we use the following formula: Position = Account * MaxRisk% / Stop% [, which calculates a position size taking into account the trade’s entry stop so that if the trade is stopped out, 100 USD will be lost. For someone who manages risk this way, common instructions to invest a certain percentage of your account in a position are simply worthless, as they do not take into account the risk incurred in the trade.
The Engine lets you select either the fixed risk or fixed percentage of equity position sizing methods. The closest thing to dynamic position sizing that can currently be done with alerts is to use a bot that allows syntax to specify position size as a percentage of equity which, while being dynamic in the sense that it will adapt to current equity when the trade is entered, does not allow us to modulate position size using the stop’s amplitude. Changes to alerts are on the way which should solve this problem.
In order for you to simulate performance with the constraint of fixed position sizing, the Engine also offers a third, less preferable option, where position size is defined as a fixed percentage of initial capital so that it is constant throughout the test and will thus represent a varying proportion of current equity.
Let’s recap. The three position sizing methods the Engine offers are:
1. By specifying the maximum percentage of risk to incur on your remaining equity, so the Engine will dynamically adjust position size for each trade so that, combining the stop’s amplitude with position size will yield a fixed percentage of risk incurred on current equity,
2. By specifying a fixed percentage of remaining equity. Note that unless your system has a fixed stop at entry, this method will not provide maximal risk control, as risk will vary with the amplitude of the stop for every trade. This method, as the first, does however have the advantage of automatically adjusting position size to equity. It is the Engine’s default method because it has an equivalent in TV backtesting, so when flipping between indicator and strategy mode, test results will more or less correspond.
3. By specifying a fixed percentage of the Initial Capital. While this is the least preferable method, it nonetheless reflects the reality confronted by most system designers on TradingView today. In this case, risk varies both because the fixed position size in initial capital currency represents a varying percentage of remaining equity, and because the trade’s stop amplitude may vary, adding another variability vector to risk.
Note that the Engine cannot display equity results for strategies entering trades for a fixed amount of shares/contracts at a variable price.
SETTINGS/INPUTS
Because the initial text first published with a script cannot be edited later and because there are just too many options, the Engine’s Inputs will not be covered in minute detail, as they will most certainly evolve. We will go over them with broad strokes; you should be able to figure the rest out. If you have questions, just ask them here or in the PineCoders Telegram group.
Display
The display header’s checkbox does nothing.
For the moment, only one exit strategy uses a take profit level, so only that one will show information when checking “Show Take Profit Level”.
Entries
You can activate two simultaneous entry strats, each selected from the same set of strats contained in the Engine. If you select two and they fire simultaneously, the main strat’s signal will be used.
The random strat in each list uses a different seed, so you will get different results from each.
The “Filter transitions” and “Filter states” strats delegate signal generation to the selected filter(s). “Filter transitions” signals will only fire when the filter transitions into bull/bear state, so after a trade is stopped out, the next entry may take some time to trigger if the filter’s state does not change quickly. When you choose “Filter states”, then a new trade will be entered immediately after an exit in the direction the filter allows.
If you select “External Indicator”, your indicator will need to generate a +2/-2 (or a positive/negative stop value) to enter a long/short position, providing the selected filters allow for it. If you wish to use the Engine’s capacity to also derive the entry stop level from your indicator’s signal, then you must explicitly choose this option in the Entry Stops section.
Filters
You can activate as many filters as you wish; they are additive. The “Maximum stop allowed on entry” is an important component of proper risk management. If your system has an average 3% stop size and you need to trade using fixed position sizes because of alert/execution bot limitations, you must use this filter because if your system was to enter a trade with a 15% stop, that trade would incur 5 times the normal risk, and its result would account for an abnormally high proportion in your system’s performance.
Remember that any filter can also be used as an entry signal, either when it changes states, or whenever no trade is active and the filter is in a bull or bear mode.
Entry Stops
An entry stop must be selected in the Engine, as it requires a stop level before the in-trade stop is calculated. Until the selected in-trade stop strat generates a stop that comes closer to price than the entry stop (or respects another one of the in-trade stops kick in strats), the entry stop level is used.
It is here that you must select “External Indicator” if your indicator supplies a +price/-price value to be used as the entry stop. A +price is expected for a long entry and a -price value will enter a short with a stop at price. Note that the price is the absolute price, not an offset to the current price level.
In-Trade Stops
The Engine comes with many built-in in-trade stop strats. Note that some of them share the “Length” and “Multiple” field, so when you swap between them, be sure that the length and multiple in use correspond to what you want for that stop strat. Suggested defaults appear with the name of each strat in the dropdown.
In addition to the strat you wish to use, you must also determine when it kicks in to replace the initial entry’s stop, which is determined using different strats. For strats where you can define a positive or negative multiple of X, percentage or fixed value for a kick-in strat, a positive value is above the trade’s entry fill and a negative one below. A value of zero represents breakeven.
Pyramiding
What you specify in this section are the rules that allow pyramiding to happen. By themselves, these rules will not generate pyramiding entries. For those to happen, entry signals must be issued by one of the active entry strats, and conform to the pyramiding rules which act as a filter for them. The “Filter must allow entry” selection must be chosen if you want the usual system’s filters to act as additional filtering criteria for your pyramided entries.
Hard Exits
You can choose from a variety of hard exit strats. Hard exits are exit strategies which signal trade exits on specific events, as opposed to price breaching a stop level in In-Trade Stops strategies. They are self-explanatory. The last one labelled When Take Profit Level (multiple of X) is reached is the only one that uses a level, but contrary to stops, it is above price and while it is relative because it is expressed as a multiple of X, it does not move during the trade. This is the level called Take Profit that is show when the “Show Take Profit Level” checkbox is checked in the Display section.
While stops focus on managing risk, hard exit strategies try to put the emphasis on capturing opportunity.
Slippage
You can define it as a percentage or a fixed value, with different settings for entries and exits. The entry and exit markers on the chart show the impact of slippage on the entry price (the fill).
Fees
Fees, whether expressed as a percentage of position size in and out of the trade or as a fixed value per in and out, are in the same units of currency as the capital defined in the Position Sizing section. Fees being deducted from your Capital, they do not have an impact on the chart marker positions.
In-Trade Events
These events will only trigger during trades. They can be helpful to act as reminders for traders using the Engine as assistance to discretionary trading.
Post-Exit Analysis
It is normally on. Some of its results will show in the Global Numbers section of the Data Window. Only a few of the statistics generated are shown; many more are available, but commented out in the Plot module.
Date Range Filtering
Note that you don’t have to change the dates to enable/diable filtering. When you are done with a specific date range, just uncheck “Date Range Filtering” to disable date filtering.
Alert Triggers
Each selection corresponds to one condition. Conditions can be combined into a single alert as you please. Just be sure you have selected the ones you want to trigger the alert before you create the alert. For example, if you trade in both directions and you want a single alert to trigger on both types of exits, you must select both “Long Exit” and “Short Exit” before creating your alert.
Once the alert is triggered, these settings no longer have relevance as they have been saved with the alert.
When viewing charts where an alert has just triggered, if your alert triggers on more than one condition, you will need the appropriate markers active on your chart to figure out which condition triggered the alert, since plotting of markers is independent of alert management.
Position sizing
You have 3 options to determine position size:
1. Proportional to Stop -> Variable, with a cap on size.
2. Percentage of equity -> Variable.
3. Percentage of Initial Capital -> Fixed.
External Indicator
This is where you connect your indicator’s plot that will generate the signals the Engine will act upon. Remember this only works in Indicator mode.
DATA WINDOW INFORMATION
The top part of the window contains global numbers while the individual trade information appears in the bottom part. The different types of units used to express values are:
curr: denotes the currency used in the Position Sizing section of Inputs for the Initial Capital value.
quote: denotes quote currency, i.e. the value the instrument is expressed in, or the right side of the market pair (USD in EURUSD ).
X: the stop’s amplitude, itself expressed in quote currency, which we use to express a trade’s P&L, so that a trade with P&L=2X has made twice the stop’s amplitude in profit. This is sometimes referred to as R, since it represents one unit of risk. It is also the unit of measure used in the APPT, which denotes expected reward per unit of risk.
X%: is also the stop’s amplitude, but expressed as a percentage of the Entry Fill.
The numbers appearing in the Data Window are all prefixed:
“ALL:” the number is the average for all first entries and pyramided entries.
”1ST:” the number is for first entries only.
”PYR:” the number is for pyramided entries only.
”PEA:” the number is for Post-Exit Analyses
Global Numbers
Numbers in this section represent the results of all trades up to the cursor on the chart.
Average Profitability Per Trade (X): This value is the most important gauge of your strat’s worthiness. It represents the returns that can be expected from your strat for each unit of risk incurred. E.g.: your APPT is 2.0, thus for every unit of currency you invest in a trade, you can on average expect to obtain 2 after the trade. APPT is also referred to as “statistical expectancy”. If it is negative, your strategy is losing, even if your win rate is very good (it means your winning trades aren’t winning enough, or your losing trades lose too much, or both). Its counterpart in currency is also shown, as is the APPT/bar, which can be a useful gauge in deciding between rivalling systems.
Profit Factor: Gross of winning trades/Gross of losing trades. Strategy is profitable when >1. Not as useful as the APPT because it doesn’t take into account the win rate and the average win/loss per trade. It is calculated from the total winning/losing results of this particular backtest and has less predictive value than the APPT. A good profit factor together with a poor APPT means you just found a chart where your system outperformed. Relying too much on the profit factor is a bit like a poker player who would think going all in with two’s against aces is optimal because he just won a hand that way.
Win Rate: Percentage of winning trades out of all trades. Taken alone, it doesn’t have much to do with strategy profitability. You can have a win rate of 99% but if that one trade in 100 ruins you because of poor risk management, 99% doesn’t look so good anymore. This number speaks more of the system’s profile than its worthiness. Still, it can be useful to gauge if the system fits your personality. It can also be useful to traders intending to sell their systems, as low win rate systems are more difficult to sell and require more handholding of worried customers.
Equity (curr): This the sum of initial capital and the P&L of your system’s trades, including fees and slippage.
Return on Capital is the equivalent of TV’s Net Profit figure, i.e. the variation on your initial capital.
Maximum drawdown is the maximal drawdown from the highest equity point until the drop . There is also a close to close (meaning it doesn’t take into account in-trade variations) maximum drawdown value commented out in the code.
The next values are self-explanatory, until:
PYR: Avg Profitability Per Entry (X): this is the APPT for all pyramided entries.
PEA: Avg Max Opp . Available (X): the average maximal opportunity found in the Post-Exit Analyses.
PEA: Avg Drawdown to Max Opp . (X): this represents the maximum drawdown (incurred from the close at the beginning of the PEA analysis) required to reach the maximal opportunity point.
Trade Information
Numbers in this section concern only the current trade under the cursor. Most of them are self-explanatory. Use the description’s prefix to determine what the values applies to.
PYR: Avg Profitability Per Entry (X): While this value includes the impact of all current pyramided entries (and only those) and updates when you move your cursor around, P&L only reflects fees at the trade’s last bar.
PEA: Max Opp . Available (X): It’s the most profitable close reached post-trade, measured from the trade’s Exit Fill, expressed in the X value of the trade the PEA follows.
PEA: Drawdown to Max Opp . (X): This is the maximum drawdown from the trade’s Exit Fill that needs to be sustained in order to reach the maximum opportunity point, also expressed in X. Note that PEA numbers do not include slippage and fees.
EXTERNAL SIGNAL PROTOCOL
Only one external indicator can be connected to a script; in order to leverage its use to the fullest, the engine provides options to use it as either an entry signal, an entry/exit signal or a filter. When used as an entry signal, you can also use the signal to provide the entry’s stop. Here’s how this works:
For filter state: supply +1 for bull (long entries allowed), -1 for bear (short entries allowed).
For entry signals: supply +2 for long, -2 for short.
For exit signals: supply +3 for exit from long, -3 for exit from short.
To send an entry stop level with an entry signal: Send positive stop level for long entry (e.g. 103.33 to enter a long with a stop at 103.33), negative stop level for short entry (e.g. -103.33 to enter a short with a stop at 103.33). If you use this feature, your indicator will have to check for exact stop levels of 1.0, 2.0 or 3.0 and their negative counterparts, and fudge them with a tick in order to avoid confusion with other signals in the protocol.
Remember that mere generation of the values by your indicator will have no effect until you explicitly allow their use in the appropriate sections of the Engine’s Settings/Inputs.
An example of a script issuing a signal for the Engine is published by PineCoders.
RECOMMENDATIONS TO ASPIRING SYSTEM DESIGNERS
Stick to higher timeframes. On progressively lower timeframes, margins decrease and fees and slippage take a proportionally larger portion of profits, to the point where they can very easily turn a profitable strategy into a losing one. Additionally, your margin for error shrinks as the equilibrium of your system’s profitability becomes more fragile with the tight numbers involved in the shorter time frames. Avoid <1H time frames.
Know and calculate fees and slippage. To avoid market shock, backtest using conservative fees and slippage parameters. Systems rarely show unexpectedly good returns when they are confronted to the markets, so put all chances on your side by being outrageously conservative—or a the very least, realistic. Test results that do not include fees and slippage are worthless. Slippage is there for a reason, and that’s because our interventions in the market change the market. It is easier to find alpha in illiquid markets such as cryptos because not many large players participate in them. If your backtesting results are based on moving large positions and you don’t also add the inevitable slippage that will occur when you enter/exit thin markets, your backtesting will produce unrealistic results. Even if you do include large slippage in your settings, the Engine can only do so much as it will not let slippage push fills past the high or low of the entry bar, but the gap may be much larger in illiquid markets.
Never test and optimize your system on the same dataset , as that is the perfect recipe for overfitting or data dredging, which is trying to find one precise set of rules/parameters that works only on one dataset. These setups are the most fragile and often get destroyed when they meet the real world.
Try to find datasets yielding more than 100 trades. Less than that and results are not as reliable.
Consider all backtesting results with suspicion. If you never entertained sceptic tendencies, now is the time to begin. If your backtest results look really good, assume they are flawed, either because of your methodology, the data you’re using or the software doing the testing. Always assume the worse and learn proper backtesting techniques such as monte carlo simulations and walk forward analysis to avoid the traps and biases that unchecked greed will set for you. If you are not familiar with concepts such as survivor bias, lookahead bias and confirmation bias, learn about them.
Stick to simple bars or candles when designing systems. Other types of bars often do not yield reliable results, whether by design (Heikin Ashi) or because of the way they are implemented on TV (Renko bars).
Know that you don’t know and use that knowledge to learn more about systems and how to properly test them, about your biases, and about yourself.
Manage risk first , then capture opportunity.
Respect the inherent uncertainty of the future. Cleanse yourself of the sad arrogance and unchecked greed common to newcomers to trading. Strive for rationality. Respect the fact that while backtest results may look promising, there is no guarantee they will repeat in the future (there is actually a high probability they won’t!), because the future is fundamentally unknowable. If you develop a system that looks promising, don’t oversell it to others whose greed may lead them to entertain unreasonable expectations.
Have a plan. Understand what king of trading system you are trying to build. Have a clear picture or where entries, exits and other important levels will be in the sort of trade you are trying to create with your system. This stated direction will help you discard more efficiently many of the inevitably useless ideas that will pop up during system design.
Be wary of complexity. Experienced systems engineers understand how rapidly complexity builds when you assemble components together—however simple each one may be. The more complex your system, the more difficult it will be to manage.
Play! . Allow yourself time to play around when you design your systems. While much comes about from working with a purpose, great ideas sometimes come out of just trying things with no set goal, when you are stuck and don’t know how to move ahead. Have fun!
@LucF
NOTES
While the engine’s code can supply multiple consecutive entries of longs or shorts in order to scale positions (pyramid), all exits currently assume the execution bot will exit the totality of the position. No partial exits are currently possible with the Engine.
Because the Engine is literally crippled by the limitations on the number of plots a script can output on TV; it can only show a fraction of all the information it calculates in the Data Window. You will find in the Plot Module vast amounts of commented out lines that you can activate if you also disable an equivalent number of other plots. This may be useful to explore certain characteristics of your system in more detail.
When backtesting using the TV backtesting feature, you will need to provide the strategy parameters you wish to use through either Settings/Properties or by changing the default values in the code’s header. These values are defined in variables and used not only in the strategy() statement, but also as defaults in the Engine’s relevant Inputs.
If you want to test using pyramiding, then both the strategy’s Setting/Properties and the Engine’s Settings/Inputs need to allow pyramiding.
If you find any bugs in the Engine, please let us know.
THANKS
To @glaz for allowing the use of his unpublished MA Squize in the filters.
To @everget for his Chandelier stop code, which is also used as a filter in the Engine.
To @RicardoSantos for his pseudo-random generator, and because it’s from him that I first read in the Pine chat about the idea of using an external indicator as input into another. In the PineCoders group, @theheirophant then mentioned the idea of using it as a buy/sell signal and @simpelyfe showed a piece of code implementing the idea. That’s the tortuous story behind the use of the external indicator in the Engine.
To @admin for the Volatility stop’s original code and for the donchian function lifted from Ichimoku .
To @BobHoward21 for the v3 version of Volatility Stop .
To @scarf and @midtownsk8rguy for the color tuning.
To many other scripters who provided encouragement and suggestions for improvement during the long process of writing and testing this piece of code.
To J. Welles Wilder Jr. for ATR, used extensively throughout the Engine.
To TradingView for graciously making an account available to PineCoders.
And finally, to all fellow PineCoders for the constant intellectual stimulation; it is a privilege to share ideas with you all. The Engine is for all TradingView PineCoders, of course—but especially for you.
Look first. Then leap.
Great Expectations [LucF]Great Expectations helps traders answer the question: What is possible? It is a powerful question, yet exploration of the unknown always entails risk. A more complete set of questions better suited to traders could be:
What opportunity exists from any given point on a chart?
What portion of this opportunity can be realistically captured?
What risk will be incurred in trying to do so, and how long will it take?
Great Expectations is the result of an exploration of these questions. It is a trade simulator that generates visual and quantitative information to help strategy modelers visually identify and analyse areas of optimal expectation on charts, whether they are designing automated or discretionary strategies.
WARNING: Great Expectations is NOT an indicator that helps determine the current state of a market. It works by looking at points in the past from which the future is already known. It uses one definition of repainting extensively (i.e. it goes back in the past to print information that could not have been know at the time). Repainting understood that way is in fact almost all the indicator does! —albeit for what I hope is a noble cause. The indicator is of no use whatsoever in analyzing markets in real-time. If you do not understand what it does, please stay away!
This is an indicator—not a strategy that uses TradingView’s backtesting engine. It works by simulating trades, not unlike a backtest, but with the crucial difference that it assumes a trade (either long or short) is entered on all bars in the historic sample. It walks forward from each bar and determines possible outcomes, gathering individual trade statistics that in turn generate precious global statistics from all outcomes tested on the chart.
Great Expectations provides numbers summarizing trade results on all simulations run from the chart. Those numbers cannot be compared to backtest-produced numbers since all non-filtered bars are examined, even if an entry was taken on the bar immediately preceding the current one, which never happens in a backtest. This peculiarity does NOT invalidate Great Expectations calculations; it just entails that results be considered under a different light. Provided they are evaluated within the indicator’s context, they can be useful—sometimes even more than backtesting results, e.g. in evaluating the impact of parameter-fitting or variations in entry, exit or filtering strats.
Traders and strategy modelers are creatures of hope often suffering from blurred vision; my hope is that Great Expectations will help them appraise the validity of their setup and strat intuitions in a realistic fashion, preventing confirmation bias from obstructing perspective—and great expectations from turning into financial great deceptions.
USE CASES
You’ve identified what looks like a promising setup on other indicators. You load Great Expectations on the chart and evaluate if its high-expectation areas match locations where your setup’s conditions occur. Unless today is your lucky day, chances are the indicator will help you realize your setup is not as promising as you had hoped.
You want to get a rough estimate of the optimal trade duration for a chart and you don’t mind using the entry and exit strategies provided with the indicator. You use the trade length readouts of the indicator.
You’re experimenting with a new stop strategy and want to know how long it will keep you in trades, on average. You integrate your stop strategy in the indicator’s code and look at the average trade length it produces and the TST ratio to evaluate its performance.
You have put together your own entry and exit criteria and are looking for a filter that will help you improve backtesting results. You visually ascertain the suitability of your filter by looking at its results on the charts with great Expectations, to see if your filter is choosing its areas correctly.
You have a strategy that shows backtested trades on your chart. Great Expectations can help you evaluate how well your strategy is benefitting from high-opportunity areas while avoiding poor expectation spots.
You want more complete statistics on your set of strategies than what backtesting will provide. You use Great Expectations, knowing that it tests all bars in the sample that correspond to your criteria, as opposed to backtesting results which are limited to a subset of all possible entries.
You want to fool your friends into thinking you’ve designed the holy grail of indicators, something that identifies optimal opportunities on any chart; you show them the P&L cloud.
FEATURES
For one trade
At any given point on the chart, assuming a trade is entered there, Great Expectations shows you information specific to that trade simulation both on the chart and in the Data Window.
The chart can display:
the P & L Cloud which shows whether the trade ended profitably or not, and by how much,
the Opportunity & Risk Cloud which the maximum opportunity and risk the simulation encountered. When superimposed over the P & L cloud, you will see what I call the managed opportunity and risk, i.e the portion of maximum opportunity that was captured and the portion of the maximum risk that was incurred,
the target and if it was reached,
a background that uses a gradient to show different levels of trade length, P&L or how frequently the target was reached during simulation.
The Data Window displays more than 40 values on individual trades and global results. For any given trade you will know:
Entry/Exit levels, including slippage impact,
It’s outcome and duration,
P/L achieved,
The fraction of the maximum opportunity/risk managed by the trade.
For all trades
After going through all the possible trades on the chart, the indicator will provide you with a rare view of all outcomes expressed with the P&L cloud, which allows us to instantly see the most/least profitable areas of a chart using trade data as support, while also showing its relationship with the opportunity/risk encountered during the simulation. The difference between the two clouds is the managed opportunity and risk.
The Data Window will present you with numbers which we will go through later. Some of them are: average stop size, P/L, win rate, % opportunity managed, trade lengths for different types of trade outcomes and the TST (Target:Stop Travel) ratio.
Let’s see Great Expectations in action… and remember to open your Data Window!
INPUTS
Trade direction : You must first choose if you wish to look at long or short trades. Because of the way the indicator works and the amount of visual information on the chart, it is only practical to look at one type of trades at a time. The default is Longs.
Maximum trade Length (MaxL) : This is the maximum walk forward distance the simulator will go in analyzing outcomes from any given point in the past. It also determines the size of the dead zone among the chart’s last bars. A red background line identifies the beginning of the dead zone for which not enough bars have elapsed to analyze outcomes for the maximum trade length defined. If an ATR-based entry stop is used, that length is added to the wait time before beginning simulations, so that the first entry starts with a clean ATR value. On a sample of around 16000 bars, my tests show that the indicator runs into server errors at lengths of around 290, i.e. having completed ~4,6M simulation loop iterations. That is way too high a length anyways; 100 will usually be amply enough to ring out all the possibilities out of a simulation, and on shorter time frames, 30 can be enough. While making it unduly small will prevent simulations of expressing the market’s potential, the less you use, the faster the indicator will run. The default is 40.
Unrealized P&L base at End of Trade (EOT) : When a simulation ends and the trade is still open, we calculate unrealized P&L from an exit order executed from either the last in-trade stop on the previous bar, or the close of the last bar. You can readily see the impact of this selection on the chart, with the P&L cloud. The default is on the close.
Display : The check box besides the title does nothing.
Show target : Shows a green line displaying the trade’s target expressed as a multiple of X, i.e. the amplitude of the entry stop. I call this value “X” and use it as a unit to express profit and loss on a trade (some call it “R”). The line is highlighted for trades where the close reached the target during the trade, whether the trade ended in profit or loss. This is also where you specify the multiple of X you wish to use in calculating targets. The multiple is used even if targets are not displayed.
Show P&L Cloud : The cloud allows traders to see right away the profitable areas of the chart. The only line printed with the cloud is the “end of trade line” (EOT). The EOT line is the only way one can see the level where a trade ended on the chart (in the Data Window you can see it as the “Exit Fill” value). The EOT level for the trade determines if the trade ended in a profit or a loss. Its value represents one of the following:
- fill from order executed at close of bar where stop is breached during trade (which produces “Realized P/L”),
- simulation of a fill pseudo-fill at the user-defined EOT level (last close or stop level) if the trade runs its course through MaxL bars without getting stopped (producing Unrealized P/L).
The EOT line and the cloud fill print in green when the trade’s outcome is profitable and in red when it is not. If the trade was closed after breaching the stop, the line appears brighter.
Show Opportunity&Risk Cloud : Displays the maximum opportunity/risk that was present during the trade, i.e. the maximum and minimum prices reached.
Background Color Scheme : Allows you to choose between 3 different color schemes for the background gradients, to accommodate different types of chart background/candles. Select “None” if you don’t want a background.
Background source : Determines what value will be used to generate the different intensities of the gradient. You can choose trade length (brighter is shorter), Trade P&L (brighter is higher) or the number of times the target was reached during simulation (brighter is higher). The default is Trade Length.
Entry strat : The check box besides the title does nothing. The default strat is All bars, meaning a trade will be simulated from all bars not excluded by the filters where a MaxL bars future exists. For fun, I’ve included a pseudo-random entry strat (an indirect way of changing the seed is to vary the starting date of the simulation).
Show Filter State : Displays areas where the combination of filters you have selected are allowing entries. Filtering occurs as per your selection(s), whether the state is displayed or not. The effect of multiple selections is additive. The filters are:
1. Bar direction: Longs will only be entered if close>open and vice versa.
2. Rising Volume: Applies to both long and shorts.
3. Rising/falling MA of the length you choose over the number of bars you choose.
4. Custom indicator: You can feed your own filtering signal through this from another indicator. It must produce a signal of 1 to allow long entries and 0 to allow shorts.
Show Entry Stops :
1. Multiple of user-defined length ATR.
2. Fixed percentage.
3. Fixed value.
All entry stops are calculated using the entry fill price as a reference. The fill price is calculated from the current bar’s open, to which slippage is added if configured. This simulates the case where the strategy issued the entry signal on the previous bar for it to be executed at the next bar’s open.
The entry stop remains active until the in-trade stop becomes the more aggressive of the two stops. From then on, the entry stop will be ignored, unless a bar close breaches the in-trade stop, in which case the stop will be reset with a new entry stop and the process repeats.
Show In-trade stops : Displays in bright red the selected in-trade stop (be sure to read the note in this section about them).
1. ATR multiple: added/subtracted from the average of the two previous bars minimum/maximum of open/close.
2. A trailing stop with a deviation expressed as a multiple of entry stop (X).
3. A fixed percentage trailing stop.
Trailing stops deviations are measured from the highest/lowest high/low reached during the trade.
Note: There is a twist with the in-trade stops. It’s that for any given bar, its in-trade stop can hold multiple values, as each successive pass of the advancing simulation loops goes over it from a different entry points. What is printed is the stop from the loop that ended on that bar, which may have nothing to do with other instances of the trade’s in-trade stop for the same bar when visited from other starting points in previous simulations. There is just no practical way to print all stop values that were used for any given bar. While the printed entry stops are the actual ones used on each bar, the in-trade stops shown are merely the last instance used among many.
Include Slippage : if checked, slippage will be added/subtracted from order price to yield the fill price. Slippage is in percentage. If you choose to include slippage in the simulations, remember to adjust it by considering the liquidity of the markets and the time frame you’ll be analyzing.
Include Fees : if checked, fees will be subtracted/added to both realized an unrealized trade profits/losses. Fees are in percentage. The default fees work well for crypto markets but will need adjusting for others—especially in Forex. Remember to modify them accordingly as they can have a major impact on results. Both fees and slippage are included to remind us of their importance, even if the global numbers produced by the indicator are not representative of a real trading scenario composed of sequential trades.
Date Range filtering : the usual. Just note that the checkbox has to be selected for date filtering to activate.
DATA WINDOW
Most of the information produced by this indicator is made available in the Data Window, which you bring up by using the icon below the Watchlist and Alerts buttons at the right of the TV UI. Here’s what’s there.
Some of the information presented in the Data Window is standard trade data; other values are not so standard; e. g. the notions of managed opportunity and risk and Target:Stop Travel ratio. The interplay between all the values provided by Great Expectations is inherently complex, even for a static set of entry/filter/exit strats. During the constant updating which the habitual process of progressive refinement in building strategies that is the lot of strategy modelers entails, another level of complexity is no doubt added to the analysis of this indicator’s values. While I don’t want to sound like Wolfram presenting A New Kind of Science , I do believe that if you are a serious strategy modeler and spend the time required to get used to using all the information this indicator makes available, you may find it useful.
Trade Information
Entry Order : This is the open of the bar where simulation starts. We suppose that an entry signal was generated at the previous bar.
Entry Fill (including slip.) : The actual entry price, including slippage. This is the base price from which other values will be calculated.
Exit Order : When a stop is breached, an exit order is executed from the close of the bar that breached the stop. While there is no “In-trade stop” value included in the Data Window (other than the End of trade Stop previously discussed), this “Exit Order” value is how we can know the level where the trade was stopped during the simulation. The “Trade Length” value will then show the bar where the stop was breached.
Exit Fill (including slip.) : When the exit order is simulated, slippage is added to the order level to create the fill.
Chart: Target : This is the target calculated at the beginning of the simulation. This value also appear on the chart in teal. It is controlled by the multiple of X defined under the “Show Target” checkbox in the Inputs.
Chart: Entry Stop : This value also appears on the chart (the red dots under points where a trade was simulated). Its value is controlled by the Entry Strat chosen in the Inputs.
X (% Fill, including Fees) and X (currency) : This is the stop’s amplitude (Entry Fill – Entry Stop) + Fees. It represents the risk incurred upon entry and will be used to express P&L. We will show R expressed in both a percentage of the Entry Fill level (this value), and currency (the next value). This value represents the risk in the risk:reward ratio and is considered to be a unit of 1 so that RR can be expressed as a single value (i.e. “2” actually meaning “1:2”).
Trade Length : If trade was stopped, it’s the number of bars elapsed until then. The trade is then considered “Closed”. If the trade ends without being stopped (there is no profit-taking strat implemented, so the stop is the only exit strat), then the trade is “Open”, the length is MaxL and it will show in orange. Otherwise the value will print in green/red to reflect if the trade is winning/losing.
P&L (X) : The P&L of the trade, expressed as a multiple of X, which takes into account fees paid at entry and exit. Given our default target setting at 2 units of “X”, a trade that closes at its target will have produced a P&L of +2.0, i.e. twice the value of X (not counting fees paid at exit ). A trade that gets stopped late 50% further that the entry stop’s level will produce a P&L of -1.5X.
P&L (currency, including Fees) : same value as above, but expressed in currency.
Target first reached at bar : If price closed above the target during the trade (even if it occurs after the trade was stopped), this will show when. This value will be used in calculating our TST ratio.
Times Stop/Target reached in sim. : Includes all occurrences during the complete simulation loop.
Opportunity (X) : The highest/lowest price reached during a simulation, i.e. the maximum opportunity encountered, whether the trade was previously stopped or not, expressed as a multiple of X.
Risk (X) : The lowest/highest price reached during a simulation, i.e. the maximum risk encountered, whether the trade was previously stopped or not, expressed as a multiple of X.
Risk:Opportunity : The greater this ratio, the greater Opportunity is, compared to Risk.
Managed Opportunity (%) : The portion of Opportunity that was captured by the highest/low stop position, even if it occurred after a previous stop closed the trade.
Managed Risk (%) : The portion of risk that was protected by the lowest/highest stop position, even if it occurred after a previous stop closed the trade. When this value is greater than 100%, it means the trade’s stop is protecting more than the maximum risk, which is frequent. You will, however, never see close to those values for the Managed Opportunity value, since the stop would have to be higher than the Maximum opportunity. It is much easier to alleviate the risk than it is to lock in profits.
Managed Risk:Opportunity : The ratio of the two preceding values.
Managed Opp. vs. Risk : The Managed Opportunity minus the Managed Risk. When it is negative, which is most often is, it means your strat is protecting a greater portion of the risk than it captures opportunity.
Global Numbers
Win Rate(%) : Percentage of winning trades over all entries. Open trades are considered winning if their last stop/close (as per user selection) locks in profits.
Avg X%, Avg X (currency) : Averages of previously described values:.
Avg Profitability/Trade (APPT) : This measures expectation using: Average Profitability Per Trade = (Probability of Win × Average Win) − (Probability of Loss × Average Loss) . It quantifies the average expectation/trade, which RR alone can’t do, as the probabilities of each outcome (win/lose) must also be used to calculate expectancy. The APPT combine the RR with the win rate to yield the true expectancy of a strategy. In my usual way of expressing risk with X, APPT is the equivalent of the average P&L per trade expressed in X. An APPT of -1.5 means that we lose on average 1.5X/trade.
Equity (X), Equity (currency) : The cumulative result of all trade outcomes, expressed as a multiple of X. Multiplied by the Average X in currency, this yields the Equity in currency.
Risk:Opportunity, Managed Risk:Opportunity, Managed Opp. vs. Risk : The global values of the ones previously described.
Avg Trade Length (TL) : One of the most important values derived by going through all the simulations. Again, it is composed of either the length of stopped trades, or MaxL when the trade isn’t stopped (open). This value can help systems modelers shape the characteristics of the components they use to build their strategies.
Avg Closed Win TL and Avg Closed Lose TL : The average lengths of winning/losing trades that were stopped.
Target reached? Avg bars to Stop and Target reached? Avg bars to Target : For the trades where the target was reached at some point in the simulation, the number of bars to the first point where the stop was breached and where the target was reached, respectively. These two values are used to calculate the next value.
TST (Target:Stop Travel Ratio) : This tracks the ratio between the two preceding values (Bars to first stop/Bars to first target), but only for trades where the target was reached somewhere in the loop. A ratio of 2 means targets are reached twice as fast as stops.
The next values of this section are counts or percentages and are self-explanatory.
Chart Plots
Contains chart plots of values already describes.
NOTES
Optimization/Overfitting: There is a fine line between optimizing and overfitting. Tools like this indicator can lead unsuspecting modelers down a path of overfitting that often turns strategies into over-specialized beasts that do not perform elegantly when confronted to the real-world. Proven testing strategies like walk forward analysis will go a long way in helping modelers alleviate this risk.
Input tuning: Because the results generated by the indicator will vary with the parameters used in the active entry, filtering and exit strats, it’s important to realize that although it may be fun at first, just slapping the default settings on a chart and time frame will not yield optimal nor reliable results. While using ATR as often as possible (as I do in this indicator) is a good way to make strat parametrization adaptable, it is not a foolproof solution.
There is no data for the last MaxL bars of the chart, since not enough trade future has elapsed to run a simulation from MaxL bars back.
Modifying the code: I have tried to structure the code modularly, even if that entails a larger code base, so that you can adapt it to your needs. I’ve included a few token components in each of the placeholders designed for entry strategies, filters, entry stops and in-trade stops. This will hopefully make it easier to add your own. In the same spirit, I have also commented liberally.
You will find in the code many instances of standard trade management tasks that can be lifted to code TV strategies where, as I do in mine, you manage everything yourself and don’t rely on built-in Pine strategy functions to act on your trades.
Enjoy!
THANKS
To @scarf who showed me how plotchar() could be used to plot values without ruining scale.
To @glaz for the suggestion to include a Chandelier stop strat; I will.
To @simpelyfe for the idea of using an indicator input for the filters (if some day TV lets us use more than one, it will be useful in other modules of the indicator).
To @RicardoSantos for the random generator used in the random entry strat.
To all scripters publishing open source on TradingView; their code is the best way to learn.
To my trading buddies Irving and Bruno; who showed me way back how pro traders get it done.
Kunsh Midline StochThis script utilizes a multi-timeframe approach to ride bigger trends using the Stochastic RSI and the MACD.
The Higher time frame MACD confirms a 50 line cross of the Stochastic RSI for a more precise entry.
Ultimate Scalping Tool[BullByte]Overview
The Ultimate Scalping Tool is an open-source TradingView indicator built for scalpers and short-term traders released under the Mozilla Public License 2.0. It uses a custom Quantum Flux Candle (QFC) oscillator to combine multiple market forces into one visual signal. In plain terms, the script reads momentum, trend strength, volatility, and volume together and plots a special “candlestick” each bar (the QFC) that reflects the overall market bias. This unified view makes it easier to spot entries and exits: the tool labels signals as Strong Buy/Sell, Pullback (a brief retracement in a trend), Early Entry, or Exit Warning . It also provides color-coded alerts and a small dashboard of metrics. In practice, traders see green/red oscillator bars and symbols on the chart when conditions align, helping them scalp or trend-follow without reading multiple separate indicators.
Core Components
Quantum Flux Candle (QFC) Construction
The QFC is the heart of the indicator. Rather than using raw price, it creates a candlestick-like bar from the underlying oscillator values. Each QFC bar has an “open,” “high/low,” and “close” derived from calculated momentum and volatility inputs for that period . In effect, this turns the oscillator into intuitive candle patterns so traders can recognize momentum shifts visually. (For comparison, note that Heikin-Ashi candles “have a smoother look because take an average of the movement”. The QFC instead represents exact oscillator readings, so it reflects true momentum changes without hiding price action.) Colors of QFC bars change dynamically (e.g. green for bullish momentum, red for bearish) to highlight shifts. This is the first open-source QFC oscillator that dynamically weights four non-correlated indicators with moving thresholds, which makes it a unique indicator on its own.
Oscillator Normalization & Adaptive Weights
The script normalizes its oscillator to a fixed scale (for example, a 0–100 range much like the RSI) so that various inputs can be compared fairly. It then applies adaptive weighting: the relative influence of trend, momentum, volatility or volume signals is automatically adjusted based on current market conditions. For instance, in very volatile markets the script might weight volatility more heavily, or in a strong trend it might give extra weight to trend direction. Normalizing data and adjusting weights helps keep the QFC sensitive but stable (normalization ensures all inputs fit a common scale).
Trend/Momentum/Volume/Volatility Fusion
Unlike a typical single-factor oscillator, the QFC oscillator fuses four aspects at once. It may compute, for example, a trend indicator (such as an ADX or moving average slope), a momentum measure (like RSI or Rate-of-Change), a volume-based pressure (similar to MFI/OBV), and a volatility measure (like ATR) . These different values are combined into one composite oscillator. This “multi-dimensional” approach follows best practices of using non-correlated indicators (trend, momentum, volume, volatility) for confirmation. By encoding all these signals in one line, a high QFC reading means that trend, momentum, and volume are all aligned, whereas a neutral reading might mean mixed conditions. This gives traders a comprehensive picture of market strength.
Signal Classification
The script interprets the QFC oscillator to label trades. For example:
• Strong Buy/Sell : Triggered when the oscillator crosses a high-confidence threshold (e.g. breaks clearly above zero with strong slope), indicating a well-confirmed move. This is like seeing a big green/red QFC candle aligned with the trend.
• Pullbacks : Identified when the trend is up but momentum dips briefly. A Pullback Buy appears if the overall trend is bullish but the oscillator has a short retracement – a typical buying opportunity in an uptrend. (A pullback is “a brief decline or pause in a generally upward price trend”.)
• Early Buy/Sell : Marks an initial swing in the oscillator suggesting a possible new trend, before it is fully confirmed. It’s a hint of momentum building (an early-warning signal), not as strong as the confirmed “Strong” signal.
• Exit Warnings : Issued when momentum peaks or reverses. For instance, if the QFC bars reach a high and start turning red/green opposite, the indicator warns that the move may be ending. In other words, a Momentum Peak is the point of maximum strength after which weakness may follow.
These categories correspond to typical trading concepts: Pullback (temporary reversal in an uptrend), Early Buy (an initial bullish cross), Strong Buy (confirmed bullish momentum), and Momentum Peak (peak oscillator value suggesting exhaustion).
Filters (DI Reversal, Dynamic Thresholds, HTF EMA/ADX)
Extra filters help avoid bad trades. A DI Reversal filter uses the +DI/–DI lines (from the ADX system) to require that the trend direction confirms the signal . For example, it might ignore a buy signal if the +DI is still below –DI. Dynamic Thresholds adjust signal levels on-the-fly: rather than fixed “overbought” lines, they move with volatility so signals happen under appropriate market stress. An optional High-Timeframe EMA or ADX filter adds a check against a larger timeframe trend: for instance, only taking a trade if price is above the weekly EMA or if weekly ADX shows a strong trend. (Notably, the ADX is “a technical indicator used by traders to determine the strength of a price trend”, so requiring a high-timeframe ADX avoids trading against the bigger trend.)
Dashboard Metrics & Color Logic
The Dashboard in the Ultimate Scalping Tool (UST) serves as a centralized information hub, providing traders with real-time insights into market conditions, trend strength, momentum, volume pressure, and trade signals. It is highly customizable, allowing users to adjust its appearance and content based on their preferences.
1. Dashboard Layout & Customization
Short vs. Extended Mode : Users can toggle between a compact view (9 rows) and an extended view (13 rows) via the `Short Dashboard` input.
Text Size Options : The dashboard supports three text sizes— Tiny, Small, and Normal —adjustable via the `Dashboard Text Size` input.
Positioning : The dashboard is positioned in the top-right corner by default but can be moved if modified in the script.
2. Key Metrics Displayed
The dashboard presents critical trading metrics in a structured table format:
Trend (TF) : Indicates the current trend direction (Strong Bullish, Moderate Bullish, Sideways, Moderate Bearish, Strong Bearish) based on normalized trend strength (normTrend) .
Momentum (TF) : Displays momentum status (Strong Bullish/Bearish or Neutral) derived from the oscillator's position relative to dynamic thresholds.
Volume (CMF) : Shows buying/selling pressure levels (Very High Buying, High Selling, Neutral, etc.) based on the Chaikin Money Flow (CMF) indicator.
Basic & Advanced Signals:
Basic Signal : Provides simple trade signals (Strong Buy, Strong Sell, Pullback Buy, Pullback Sell, No Trade).
Advanced Signal : Offers nuanced signals (Early Buy/Sell, Momentum Peak, Weakening Momentum, etc.) with color-coded alerts.
RSI : Displays the Relative Strength Index (RSI) value, colored based on overbought (>70), oversold (<30), or neutral conditions.
HTF Filter : Indicates the higher timeframe trend status (Bullish, Bearish, Neutral) when using the Leading HTF Filter.
VWAP : Shows the V olume-Weighted Average Price and whether the current price is above (bullish) or below (bearish) it.
ADX : Displays the Average Directional Index (ADX) value, with color highlighting whether it is rising (green) or falling (red).
Market Mode : Shows the selected market type (Crypto, Stocks, Options, Forex, Custom).
Regime : Indicates volatility conditions (High, Low, Moderate) based on the **ATR ratio**.
3. Filters Status Panel
A secondary panel displays the status of active filters, helping traders quickly assess which conditions are influencing signals:
- DI Reversal Filter: On/Off (confirms reversals before generating signals).
- Dynamic Thresholds: On/Off (adjusts buy/sell thresholds based on volatility).
- Adaptive Weighting: On/Off (auto-adjusts oscillator weights for trend/momentum/volatility).
- Early Signal: On/Off (enables early momentum-based signals).
- Leading HTF Filter: On/Off (applies higher timeframe trend confirmation).
4. Visual Enhancements
Color-Coded Cells : Each metric is color-coded (green for bullish, red for bearish, gray for neutral) for quick interpretation.
Dynamic Background : The dashboard background adapts to market conditions (bullish/bearish/neutral) based on ADX and DI trends.
Customizable Reference Lines : Users can enable/disable fixed reference lines for the oscillator.
How It(QFC) Differs from Traditional Indicators
Quantum Flux Candle (QFC) Versus Heikin-Ashi
Heikin-Ashi candles smooth price by averaging (HA’s open/close use averages) so they show trend clearly but hide true price (the current HA bar’s close is not the real price). QFC candles are different: they are oscillator values, not price averages . A Heikin-Ashi chart “has a smoother look because it is essentially taking an average of the movement”, which can cause lag. The QFC instead shows the raw combined momentum each bar, allowing faster recognition of shifts. In short, HA is a smoothed price chart; QFC is a momentum-based chart.
Versus Standard Oscillators
Common oscillators like RSI or MACD use fixed formulas on price (or price+volume). For example, RSI “compares gains and losses and normalizes this value on a scale from 0 to 100”, reflecting pure price momentum. MFI is similar but adds volume. These indicators each show one dimension: momentum or volume. The Ultimate Scalping Tool’s QFC goes further by integrating trend strength and volatility too. In practice, this means a move that looks strong on RSI might be downplayed by low volume or weak trend in QFC. As one source notes, using multiple non-correlated indicators (trend, momentum, volume, volatility) provides a more complete market picture. The QFC’s multi-factor fusion is unique – it is effectively a multi-dimensional oscillator rather than a traditional single-input one.
Signal Style
Traditional oscillators often use crossovers (RSI crossing 50) or fixed zones (MACD above zero) for signals. The Ultimate Scalping Tool’s signals are custom-classified: it explicitly labels pullbacks, early entries, and strong moves. These terms go beyond a typical indicator’s generic “buy”/“sell.” In other words, it packages a strategy around the oscillator, which traders can backtest or observe without reading code.
Key Term Definitions
• Pullback : A short-term dip or consolidation in an uptrend. In this script, a Pullback Buy appears when price is generally rising but shows a brief retracement. (As defined by Investopedia, a pullback is “a brief decline or pause in a generally upward price trend”.)
• Early Buy/Sell : An initial or tentative entry signal. It means the oscillator first starts turning positive (or negative) before a full trend has developed. It’s an early indication that a trend might be starting.
• Strong Buy/Sell : A confident entry signal when multiple conditions align. This label is used when momentum is already strong and confirmed by trend/volume filters, offering a higher-probability trade.
• Momentum Peak : The point where bullish (or bearish) momentum reaches its maximum before weakening. When the oscillator value stops rising (or falling) and begins to reverse, the script flags it as a peak – signaling that the current move could be overextended.
What is the Flux MA?
The Flux MA (Moving Average) is an Exponential Moving Average (EMA) applied to a normalized oscillator, referred to as FM . Its purpose is to smooth out the fluctuations of the oscillator, providing a clearer picture of the underlying trend direction and strength. Think of it as a dynamic baseline that the oscillator moves above or below, helping you determine whether the market is trending bullish or bearish.
How it’s calculated (Flux MA):
1.The oscillator is normalized (scaled to a range, typically between 0 and 1, using a default scale factor of 100.0).
2.An EMA is applied to this normalized value (FM) over a user-defined period (default is 10 periods).
3.The result is rescaled back to the oscillator’s original range for plotting.
Why it matters : The Flux MA acts like a support or resistance level for the oscillator, making it easier to spot trend shifts.
Color of the Flux Candle
The Quantum Flux Candle visualizes the normalized oscillator (FM) as candlesticks, with colors that indicate specific market conditions based on the relationship between the FM and the Flux MA. Here’s what each color means:
• Green : The FM is above the Flux MA, signaling bullish momentum. This suggests the market is trending upward.
• Red : The FM is below the Flux MA, signaling bearish momentum. This suggests the market is trending downward.
• Yellow : Indicates strong buy conditions (e.g., a "Strong Buy" signal combined with a positive trend). This is a high-confidence signal to go long.
• Purple : Indicates strong sell conditions (e.g., a "Strong Sell" signal combined with a negative trend). This is a high-confidence signal to go short.
The candle mode shows the oscillator’s open, high, low, and close values for each period, similar to price candlesticks, but it’s the color that provides the quick visual cue for trading decisions.
How to Trade the Flux MA with Respect to the Candle
Trading with the Flux MA and Quantum Flux Candle involves using the MA as a trend indicator and the candle colors as entry and exit signals. Here’s a step-by-step guide:
1. Identify the Trend Direction
• Bullish Trend : The Flux Candle is green and positioned above the Flux MA. This indicates upward momentum.
• Bearish Trend : The Flux Candle is red and positioned below the Flux MA. This indicates downward momentum.
The Flux MA serves as the reference line—candles above it suggest buying pressure, while candles below it suggest selling pressure.
2. Interpret Candle Colors for Trade Signals
• Green Candle : General bullish momentum. Consider entering or holding a long position.
• Red Candle : General bearish momentum. Consider entering or holding a short position.
• Yellow Candle : A strong buy signal. This is an ideal time to enter a long trade.
• Purple Candle : A strong sell signal. This is an ideal time to enter a short trade.
3. Enter Trades Based on Crossovers and Colors
• Long Entry : Enter a buy position when the Flux Candle turns green and crosses above the Flux MA. If it turns yellow, this is an even stronger signal to go long.
• Short Entry : Enter a sell position when the Flux Candle turns red and crosses below the Flux MA. If it turns purple, this is an even stronger signal to go short.
4. Exit Trades
• Exit Long : Close your buy position when the Flux Candle turns red or crosses below the Flux MA, indicating the bullish trend may be reversing.
• Exit Short : Close your sell position when the Flux Candle turns green or crosses above the Flux MA, indicating the bearish trend may be reversing.
•You might also exit a long trade if the candle changes from yellow to green (weakening strong buy signal) or a short trade from purple to red (weakening strong sell signal).
5. Use Additional Confirmation
To avoid false signals, combine the Flux MA and candle signals with other indicators or dashboard metrics (e.g., trend strength, momentum, or volume pressure). For example:
•A yellow candle with a " Strong Bullish " trend and high buying volume is a robust long signal.
•A red candle with a " Moderate Bearish " trend and neutral momentum might need more confirmation before shorting.
Practical Example
Imagine you’re scalping a cryptocurrency:
• Long Trade : The Flux Candle turns yellow and is above the Flux MA, with the dashboard showing "Strong Buy" and high buying volume. You enter a long position. You exit when the candle turns red and dips below the Flux MA.
• Short Trade : The Flux Candle turns purple and crosses below the Flux MA, with a "Strong Sell" signal on the dashboard. You enter a short position. You exit when the candle turns green and crosses above the Flux MA.
Market Presets and Adaptation
This indicator is designed to work on any market with candlestick price data (stocks, crypto, forex, indices, etc.). To handle different behavior, it provides presets for major asset classes. Selecting a “Stocks,” “Crypto,” “Forex,” or “Options” preset automatically loads a set of parameter values optimized for that market . For example, a crypto preset might use a shorter lookback or higher sensitivity to account for crypto’s high volatility, while a stocks preset might use slightly longer smoothing since stocks often trend more slowly. In practice, this means the same core QFC logic applies across markets, but the thresholds and smoothing adjust so signals remain relevant for each asset type.
Usage Guidelines
• Recommended Timeframes : Optimized for 1 minute to 15 minute intraday charts. Can also be used on higher timeframes for short term swings.
• Market Types : Select “Crypto,” “Stocks,” “Forex,” or “Options” to auto tune periods, thresholds and weights. Use “Custom” to manually adjust all inputs.
• Interpreting Signals : Always confirm a signal by checking that trend, volume, and VWAP agree on the dashboard. A green “Strong Buy” arrow with green trend, green volume, and price > VWAP is highest probability.
• Adjusting Sensitivity : To reduce false signals in fast markets, enable DI Reversal Confirmation and Dynamic Thresholds. For more frequent entries in trending environments, enable Early Entry Trigger.
• Risk Management : This tool does not plot stop loss or take profit levels. Users should define their own risk parameters based on support/resistance or volatility bands.
Background Shading
To give you an at-a-glance sense of market regime without reading numbers, the indicator automatically tints the chart background in three modes—neutral, bullish and bearish—with two levels of intensity (light vs. dark):
Neutral (Gray)
When ADX is below 20 the market is considered “no trend” or too weak to trade. The background fills with a light gray (high transparency) so you know to sit on your hands.
Bullish (Green)
As soon as ADX rises above 20 and +DI exceeds –DI, the background turns a semi-transparent green, signaling an emerging uptrend. When ADX climbs above 30 (strong trend), the green becomes more opaque—reminding you that trend-following signals (Strong Buy, Pullback) carry extra weight.
Bearish (Red)
Similarly, if –DI exceeds +DI with ADX >20, you get a light red tint for a developing downtrend, and a darker, more solid red once ADX surpasses 30.
By dynamically varying both hue (green vs. red vs. gray) and opacity (light vs. dark), the background instantly communicates trend strength and direction—so you always know whether to favor breakout-style entries (in a strong trend) or stay flat during choppy, low-ADX conditions.
The setup shown in the above chart snapshot is BTCUSD 15 min chart : Binance for reference.
Disclaimer
No indicator guarantees profits. Backtest or paper trade this tool to understand its behavior in your market. Always use proper position sizing and stop loss orders.
Good luck!
- BullByte
Levels & Flow📌 Overview
Levels & Flow is a visual trading tool that combines daily pivot levels with a dynamic EMA ribbon to help traders identify structure, momentum, and key decision zones in the market.
This script is designed for discretionary traders who rely on clean visual cues for intraday and swing trading strategies.
⚙️ Key Features
Daily Pivot, Support, and Resistance Lines
Automatically plots the daily pivot level based on the previous day’s OHLC data, along with calculated support and resistance levels.
Fibonacci Retracement Levels
Two dashed lines above and below the pivot represent the retracement of the pivot-resistance and pivot-support range, forming the boundaries of the “no-trade zone.”
No-Trade Zone (Shaded Box)
A gray shaded box between the two Fibonacci levels to visually mark a high-chop/low-conviction zone.
Trend-Based Candle Coloring (Current Day Only)
Candles are colored green if the close is above the pivot, red if below (only on the current trading day).
Bullish/Bearish Trend Label
A small table in the bottom-right corner displays “Bullish” or “Bearish” depending on whether price is above or below the pivot.
20-EMA Gradient Ribbon
A stack of 20 EMAs, each smoothed and color-coded from blue to green to reflect short- to long-term trend alignment.
Cumulative EMA with Adaptive Weighting
An intelligent moving average line that adjusts weight distribution among the 20 EMAs based on recent predictive accuracy using a learning rate and lookback period.
🧠 How It Works
📍 Levels
The script calculates daily pivot, resistance, and support levels using standard formulas:
Pivot = (High + Low + Close) / 3
Resistance = (2 × Pivot) – Low
Support = (2 × Pivot) – High
These levels update each day and extend 143 bars to the right.
📏 Fib Lines
Fib Up = Pivot + (Resistance – Pivot) × 0.382
Fib Down = Pivot – (Pivot – Support) × 0.382
These lines form the “no-trade zone” box.
📈 EMA Ribbon
20 EMAs starting from the user-defined Base Length, each incremented by 1
Each EMA is smoothed using the Smoothing Period
Color-coded from blue to green for intuitive visual flow
Filled between EMAs to visualize trend strength and alignment
🧠 Cumulative EMA Learning
Each EMA’s historical error is calculated over a Lookback Period
Lower-error EMAs receive higher weight; weights are normalized to sum to 1
The result is a cumulative EMA that adapts based on historical predictive power
🔧 User Inputs
Input
Base EMA Length: Sets the period for the shortest EMA (default: 20)
Smoothing Period: Smooths all EMAs and the cumulative EMA
Lookback for Learning: Number of bars to evaluate EMA prediction accuracy
Learning Rate: Adjusts how quickly weights shift in favor of more accurate EMAs
✅ How to Use It
Use the pivot level to define directional bias.
Watch for price breakouts above resistance or breakdowns below support to consider entry.
Avoid trading inside the shaded zone, where direction is less reliable.
Use the EMA ribbon gradient to confirm short/long alignment.
The cumulative EMA helps define trend with noise reduction.
🧪 Best For
Intraday traders who want to blend structure with flow
Swing traders needing clean daily levels with dynamic confirmation
Anyone looking to avoid choppy zones and improve visual clarity
⚠️ Disclaimer
This script is for educational and informational purposes only. It does not constitute financial advice or a trading recommendation. Always test scripts in simulation or on demo accounts before live use. Use at your own risk.
HTF ReversalsHTF Reversals — Big Turtle Soup & Relief Patterns
A multi-timeframe reversal indicator based on the logic of how pivots form and how true reversals begin. Designed for traders who want to catch high-probability turning points on higher timeframes, with visual clarity and actionable signals.
“Reversals don’t start from nowhere — they begin with a failed expansion and a reclaim of a prior range. This script helps you spot those moments, before the crowd.”
How It Works
Detects High Timeframe (HTF) “CR” Candles:
The script scans for large-bodied candles (“CR” candles) on higher timeframes (Monthly, Weekly, 3-Day). These candles often mark the end of a trend expansion and the start of a potential reversal zone.
Looks for “Inside” Candles:
After a CR candle, the script waits for a smaller “inside” candle, which signals a pause or failed continuation. The relationship between the CR and inside candle is key for identifying a possible reversal setup.
Engulfing Confirmation (Optional):
If the inside candle doesn’t immediately trigger a reversal, the script can wait for an engulfing move in the opposite direction, confirming the failed expansion and increasing the probability of a reversal.
Entry & Target Calculation:
For each valid setup, the script calculates a retracement entry (using Fibonacci levels like 0.382 or 0.618) and a logical target (usually the CR candle’s high or low).
Visuals: Lines & Boxes:
Each signal is marked with a horizontal line (entry) and a colored box extending from the HTF close to the entry price, visually highlighting the reversal zone for the same duration as the signal’s expected play-out.
Dashboard & Alerts:
A dashboard table summarizes the latest signals for each timeframe. Custom alerts notify you of new setups in real time.
Why It Works
Pivot Logic:
Reversals often start when a strong expansion candle (pivot) is followed by a failed attempt to continue in the same direction. This script codifies that logic, looking for the “pause” after the expansion and the first sign of a reclaim.
Multi-Timeframe Edge:
By focusing on higher timeframes, the indicator filters out noise and highlights only the most significant reversal opportunities.
Objective, Repeatable Rules:
All conditions are clearly defined and repeatable, removing subjectivity from reversal trading.
Visual Clarity:
The combination of lines and boxes makes it easy to see where reversals are likely to start and where your risk/reward lies.
How to Use
Add the indicator to your chart and select your preferred timeframes (Monthly, Weekly, 3-Day).
Watch for new signals on the dashboard or via alerts.
Use the entry line and box as your trade zone; the target is also displayed.
Combine with your own confluence (price action, volume, etc.) for best results.
This indicator is best used as a framework for understanding where high-probability reversals are likely to occur, not as a standalone buy/sell tool. Always use proper risk management.
Stoch Quad Oscillator📘 Stoch Quad Oscillator – User Guide
✅ Purpose
The Stoch Quad Oscillator is a multi-timeframe stochastic oscillator tool that helps traders detect oversold and overbought conditions, momentum shifts, and quad rotation signals using four distinct stochastic configurations. It includes visual cues, customizable parameters, and background highlights to improve decision-making during trend reversals or momentum surges.
🛠️ Inputs & Parameters
⏱ Timeframe
Timeframe for Stochastic Calculation: Defines which chart timeframe to use for stochastic calculations (default is "1" minute). This enables multi-timeframe analysis while on a lower timeframe chart.
📈 Stochastic Parameters
Four different stochastic configurations are used:
Label %K Length %D Smoothing Notes
K9 D3 9 3 Fastest, short-term view
K14 D3 14 3 Moderately short-term
K40 D4 40 4 Medium-term trend view
K60 D10 60 10 Long-term strength
Smoothing Type: Choose between SMA or EMA to control how smoothed the %D line is.
🎯 Levels
Overbought Level: Default 80
Oversold Level: Default 20
These are used to indicate overextended price conditions on any of the stochastic plots.
🔄 Quad Rotation Detection Settings
When enabled, the script detects synchronized oversold/overbought conditions with strong momentum using all 4 stochastic readings.
Enable Quad Rotation: Toggles detection on or off
Slope Calculation Bars: Number of bars used to calculate slope of %D lines
Slope Threshold: Minimum slope strength for signal (higher = stronger confirmation)
Oversold Quad Level: Total of all four stochastic values that define a quad oversold zone
Overbought Quad Level: Total of all four stochastic values that define a quad overbought zone
Oversold Quad Highlight Color: Background color when oversold quad is triggered
Overbought Quad Highlight Color: Background color when overbought quad is triggered
Slope Averaging Method: Either Simple Average or Weighted Average (puts more weight on higher timeframes)
Max Signal Bar Window: Defines how recent the signal must be to be considered valid
📊 Plots & Visual Elements
📉 Stochastic %D Lines
Each stochastic is plotted separately:
K9 D3 – Red
K14 D3 – Orange
K40 D4 – Fuchsia
K60 D10 – Silver
These help visualize short to long-term momentum simultaneously.
📏 Horizontal Reference Lines
Overbought Line (80) – Red
Oversold Line (20) – Green
These help you identify threshold breaches visually.
🌈 Background Highlighting
The indicator provides background highlights to mark potential signal zones:
✅ All Oversold or Overbought Conditions
When all four stochastics are either above overbought or below oversold:
Bright Red if all are overbought
Bright Green if all are oversold
🚨 Quad Rotation Signal Zones (if enabled)
Triggered when:
The combined sum of all four stochastic levels is extremely low/high (below/above oversoldQuadLevel or overboughtQuadLevel)
The average slope of the 4 %D lines is sharply positive (> slopeThreshold)
Highlights:
Custom Red Tint = Strong overbought quad signal
Custom Green Tint = Strong oversold quad signal
These zones can indicate momentum shifts or reversal potential when used with price action or other tools.
⚠️ Limitations & Considerations
This indicator does not provide trade signals. It visualizes conditions and potential setups.
It is best used in confluence with price action, support/resistance levels, and other indicators.
False positives may occur in ranging markets. Reduce reliance on slope thresholds during low volatility.
Quad signals rely on slope strength, which may lag slightly behind sudden reversals.
🧠 Tips for Use
Combine with volume, MACD, or PSAR to confirm direction before entry.
Watch for divergences between price and any of the stochastics.
Use on higher timeframes (e.g., 5m–30m) to filter for swing trading setups; use shorter TFs (1m–5m) for scalping signals.
Adjust oversoldQuadLevel and overboughtQuadLevel based on market conditions (e.g., in trending vs ranging markets).
Canuck Trading IndicatorOverview
The Canuck Trading Indicator is a versatile, overlay-based technical analysis tool designed to assist traders in identifying potential trading opportunities across various timeframes and market conditions. By combining multiple technical indicators—such as RSI, Bollinger Bands, EMAs, VWAP, MACD, Stochastic RSI, ADX, HMA, and candlestick patterns—the indicator provides clear visual signals for bullish and bearish entries, breakouts, long-term trends, and options strategies like cash-secured puts, straddles/strangles, iron condors, and short squeezes. It also incorporates 20-day and 200-day SMAs to detect Golden/Death Crosses and price positioning relative to these moving averages. A dynamic table displays key metrics, and customizable alerts help traders stay informed of market conditions.
Key Features
Multi-Timeframe Adaptability: Automatically adjusts parameters (e.g., ATR multiplier, ADX period, HMA length) based on the chart's timeframe (minute, hourly, daily, weekly, monthly) for optimal performance.
Comprehensive Signal Generation: Identifies short-term entries, breakouts, long-term bullish trends, and options strategies using a combination of momentum, trend, volatility, and candlestick patterns.
Candlestick Pattern Detection: Recognizes bullish/bearish engulfing, hammer, shooting star, doji, and strong candles for precise entry/exit signals.
Moving Average Analysis: Plots 20-day and 200-day SMAs, detects Golden/Death Crosses, and evaluates price position relative to these averages.
Dynamic Table: Displays real-time metrics, including zone status (bullish, bearish, neutral), RSI, MACD, Stochastic RSI, short/long-term trends, candlestick patterns, ADX, ROC, VWAP slope, and MA positioning.
Customizable Alerts: Over 20 alert conditions for entries, exits, overbought/oversold warnings, and MA crosses, with actionable messages including ticker, price, and suggested strategies.
Visual Clarity: Uses distinct shapes, colors, and sizes to plot signals (e.g., green triangles for bullish entries, red triangles for bearish entries) and overlays key levels like EMA, VWAP, Bollinger Bands, support/resistance, and HMA.
Options Strategy Signals: Suggests opportunities for selling cash-secured puts, straddles/strangles, iron condors, and capitalizing on short squeezes.
How to Use
Add to Chart: Apply the indicator to any TradingView chart by selecting "Canuck Trading Indicator" from the Pine Script library.
Interpret Signals:
Bullish Signals: Green triangles (short-term entry), lime diamonds (breakout), blue circles (long-term entry).
Bearish Signals: Red triangles (short-term entry), maroon diamonds (breakout).
Options Strategies: Purple squares (cash-secured puts), yellow circles (straddles/strangles), orange crosses (iron condors), white arrows (short squeezes).
Exits: X-cross shapes in corresponding colors indicate exit signals.
Monitor: Gray circles suggest holding cash or monitoring for setups.
Review Table: Check the top-right table for real-time metrics, including zone status, RSI, MACD, trends, and MA positioning.
Set Alerts: Configure alerts for specific signals (e.g., "Short-Term Bullish Entry" or "Golden Cross") to receive notifications via TradingView.
Adjust Inputs: Customize input parameters (e.g., RSI period, EMA length, ATR period) to suit your trading style or market conditions.
Input Parameters
The indicator offers a wide range of customizable inputs to fine-tune its behavior:
RSI Period (default: 14): Length for RSI calculation.
RSI Bullish Low/High (default: 35/70): RSI thresholds for bullish signals.
RSI Bearish High (default: 65): RSI threshold for bearish signals.
EMA Period (default: 15): Main EMA length (15 for day trading, 50 for swing).
Short/Long EMA Length (default: 3/20): For momentum oscillator.
T3 Smoothing Length (default: 5): Smooths momentum signals.
Long-Term EMA/RSI Length (default: 20/15): For long-term trend analysis.
Support/Resistance Lookback (default: 5): Periods for support/resistance levels.
MACD Fast/Slow/Signal (default: 12/26/9): MACD parameters.
Bollinger Bands Period/StdDev (default: 15/2): BB settings.
Stochastic RSI Period/Smoothing (default: 14/3/3): Stochastic RSI settings.
Uptrend/Short-Term/Long-Term Lookback (default: 2/2/5): Candles for trend detection.
ATR Period (default: 14): For volatility and price targets.
VWAP Sensitivity (default: 0.1%): Threshold for VWAP-based signals.
Volume Oscillator Period (default: 14): For volume surge detection.
Pattern Detection Threshold (default: 0.3%): Sensitivity for candlestick patterns.
ROC Period (default: 3): Rate of change for momentum.
VWAP Slope Period (default: 5): For VWAP trend analysis.
TradingView Publishing Compliance
Originality: The Canuck Trading Indicator is an original script, combining multiple technical indicators and custom logic to provide unique trading signals. It does not replicate existing public scripts.
No Guaranteed Profits: This indicator is a tool for technical analysis and does not guarantee profits. Trading involves risks, and users should conduct their own research and risk management.
Clear Instructions: The description and usage guide are detailed and accessible, ensuring users understand how to apply the indicator effectively.
No External Dependencies: The script uses only built-in Pine Script functions (e.g., ta.rsi, ta.ema, ta.vwap) and requires no external libraries or data sources.
Performance: The script is optimized for performance, using efficient calculations and adaptive parameters to minimize lag on various timeframes.
Visual Clarity: Signals are plotted with distinct shapes and colors, and the table provides a concise summary of market conditions, enhancing usability.
Limitations and Risks
Market Conditions: The indicator may generate false signals in choppy or low-liquidity markets. Always confirm signals with additional analysis.
Timeframe Sensitivity: Performance varies by timeframe; test settings on your preferred chart (e.g., 5-minute for day trading, daily for swing trading).
Risk Management: Use stop-losses and position sizing to manage risk, as suggested in alert messages (e.g., "Stop -20%").
Options Trading: Options strategies (e.g., straddles, iron condors) carry unique risks; consult a financial advisor before trading.
Feedback and Support
For questions, suggestions, or bug reports, please leave a comment on the TradingView script page or contact the author via TradingView. Your feedback helps improve the indicator for the community.
Disclaimer
The Canuck Trading Indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves significant risks, and past performance is not indicative of future results. Always perform your own due diligence and consult a qualified financial advisor before making trading decisions.
UT Bot + Hull MA Confirmed Signal DelayOverview
This indicator is designed to detect high-probability reversal entry signals by combining "UT Bot Alerts" (UT Bot Alerts script adapted from QuantNomad - Originally developed by Yo_adriiiiaan and idea of original code for "UT Bot Alerts" from HPotter ) with confirmation from a Hull Moving Average (HMA) Developed by Alan Hull . It focuses on capturing momentum shifts that often precede trend reversals, helping traders identify potential entry points while filtering out false signals.
🔍 How It Works
This strategy operates in two stages:
1. UT Bot Momentum Trigger
The foundation of this script is the "UT Bot Alerts" , which uses an ATR-based trailing stop to detect momentum changes. Specifically:
The script calculates a dynamic stop level based on the Average True Range (ATR) multiplied by a user-defined sensitivity factor (Key Value).
When price closes above this trailing stop and the short-term EMA crosses above the stop, a potential buy setup is triggered.
Conversely, when price closes below the trailing stop and the short-term EMA crosses below, a potential sell setup is triggered.
These UT Bot alerts are designed to identify the initial shift in market direction, acting as the first filter in the signal process.
2. Hull MA Confirmation
To reduce noise and false triggers from the UT Bot alone, this script delays the entry signal until price confirms the move by crossing the Hull Moving Average (or its variants: HMA, THMA, EHMA) in the same direction as the UT Bot trigger:
A Buy Signal is generated only when:
A UT Bot Buy condition is active, and
The price closes above the Hull MA.
Or, if a UT Bot Buy condition was recently triggered but price hadn’t yet crossed above the Hull MA, a delayed buy is signaled when price finally breaks above it.
A Sell Signal is generated only when:
A UT Bot Sell condition is active, and
The price closes below the Hull MA.
Similarly, a delayed sell signal can occur if price breaks below the Hull MA shortly after a UT Bot Sell trigger.
This dual-confirmation process helps traders avoid premature entries and improves the reliability of reversal signals.
📈 Best Use Cases
Reversal Trading: This strategy is particularly well-suited for catching early trend reversals rather than trend continuations. It excels at identifying momentum pivots that occur after pullbacks or exhaustion moves.
Heikin Ashi Charts Recommended: The script offers a Heikin Ashi mode for smoothing out noise and enhancing visual clarity. Using Heikin Ashi candles can further reduce whipsaws and highlight cleaner shifts in trend direction.
MACD Alignment: For best results, trade in the direction of the MACD trend or use it as a filter to avoid counter-trend trades.
⚠️ Important Notes
Entry Signals Only: This indicator only plots entry points (Buy and Sell signals). It does not define exit strategies, so users should manage trades manually using trailing stops, profit targets, or other exit indicators.
No Signal = No Confirmation: You may see a UT Bot trigger without a corresponding Buy/Sell signal. This means the price did not confirm the move by crossing the Hull MA, and therefore the setup was considered too weak or incomplete.
⚙️ Customization
UT Bot Sensitivity: Adjust the “Key Value” and “ATR Period” to make the UT Bot more or less reactive to price action.
Use Heikin Ashi: Toggle between standard candles or Heikin Ashi in the indicator settings for a smoother trading experience.
The HMA length may also be modified in the indicator settings from its standard 55 length to increase or decrease the sensitivity of signal.
This strategy is best used by traders looking for a structured, logic-based way to enter early into reversals with added confirmation to reduce risk. By combining two independent systems—momentum detection (UT Bot) and trend confirmation (Hull MA)—it aims to provide high-confidence entries without overwhelming complexity.
Let the indicator guide your entries—you manage the exits.
Examples of use:
Futures:
Stock:
Crypto:
As shown in the snapshots this strategy, like most, works the best when price action has a sizeable ATR and works the least when price is choppy. Therefore it is always best to use this system when price is coming off known support or resistance levels and when it is seen to respect short term EMA's like the 9 or 15.
My personal preference to use this system is for day trading on a 3 or 5 minute chart. But it is valid for all timeframes and simply marks a high probability for a new trend to form.
Sources:
Quant Nomad - www.tradingview.com
Yo_adriiiiaan - www.tradingview.com
HPotter - www.tradingview.com
Hull Moving Average - alanhull.com
IU Mean Reversion SystemDESCRIPTION
The IU Mean Reversion System is a dynamic mean reversion-based trading framework designed to identify optimal reversal zones using a smoothed mean and a volatility-adjusted band. This system captures price extremes by combining exponential and running moving averages with the Average True Range (ATR), effectively identifying overextended price action that is likely to revert back to its mean. It provides precise long and short entries with corresponding exit conditions, making it ideal for range-bound markets or phases of low volatility.
USER INPUTS :
Mean Length – Controls the smoothness of the mean; default is 9.
ATR Length – Defines the lookback period for ATR-based band calculation; default is 100.
Multiplier – Determines how wide the upper and lower bands are from the mean; default is 3.
LONG CONDITION :
A long entry is triggered when the closing price crosses above the lower band, indicating a potential upward mean reversion.
A position is taken only if there is no active long position already.
SHORT CONDITION :
A short entry is triggered when the closing price crosses below the upper band, signaling a potential downward mean reversion.
A position is taken only if there is no active short position already.
LONG EXIT :
A long position exits when the high price crosses above the mean, implying that price has reverted back to its average and may no longer offer favorable long risk-reward.
SHORT EXIT :
A short position exits when the low price crosses below the mean, indicating the mean reversion has occurred and the downside opportunity has likely played out.
WHY IT IS UNIQUE:
Uses a double smoothing approach (EMA + RMA) to define a stable mean, reducing noise and false signals.
Adapts dynamically to volatility using ATR-based bands, allowing it to handle different market conditions effectively.
Implements a state-aware entry system using persistent variables, avoiding redundant entries and improving clarity.
The logic is clear, concise, and modular, making it easy to modify or integrate with other systems.
HOW USER CAN BENEFIT FROM IT :
Traders can easily identify reversion opportunities in sideways or mean-reverting environments.
Entry and exit points are visually labeled on the chart, aiding in clarity and trade review.
Helps maintain discipline and consistency by using a rule-based framework instead of subjective judgment.
Can be combined with other trend filters, momentum indicators, or higher time frame context for enhanced results.
Quarterly Theory ICT 05 [TradingFinder] Doubling Theory Signals🔵 Introduction
Doubling Theory is an advanced approach to price action and market structure analysis that uniquely combines time-based analysis with key Smart Money concepts such as SMT (Smart Money Technique), SSMT (Sequential SMT), Liquidity Sweep, and the Quarterly Theory ICT.
By leveraging fractal time structures and precisely identifying liquidity zones, this method aims to reveal institutional activity specifically smart money entry and exit points hidden within price movements.
At its core, the market is divided into two structural phases: Doubling 1 and Doubling 2. Each phase contains four quarters (Q1 through Q4), which follow the logic of the Quarterly Theory: Accumulation, Manipulation (Judas Swing), Distribution, and Continuation/Reversal.
These segments are anchored by the True Open, allowing for precise alignment with cyclical market behavior and providing a deeper structural interpretation of price action.
During Doubling 1, a Sequential SMT (SSMT) Divergence typically forms between two correlated assets. This time-structured divergence occurs between two swing points positioned in separate quarters (e.g., Q1 and Q2), where one asset breaks a significant low or high, while the second asset fails to confirm it. This lack of confirmation—especially when aligned with the Manipulation and Accumulation phases—often signals early smart money involvement.
Following this, the highest and lowest price points from Doubling 1 are designated as liquidity zones. As the market transitions into Doubling 2, it commonly returns to these zones in a calculated move known as a Liquidity Sweep—a sharp, engineered spike intended to trigger stop orders and pending positions. This sweep, often orchestrated by institutional players, facilitates entry into large positions with minimal slippage.
Bullish :
Bearish :
🔵 How to Use
Applying Doubling Theory requires a simultaneous understanding of temporal structure and inter-asset behavioral divergence. The method unfolds over two main phases—Doubling 1 and Doubling 2—each divided into four quarters (Q1 to Q4).
The first phase focuses on identifying a Sequential SMT (SSMT) divergence, which forms when two correlated assets (e.g., EURUSD and GBPUSD, or NQ and ES) react differently to key price levels across distinct quarters. For example, one asset may break a previous low while the other maintains structure. This misalignment—especially in Q2, the Manipulation phase—often indicates early smart money accumulation or distribution.
Once this divergence is observed, the extreme highs and lows of Doubling 1 are marked as liquidity zones. In Doubling 2, the market gravitates back toward these zones, executing a Liquidity Sweep.
This move is deliberate—designed to activate clustered stop-loss and pending orders and to exploit pockets of resting liquidity. These sweeps are typically driven by institutional forces looking to absorb liquidity and position themselves ahead of the next major price move.
The key to execution lies in the fact that, during the sweep in Doubling 2, a classic SMT divergence should also appear between the two assets. This indicates a weakening of the previous trend and adds an extra layer of confirmation.
🟣 Bullish Doubling Theory
In the bullish scenario, Doubling 1 begins with a bullish SSMT divergence, where one asset forms a lower low while the other maintains its structure. This divergence signals weakening bearish momentum and possible smart money accumulation. In Doubling 2, the market returns to the previous low and sweeps the liquidity zone—breaking below it on one asset, while the second fails to confirm, forming a bullish SMT divergence.
f this move is followed by a bullish PSP and a clear market structure break (MSB), a long entry is triggered. The stop-loss is placed just below the swept liquidity zone, while the target is set in the premium zone, anticipating a move driven by institutional buyers.
🟣 Bearish Doubling Theory
The bearish scenario follows the same structure in reverse. In Doubling 1, a bearish SSMT divergence occurs when one asset prints a higher high while the other fails to do so. This suggests distribution and weakening buying pressure. Then, in Doubling 2, the market returns to the previous high and executes a liquidity sweep, targeting trapped buyers.
A bearish SMT divergence appears, confirming the move, followed by a bearish PSP on the lower timeframe. A short position is initiated after a confirmed MSB, with the stop-loss placed
🔵 Settings
⚙️ Logical Settings
Quarterly Cycles Type : Select the time segmentation method for SMT analysis.
Available modes include : Yearly, Monthly, Weekly, Daily, 90 Minute, and Micro.
These define how the indicator divides market time into Q1–Q4 cycles.
Symbol : Choose the secondary asset to compare with the main chart asset (e.g., XAUUSD, US100, GBPUSD).
Pivot Period : Sets the sensitivity of the pivot detection algorithm. A smaller value increases responsiveness to price swings.
Pivot Sync Threshold : The maximum allowed difference (in bars) between pivots of the two assets for them to be compared.
Validity Pivot Length : Defines the time window (in bars) during which a divergence remains valid before it's considered outdated.
🎨 Display Settings
Show Cycle :Toggles the visual display of the current Quarter (Q1 to Q4) based on the selected time segmentation
Show Cycle Label : Shows the name (e.g., "Q2") of each detected Quarter on the chart.
Show Labels : Displays dynamic labels (e.g., “Q2”, “Bullish SMT”, “Sweep”) at relevant points.
Show Lines : Draws connection lines between key pivot or divergence points.
Color Settings : Allows customization of colors for bullish and bearish elements (lines, labels, and shapes)
🔔 Alert Settings
Alert Name : Custom name for the alert messages (used in TradingView’s alert system).
Message Frequenc y:
All : Every signal triggers an alert.
Once Per Bar : Alerts once per bar regardless of how many signals occur.
Per Bar Close : Only triggers when the bar closes and the signal still exists.
Time Zone Display : Choose the time zone in which alert timestamps are displayed (e.g., UTC).
Bullish SMT Divergence Alert : Enable/disable alerts specifically for bullish signals.
Bearish SMT Divergence Alert : Enable/disable alerts specifically for bearish signals
🔵 Conclusion
Doubling Theory is a powerful and structured framework within the realm of Smart Money Concepts and ICT methodology, enabling traders to detect high-probability reversal points with precision. By integrating SSMT, SMT, Liquidity Sweeps, and the Quarterly Theory into a unified system, this approach shifts the focus from reactive trading to anticipatory analysis—anchored in time, structure, and liquidity.
What makes Doubling Theory stand out is its logical synergy of time cycles, behavioral divergence, liquidity targeting, and institutional confirmation. In both bullish and bearish scenarios, it provides clearly defined entry and exit strategies, allowing traders to engage the market with confidence, controlled risk, and deeper insight into the mechanics of price manipulation and smart money footprints.
LANZ Strategy 3.0🔷 LANZ Strategy 3.0 — Asian Range Fibonacci Strategy with Execution Window Logic
LANZ Strategy 3.0 is a rule-based trading system that utilizes the Asian session range to project Fibonacci levels and manage entries during a defined execution window. Designed for Forex and index traders, this strategy focuses on structured price behavior around key levels before the New York session.
🧠 Core Components:
Asian Session Range Mapping: Automatically detects the high, low, and midpoint during the Asian session.
Fibonacci Level Projection: Projects configurable Fibonacci retracement and extension levels based on the Asian range.
Execution Window Logic: Uses the 01:15 NY candle as a reference to validate potential reversals or continuation setups.
Conditional Entry System: Includes logic for limit order entries (buy or sell) at specific Fib levels, with reversal logic if price breaks structure before execution.
Risk Management: Entry orders are paired with dynamic SL and TP based on Fibonacci-based distances, maintaining a risk-reward ratio consistent with intraday strategies.
📊 Visual Features:
Asian session high/low/mid lines.
Fibonacci levels: Original (based on raw range) and Optimized (user-adjustable).
Session background coloring for Asia, Execution Window, and NY session.
Labels and lines for entry, SL, and TP targets.
Dynamic deletion of untriggered orders after execution window expires.
⚙️ How It Works:
The script calculates the Asian session range.
Projects Fibonacci levels from the range.
Waits for the 01:15 NY candle to close to validate a signal.
If valid, a limit entry order (BUY or SELL) is plotted at the selected level.
If price structure changes (e.g., breaks the high/low), reversal logic may activate.
If no trade is triggered, orders are cleared before the NY session.
🔔 Alerts:
Alerts trigger when a valid setup appears after 01:15 NY candle.
Optional alerts for order activation, SL/TP hit, or trade cancellation.
📝 Notes:
Intended for semi-automated or discretionary trading.
Best used on highly liquid markets like Forex majors or indices.
Script parameters include session times, Fib ratios, SL/TP settings, and reversal logic toggle.
Credits:
Developed by LANZ, this script merges traditional session-based analysis with Fibonacci tools and structured execution timing, offering a unique framework for morning volatility plays.
Wx Stop Loss BetaWx Stop Loss Beta is an adaptive stop-loss overlay intended for discretionary entry management in medium- to long-term trades. It integrates a volatility filter, support-based logic, and capital protection constraints.
• Manual Entry Price: User inputs their actual entry point
• Volatility Anchor: Stop-loss adjusts using ATR (customizable length and multiplier)
• Support Reference: Based on swing low over a configurable lookback period
• Loss Cap: Maximum allowable loss percentage from entry price (hard floor)
• Trailing Logic: Stop-loss only moves upward (never lowers), adapting to favorable price action
• Output: Displays a horizontal line at the stop-loss level and renders its value in the data window
Warning: This tool is experimental and has not been formally backtested. It is provided as-is for manual strategy enhancement. Use at your own discretion, and validate thoroughly in a paper or sandbox environment before relying on it in live trading. Feedback and critique are encouraged.