HL range by durgaThe script we've been working on is an indicator designed to display the high-low range of the last candlestick on a TradingView chart. It does so by plotting two lines: one for the high and another for the low of the last completed candlestick.
Additionally, the script includes a label that shows the numerical value of the high-low range. This label is positioned between the plotted lines, showing the difference between the high and low prices of the last candlestick.
The script operates in real-time, updating dynamically as new candlesticks form. Furthermore, it automatically removes the label after the close of the candlestick, maintaining a clean and clutter-free chart.
This indicator can help traders quickly visualize and assess the range of the last completed candlestick, aiding in their analysis of price action.
In den Scripts nach "Candlestick" suchen
GAP Candle-By AtropineWhat is gap in candlestick?
A gap is an empty space within a price chart between the two neighboring candlesticks.
Gaps occur when the following candlestick opens at a distance from the previous candlestick closing price. This may happen if the market’s view of the price rapidly changes and there’s a sudden influx of buy/sell orders.
A gap is defined as an unfilled space or interval. On a technical analysis chart, a gap represents an area where no trading takes place. On the Japanese candlestick chart, a window is interpreted as a gap.
In an upward trend, a gap is produced when the highest price of one day is lower than the lowest price of the following day.
In a downward trend, a gap occurs when the lowest price of any one day is higher than the highest price of the next day.
This indicator automatically detects gaps and plots them as Candlestick.
Indicator Provides option to change the color of this Gap Candle.
Candles Based On Traded VolumeCBTV - Candlesticks Based on Traded Volume
This is the first robust implementation of volume based candlesticks (bars) on TradingView. This type of bar was describe in the book "Advances in Financial Machine Learning," written by Lopez de Prado, a well-known quant who has managed billions of dollars over the course of his career.
Volume Candlesticks (Bars) are bars that are indexed by total volume, with each set of N shares exchanged forming a separate bar.
This means that on CBTV chart a candle forms not after a specific time interval defined by the time frame of the chart, but when a determined volume was traded.
This approach to price sampling is much better than the time based one, because it does not oversample periods where nothing happens. Traditional candlestick charts show a lot of low volume bars without meaningful price changes in them.
The efficient price sampling results in better results when using volume based bars in machine learning forecasting models. They are also useful for technical analysis. Candlestick patterns on CBTV chart are more pronounced and have more predictive power.
Volume based bars can be constructed only for instruments where volume data is available. These are stocks, futures and crypto currencies.
When you run CBTV it appears in a separate window below the traditional time based chart.
CBTV will be used in pair with a helper indicator which is called Optimal Volume per Candle (OVPC).
When applied to a chart OVPC shows the optimal range for volume per candle to construct volume based candlesticks from this timeframe data. It appears in the blue box above the most recent candle of a standard time based chart.
When you set a Volume Per Candle parameter in CBTV make sure it is within the range that shows OVPC. In this case volume based chart will be easy to read and all the calculations will be performed with the high level of precision.
The most recent unfinished candle is marked with the different set of colors than historical candles. Unfinished candle is colored in orange if it is a falling candle, blue it it is a rising one.
If you leave the CBTV chart opened for a long time you can have multiple blue or orange candles on it. In this case press the “hide” icon with the eye sign twice (it’s on the left side of the indicator panel next to its input parameters). This will refresh the CBTV and remove the artifacts.
While everything comes Real-time you will see the orange or blue bars form but never update. All you need to do is REFRESH THE CHART. Hoping soon to update this with a version you wont have to refresh the chart.
Please drop a like and comment what you guys think and once again thank you Tradingview for such a great platform :)
MinichartsHello friends,
I'm happy to introduce this compact visualization tool that lets you display multiple mini candlestick charts directly on your main chart. It’s ideal for tracking several instruments at once, helping you compare assets, monitor relative performance, or build your own visual screener — all without leaving your chart.
🛠 How It Works
Each minichart represents a scaled-down candlestick chart of any ticker and timeframe you select. You can display up to 12 charts in a single instance and choose from multiple grid layouts — ranging from 1×1 to 6×2 . Each chart can show up to 20 candles, providing a concise yet information-rich view of price behavior. You can also overlay custom moving averages (SMA, EMA, WMA, or HMA) and display last price lines for better visual context.
🔥 Key Features
Pine Script V6 — optimized for performance and compatibility
Up to 12 charts per instance
16 layout options : 1×1, 1×2, 1×3, 1×4, 1×5, 1×6, 1×7, 1×8, 1×9, 1×10, 1×11, 1×12, 2×6, 3×4, 4×3, 6×2
Display up to 20 candles per chart
Supports 48 tickers through multiple instances
Choose between SMA, EMA, WMA, and HMA for overlayed moving averages
Optional last price line for each chart
Customizable chart labels
📸 Visual Examples
Merge of two instances (1×4 layout):
Example with three instances (3×4 layout):
If you'd like access or have any questions, feel free to reach out to me directly via DM.
👋 Good luck and happy trading!
Bezahltes Script
Bearish Engulfing Automatic Finding Script This is a bearish pattern formed by three candlesticks.
The pattern is based on the fact that the last candlestick must
completely engulf the previous two and be downward. The two preceding
candlesticks must also be upward. Candlestick wicks are not taken
into account.
APB candle(Average Price Bar)
APB Candle (Average Price Bar) with Heikin Ashi and Default Candle ON/OFF Control
Description (日本語解説は下記):
The APB Candle (Average Price Bar) provides a smoother and clearer visualization of market trends compared to standard candlesticks or Heikin Ashi. Unlike regular candlesticks, which display raw price data, APB candles calculate the average of open, high, low, and close prices, effectively filtering out short-term noise and minor fluctuations. This allows traders to focus on overall trends rather than being distracted by small, unpredictable price movements.
Why APB is superior:
・Better Trend Identification: APB candles smooth price data more effectively than standard candlesticks, making it easier to spot sustained trends.
・Reduced Market Noise: While Heikin Ashi also filters noise, APB provides a clearer view of actual price averages, offering a better balance between smoothing and staying close to the real price.
・Clear Entry and Exit Signals: By smoothing out minor fluctuations, APB candles can provide clearer signals for entering and exiting trades, particularly in volatile markets.
Key Features:
1.APB Candle ON/OFF: Display smoothed average price bars that filter out minor fluctuations, making trends clearer.
2.Heikin Ashi Candle ON/OFF: Remove market noise and visualize smoother trends using Heikin Ashi candles.
3.Default Candle ON/OFF: Compare APB and Heikin Ashi candles with the standard TradingView candles.
4.Customizable Colors: Personalize the colors of bullish and bearish candles, including the body, wick, and border.
5.Color Shift Threshold: Adjust the transparency of APB candles based on a user-defined threshold for smaller body sizes.
6.Countdown Timer: See how much time remains before the next candle forms, with customizable size, position, and color.
Trading Strategy:
・Trend Following with APB: Use APB candles to identify smoother trends by filtering out minor price fluctuations. This can be useful for trend-following strategies in volatile markets.
・Heikin Ashi for Reversals: Heikin Ashi candles help to smooth out trends, making it easier to spot potential reversals. When switching from red to green (or vice versa), it could signal a change in direction.
・Compare APB, Heikin Ashi, and Default Candles: For confirmation, compare APB and Heikin Ashi signals with default candlesticks to ensure reliability before entering a trade.
Benefits:
・Customizable Visualization: You can quickly switch between different candle types, depending on your strategy, without changing your chart setup.
・Clear Trend Identification: APB and Heikin Ashi candles help filter out noise, making it easier to see trends and reversals.
・Multiple Timeframes: Works well on multiple timeframes, allowing for flexible trading strategies.
Drawbacks:
・Smoothing May Hide Important Details: While APB and Heikin Ashi smooth price action, they might obscure key price points or signals on smaller timeframes.
・Potential Over-Reliance on Visuals: Relying too much on smoothed candles might cause traders to miss underlying market conditions or important price levels visible in traditional candlesticks.
APBキャンドル(平均価格バー)とヘイキンアシ、デフォルトローソク足のON/OFF制御
説明:
**APBキャンドル(平均価格バー)**は、標準のローソク足やヘイキンアシに比べ、よりスムーズで明確なトレンドの視覚化を提供します。通常のローソク足が生データをそのまま表示するのに対し、APBキャンドルはオープン、高値、安値、終値の平均を計算してノイズを除去し、小さな価格変動をフィルタリングします。これにより、短期的なノイズに惑わされることなく、全体的なトレンドに集中することが可能です。
APBが優れている理由:
・トレンドの把握が容易: APBキャンドルは標準のローソク足よりも価格データを滑らかにし、持続的なトレンドを見つけやすくします。
・市場ノイズの削減: ヘイキンアシもノイズをフィルタリングしますが、APBは実際の価格平均に基づいており、スムージングと実際の価格データのバランスが優れています。
・エントリー・エグジットの明確化: 小さな変動を滑らかにすることで、特にボラティリティの高い市場でのエントリー・エグジットシグナルが明確になります。
主な機能:
1.APBキャンドルのON/OFF: 小さな価格変動をフィルタリングし、トレンドを明確に表示します。
2.ヘイキンアシキャンドルのON/OFF: ノイズを取り除き、スムーズなトレンドを視覚化します。
3.デフォルトローソク足のON/OFF: 標準のローソク足との比較を容易にし、戦略に応じて使用可能です。
4.色のカスタマイズ: 上昇時と下降時のローソク足の色を自由に設定可能。
色変化のしきい値設定: APBキャンドルのボディサイズが小さい場合に色を薄くするしきい値を設定できます。
5.カウントダウンタイマー: 各ローソク足の下に、次のローソク足が形成されるまでの残り時間を表示します。
トレード戦略:
・APBでのトレンドフォロー: APBキャンドルを使って、スムーズなトレンドを確認し、ボラティリティの高い市場でトレンドフォロー戦略を取る。
・ヘイキンアシでの反転シグナル確認: ヘイキンアシを使い、上昇(緑)から下降(赤)への色変化を反転シグナルとして利用。
・3種類のローソク足の比較: APB、ヘイキンアシ、デフォルトローソク足を比較し、トレンドや反転の信頼性を確認してからエントリーする。
メリット:
・カスタマイズ性が高い: 戦略に応じて3種類のローソク足を自由に切り替え可能。
・トレンドの把握が容易: ノイズを除去してトレンドや反転を明確に把握できる。
・複数タイムフレームで効果的: 複数のタイムフレームで利用可能なため、柔軟な戦略が立てられる。
デメリット:
・重要な情報の隠蔽の可能性: APBやヘイキンアシのスムージングにより、小さな価格変動や重要な価格ポイントが隠れる可能性がある。
・視覚的な判断に依存しすぎるリスク: スムーズなローソク足に頼りすぎることで、標準的なローソク足で確認できる重要な情報を見逃す可能性があります。
注意書き:
1.インジケーターの突然の変更や削除の可能性: このインジケーターは今後予告なく変更や削除される場合がありますのでご注意ください。
2.損失の責任について: このインジケーターを使用したことによる損失に関して、作者は一切の責任を負いません。トレードは自己責任で行ってください。
Volume Delta [hapharmonic]Volume Delta: Volume Delta is an indicator that simplifies how you analyze trading volumes and the percentage of buy-sell activities effortlessly.
As a trader or market analyst, understanding underlying volume and trade flows is critical. The Volume Delta indicator provides thorough insight into both the total volume and the percentage of buying versus selling within the current candlestick. This information is pivotal for those looking to gauge market momentum and sentiment more effectively.
Additionally, the Volume Delta indicator can plot the candlestick colors based on the percentage of the dominant buying or selling volume. The area between the open and close prices of the candlestick is considered 100% and fills with colors corresponding to the predominant volume at that percentage.
Volume Delta also integrates the concept of Net volume. This component is crucial as it reveals the real market sentiment by calculating the difference between the volume of trades executed at an uptick and those at a downtick.
🟠 Overview
This indicator now displays in two layouts. Recently, Tradingview introduced the "force_overlay=true" function in Pine Script , allowing plots to be moved to the main chart. Thus, all displays are from the same indicator.
🟠 USAGE
From the data displayed in 'plot.style_columns' , the peak area represents the entire volume, accounting for 100%. Within this area, there are two color levels indicating volume. If one type of volume, whether buying or selling, exceeds the other, the larger volume will be positioned behind and the smaller in front. This arrangement prevents the scenario where a higher buying volume obscures the smaller selling volume. Therefore, the two colors can be switched between the front and the back as needed.
As you can see, the 12 and 26-day Exponential Moving Averages (EMAs) are used, with the Volume Confirmation Length set at 6. Therefore, the crossing of the EMAs proceeds normally, but it is highlighted with three triangular arrows to indicate a high likelihood of a valid crossover. However, if the volume is insufficient, these markers won't be displayed, although the EMA crossover will still occur as usual. This can be useful for using volume to verify the significance of the EMA crossover.
🟠 Setting
If you enable the label, please be aware that the chart size will shrink, causing the candlestick display to become unclear. Therefore, you might need to select "Logarithmic" at the bottom right of your screen, or for mobile applications, press and hold on the price scale and choose "Logarithmic" to adjust the scale appropriately.
Enjoy!
Price Action in action
What?
Price Action in Action is an indicator to help Price Action learners and practitioners to get everything related for Price Action in one place.
Price Action is:
Price + Volume = Action
In this indicator, we have the following features available:
Support/Resistance
Using the RSI with different periods in a multiple of 7 (7, 14, 21, 28), we first determine the overbought (above 70, customizable) and oversold (below 30, customizable) regions. Then we pick up the highest point and lowest point in the RSI values in the overbought and oversold regions, respectively. These are the point, historically supply/demand emerged for surety to push down/up the RSI indicator and the corresponding price. So, these are the most accurate way, we believe, to draw support/resistance (or demand/supply) in the chart. By default, the Support is green color and Resistance is red color. To give a visual representation, we differentiate the different shades of green and red. For example, for Level-1 (i.e. 7 by default) we use the darkest shade (0 transparency) and Level-4 (i.e. 28 by default) we use lighter shade (60 transparency). Note please: you can customize the color of support and resistance lines (say if you want resistance as green and support as red). The respective shades (transparency) will be automatically adjusted accordingly. But those shade (transparency) levels are not customizable, they are fixed (please bear with it for version-1 at least).
Strength of Support/Resistance
In the chart above/below the Resistance / Support lines you can see the tiny labels with some numbers like 1, 2.
We found out how many times a particular support/resistance is appearing across multiple RSI periods. E.g. if price P1 appears 2 times among 4 different RSI periods, the number will be 2 for that calculation, and so on.
There can be multiple presence of these numbers in a support/resistance line (i.e. multiple tiny labels). Something like: 1, 1, 2 (into different candles). This means the same support/resistance is tested so many times in different occasion (means there is a RSI max/min coincides in this level over multiple occasions) at different candles.
This will help you to intuitionally gauge the “strength” of a support/resistance line.
The more the marrier, unworthy to mention.
Candle Stick Patterns
Well: we don’t need to tell anything about the Candlestick. All of you know it better than us. And it’s a time proven, zero-lag mechanism to judge the Price-Action is unfolding in the market. We do not know if there is anything better possible than this time tested patterns to judge the prevailing sentiments of market.
Price-Action does not complete without finding out the Candlestick Patterns correctly.
And in this indicator your will get all of these: Single Candle such as Doji (default off), Marubozu, Spinner, hammers, inverted-hammer etc. ; 2 candles like Tweezer, Inside Candle, Engulfing; 3 candles like morning star/evening star.
In the multi candle patterns (2/3 candles), we are grouping the candles with a dotted rectangle such that it is clear which 2/3 candles are part of the pattern. E.g. Morning Star: 3 candles are grouped in a dotted rectangle and the Morning Star label will come to the latest candle (3rd most – as the pattern is detected reliably only on the completion of the 3rd final candle).
Of course, any program can not eliminate your trained eyes and brain to capture the patterns. But we have provided sufficient knobs to adjust various parameters to tweak the candle-pattern detection. Such as Strict Inside Candle(Harami) Boolean knob where the whole current candle including wicks will be inside the body part of the previous big candle. For non-strict mode, the current candle just inside the previous candle, possibly by wicks.
To make it better usable, for every such knobs (which are not obvious) we have added user-friendly tooltip (just mouse hover the question mark (?) besides the control/switch). There are plenty of it.
Volume
Here we have a rudimentary (yet effective) way to judge the volumes.
We find out the Volume Weighted Moving Average (VMWA) of the 20-period (default, but customizable) and the latest volume. If the latest volume is more than the 20 period vwma, we just add a grey diamond on the top of the candle to denote it’s attracting volumes. Of course, we provide a Weight coefficient (default is set to 1). So if the current bar’s volume on bar’s completion is more than the 20 period volume vmwa times the weigh-cofficient, we mark it with a tiny grey diamond.
Points to be noted:
In all places we mark the indication only on the completion of the bar (technically speaking we have checks, as far as possible, with barstate.isconfirmed). However, if you wish, you can turn it off for Candlestick (as some experts may want to check candlestick on the real time, even before the closing of bars).
In case if you see the chart looks cluttered (because of many information, specially in smaller timeframes like 5 min), there are controls given in the settings to toggle each and every features.
By default, we turn off Doji candles (all 3 types of Doji’s – normal, Gravestone & Dragonfly) as they are mainly indecision. However, you can toggle it to turn it on.
It does not give you any Buy/Sell call. The interpretation it does not have.
Why?
What’s unique in it?
As we already mentioned our intention is to include Price (in forms of Support / Resistance), Volume and Action (sentiments in terms of Candlestick patterns) into a single place. And so far, to the best of our knowledge, we could not come across a single indicator provides all of these.
There were works available to determine the RSI based support / resistance zones. Those are great piece works at that time (lets say 3 years back when PineScript was in earlier versions). To the best of our knowledge those does not cover up finding out the lowest / highest point of RSI and the corresponding price to get the simplistic and distinct support/resistance lines.
We have the intuitive support/resistance strength included which we could not found out in current set of available indicators.
To the best of our knowledge, there seems no indicator can detect 3-candle patterns which are extremely popular to detect trend reversals (such as Morning Star or Evening Star). Moreover for the multi-candle patterns we are grouping the candles part of the pattens (2-candles or 3-candles) using a dotted rectangle such that it’s visually clearly (and a well educative material for Price-Action learners also).
Mentions:
There are many works which inspire us along the way. Honestly: we sometimes forgot which all indicators we experimented with. We are sincerely apologetic in case we forgot to mention. A few note-worthy:
There is an indicator from user “repo32” named as “Candlestick Patterns Identified (updated 3/11/15)”. (We could not be able to contact “repo32”). We are inspired from his work that it’s feasible to detect Candlestick patterns.
There is an awesome work done by “RSI Based Automatic Demand and Supply” by user “shtcoinr”. The idea of consulting multiple RSI levels to find out the demand/supply zone we inspired from him. (We did contact “shtcoinr” and got his kind permission to use the concept.)
We are greatly thankful to these abovementioned wizards for their pioneering a-prior work in this front.
And of course, this TradingView platform to provide this abstraction, facilitates and felicitates collaborative contributions.
Ultimately, what’s for you?
That’s the main question. What’s for you?
Price-action comprises of following 3 tasks (at least):
Draw support/resistance lines in the chart.
Once price reaches at the support/resistance line, you fervently look out the candles’ formation to mentally map to the candle patterns. Your aim is divine: You want to judge if the price-action will continue or take a rejection/reversal.
Then you double-confirm with the volume (in a non-overlaid chart below).
Finally take a trade.
For a price-action newbie or seasoned, expert practitioner, you must be doing all the above tasks regularly and manually, in a mechanical, mundane way. There come the humanly subjectivity & the inevitable emotions . This indicator, being a piece of program/code in PineScript latest version v5 , eliminates (or at least, reduces to a great extend) that subjectivity & emotions out of the way of decision making . Thus resulting better yield.
Of course, you can argue that you draw slanted trend lines also. We recommend an already existing indicator by user LuxAlgo named as “Trendlines with Breaks ”, if you wish so.
Disclaimer:
This piece of software does not come up with any warrantee or any rights of not changing it over the future course of time.
We are not responsible for any trading/investment decision you are taking out of the outcome of this indicator.
Happy trading.
Dark Cloud Cover Pattern Trading Setupthis study is another script based on the candlestick pattern . there are a few filters implemented to be applied to the output result to clear out noises. it sounds like finding real Dark Cloud Cover instances are too rare (interesting though!).
Dark Cloud Cover
it is a bearish reversal candlestick pattern where a down candle (typically bearish) opens above the close of the prior up candle (typically bullish) and then closes below the midpoint of the up candle. The five criteria for the Dark Cloud Cover pattern are:
An existing bullish uptrend.
An up (bullish) candle within that uptrend.
A gap up on the following day.
The gap up turns into a down (bearish) candle.
The bearish candle closes below the midpoint of the previous bullish candle.
all these criteria are implemented in code to produce a more accurate result.
please provide me with your valuable comments,
thanks for your attention,
Dark Cloud Backtest This is a bearish reversal pattern formed by two candlesticks within a uptrend.
Consists of an up candlestick followed by a down candlestick which opens lower
than the prior candlestick and closes below the midrange of the prior candlestick.
It is the reverse of the Piercing Line.
WARNING:
- For purpose educate only
- This script to change bars colors.
Flat Combo DetectorFlat Combo Detector (FCD)
Introduction:
The Flat Combo Detector is a unique tool crafted to aid traders in identifying potential trend reversals. Unlike standard indicators that primarily focus on moving averages or oscillators, the FCD bases its signals on specific candlestick patterns that manifest at crucial trend pivot points.
I use it mostly on OANDA:XAUUSD Gold
How It Works:
The logic of the Flat Combo Detector revolves around the formation of consecutive bearish and bullish candles with particular attributes:
Bearish to Bullish Transition:
Primary Candle : A bearish candle where the close is lower than the open and its close is equal to its low.
Following Candle: A bullish candle where the close is higher than the open, and the open approximates its low (within a user-defined tolerance).
Signal : A green triangle plotted below the price bar, indicating a potential shift from a bearish to bullish trend.
Bullish to Bearish Transition:
Primary Candle: A bullish candle where the close is higher than the open and equals its high.
Following Candle : A bearish candle where the close is lower than the open, and the open approximates its high (within a user-defined tolerance).
Signal : A red triangle plotted above the price bar, indicating a potential transition from a bullish to bearish trend.
Usage Guidance:
For traders unfamiliar with Pine Script, using this indicator is straightforward. Once added to the chart, look for the green and red triangle signals. A green triangle below a price bar suggests a possible bullish reversal, while a red triangle above a price bar hints at a potential bearish reversal. Always consider these signals in conjunction with other technical analysis tools and the broader market context to optimize decision-making.
Associated Strategy:
I've also developed a trading strategy that utilizes these specific entry points identified by the FCD. If you find the signals from this indicator helpful, you might also be interested in exploring the strategy for a comprehensive trading approach. Always remember to backtest and validate any strategy before live trading.
Chart Presentation:
The published chart associated with this script has been kept clean to ensure clarity. Users will only observe the main price bars/candles along with the green and red triangle signals generated by the FCD.
Conclusion:
The Flat Combo Detector provides traders with a fresh perspective on trend reversal points. Its focus on specific candlestick patterns makes it a valuable tool, especially when used in combination with other technical indicators. Always ensure to practice prudent risk management and consult multiple analysis methods before making trading decisions.
Fair Value Gap - FVG - HistogramThis indicator uses a histogram to represent "fair value gaps" ("FVG"). FVG is a popular pattern among modern traders.
This document describes the purpose of the script and discusses the conceptual meaning of "fair value," as well as the connotations attached to it.
█🚀 Based on the previous script - improved clarity
This indicator is a modified version of the "Three Bar Gap (Simple Price Action - with 1 line plot)" indicator, which is also available as open source and can be applied to a chart as a complementary tool along with this indicator.
Differences:
The previous version introduced a "Threshold filter" to reduce the number of lines plotted on charts. This filter introduced two additional parameters for users to consider (ATR length and multiplier). These parameters made the indicator more complicated than intended.
To address this issue of having too many lines in the former version, I proposed a spin-off on this version: It's to consider plotting the magnitude of the FVGs on a histogram instead of using lines on a price chart. In my opinion, a histogram is more suitable for decision-making because it lays out data points side-by-side as bins, which makes comparisons much clearer.
Minor FVGs are expected to have smaller bins compared to their neighboring bins, and in extreme cases, the bins will become seemingly invisible due to the auto-adjusted scale of the y-axis. Therefore, there is no need to filter out any data, and all FVGs can be included in this spin-off version.
█🚀 Candlestick patterns - revisited
This script calculates the displacement of highs and lows over three consecutive bars.
A) Down move: When the high of the recent-confirmed bar is lower than the low of the previous-previous candle.
B) Up move: When the low of the recently-confirmed bar is higher than the high of the previous-previous candle.
█🚀 Parameters
Core Functionality
The purpose of this indicator is to generate bins representing the magnitude of FVGs in the form of a histogram to facilitate the visualization of price movements.
The act of "finding FVGs" does not require any inputs, but users can still customize the colors of the bins to indicate the direction of movement.
Auxiliary functionality: “Key level finder” by searching for large FVGs
The following inputs are optional, in fact, the entire feature can be toggled on/off.
In this example, setting the lookback at 20 means the script will generate a signal if the current histogram bin is taller than all previous bins over the past 20 bars.
█🚀 Applications
Tall histogram bins = key levels .
Traders should observe key levels for entry or exit opportunities.
It is important to note that this indicator was designed for standard time-based charts.
On a separate note, FVGs will not appear in Renko charts with fixed-size bricks. This is because the bricks align with their neighboring bricks. When the bricks are fixed, any displacement between highs and lows within less than or equal to three bars will be zero.
The concept of a "gap" is used to illustrate that price follows a jump-diffusion process, and time intervals can be assigned arbitrarily on the x-axis without needing fixed intervals. This idea was briefly discussed in the previous script's write-up.
█🚀 FAQ: Does it repaint?
No. And please continue reading.
Bins are plotted with a one-bar delay. It only takes one bar for the FVG to become confirmed. Lag is beneficial because it clarifies the need for traders to wait for the bar to close and for the signals to become confirmed before entering or exiting a trade. Experienced traders know that prices tend to retrace, so there is no need to chase. An added bar of delay proves to be useful.
█🚀 Opinion: The term “fair value” can be misleading
Those who come from traditional finance may find the term "fair value gap" somewhat insulting. When encountering the phrase, it can feel like a group of aliens from "Planet Technical Analysis" have intrusively landed on your planet and assertively redefined what "fair value" is supposed to mean.
So, what does "fair value" mean in the realm of technical analysis?
In the world of corporate finance, "fair value" is a subjective estimate of what buyers and sellers are hypothetically willing to pay or accept. Buy-side and sell-side analysts use their own methodologies to determine what constitutes "fair value". These approaches may be based on income, asset, or market comparables. Regardless of the approach used, subjectivity is inherent, and results depend on fundamental data provided by the numbers on financial statements. Valuations are unrelated to candlestick patterns .
When dealing with financial statements, finance professionals who are non-market-participants, such as those working in group reporting practices for reporting issuers, or those hired as external auditors, as required by regulators, may also question what constitutes "fair value". The main concerns always revolve around the assumptions used in valuation models; these are inputs that ultimately require management's judgment, and if not critically questioned, valuations as reported in the statements could end up becoming materially bogus. Both IFRS and U.S. GAAP define "fair value" with the same intended meaning in terms of definitions. We will not delve into the details here. The main point is that "fair value" from a financial reporting perspective has nothing to do with candlesticks .
If a price is already quoted in an actively traded market, you can refer to it to obtain what is known as "mark-to-market". This involves simply referring to the bid or ask price on the reporting date, and you're done - there's no need to read candlesticks !
"Fair value" is a neutral term used by finance professionals in all domains. It is not meant to imply that something is actually "fair." Paying the "fair value" for an asset can still result in overpaying or underpaying for what the asset is worth, depending on different model assumptions. The point is, candlesticks are irrelevant to the analysis of what is considered "fair value" in the realm of traditional finance.
That being said, there is no definitive answer as to why people refer to this pattern as a "fair value gap". It's like one of those oddball interview questions asking you to explain why tennis balls are fuzzy. Whatever answer you give, it's important to note that the subject itself is trivial.
Emphasis of matter on why "fair value" can be misleading
The previous paragraphs were not intended to attack ideas from the realm of technical analysis, nor to assert the true meaning, or lack of meaning, of the term "fair value". Words are constantly evolving. If the term "fair value gap" becomes more widely used to describe the displacement of highs and lows over three bars, then let's call it a "fair value gap".
To be clear, I argue that the term "fair value gap" should not be given a positive connotation. Traders should interpret the word "fair" neutrally. Although these signals occur frequently, if you trade every time there is a signal, you will overtrade and incur astronomical transaction costs over the long run, which can lead to losses.
█🚀 Conclusion:
In the end, what matters is how you apply FVG to trading. As mentioned in the "Applications" section above, traders should look for large FVGs - indicated by tall histogram bins - to identify key levels.
VIX CANDLESThe VIX CANDLES indicator is designed to visualize the Williams VIX Fix, a volatility measure that mimics the VIX index but applies to different financial instruments.
This indicator calculates a custom "VIX-like" value based on the highest close over a specified look-back period and plots the result as candlesticks. It also includes an Exponential Moving Average (EMA) to help identify trends and potential buy/sell signals.
Williams VIX Fix Calculation: Measures volatility by comparing the current low to the highest close over the given period, then expressing the result as a percentage.
Custom Candles: The VIX Fix is displayed as a set of candlesticks where the body is colored based on whether the close is higher (green) or lower (red) than the open.
Exponential Moving Average (EMA): An EMA is applied to the VIX Fix value to smooth the data and identify trend changes. The EMA's length is customizable.
Trade Direction Labels: Labels are plotted when the VIX Fix crosses above or below the EMA, signaling potential buy (▽) or sell (△) opportunities.
Customization: Colors for the candlesticks and EMA, as well as the look-back period and EMA length, can be adjusted to suit your preferences.
This indicator is useful for traders looking to track volatility and identify potential trend shifts in the market. By combining the Williams VIX Fix with an EMA, it provides a more dynamic view of market conditions, helping traders spot extreme volatility and adjust their strategies accordingly.
Bullish and Bearish Harami DetectorHere’s a description of the script I built for you, designed for a **TradingView public indicator**:
### **Custom Bullish and Bearish Harami Detector with Timeframe Selection**
This custom Pine Script detects **Bullish Harami** and **Bearish Harami** candlestick patterns on the selected timeframe, with configurable settings for how many prior candles to consider for pattern detection.
---
### **Features:**
1. **Timeframe Selection:**
- **Input Field for Timeframe**: The script allows users to choose the timeframe for detecting patterns. For instance, you can set it to 1 hour, 4 hours, or even daily candles, ensuring the detection works as per your chosen market view.
- This is controlled by the `input.timeframe` function, and the user is prompted to select the desired timeframe (e.g., "1h", "4h", "1d").
2. **Enable/Disable Pattern Detection:**
- The user has the flexibility to enable or disable the detection of **Bullish Harami** and **Bearish Harami** patterns.
- The two toggles `detectBullishHarami` and `detectBearishHarami` allow users to turn on/off the detection for each pattern type.
3. **Customizable Bearish Candle Count for Bullish Harami:**
- The user can define how many prior **bearish candles** should be present before a **Bullish Harami** can be detected.
- The input variable `bearishCandleCountBullish` lets you choose how many previous bearish candles to consider for detecting a **Bullish Harami** (for example, the last 3, 5, or 6 bearish candles).
4. **Customizable Bullish Candle Count for Bearish Harami:**
- Similar to the Bullish Harami, the script allows the user to define how many prior **bullish candles** should be present before a **Bearish Harami** pattern is detected.
- The input variable `bearishCandleCountBearish` lets you select how many previous bullish candles to check for **Bearish Harami**.
5. **Pattern Detection Logic:**
- **Bullish Harami**: Detected when a bearish candle (open > close) is followed by a smaller bullish candle (open < close) where the entire body of the second candle is contained within the body of the first candle.
- **Bearish Harami**: Detected when a bullish candle (open < close) is followed by a smaller bearish candle (open > close) where the entire body of the second candle is contained within the body of the first candle.
- Both patterns are subject to the user-defined conditions (number of previous bearish or bullish candles).
6. **Visual Indicators:**
- **Bullish Harami**: A green label is plotted **below the bar** to indicate a **Bullish Harami** pattern.
- **Bearish Harami**: A red label is plotted **above the bar** to indicate a **Bearish Harami** pattern.
- The labels are displayed using the `plotshape` function with custom colors and text.
7. **Additional Settings**:
- The script includes tooltips and descriptions for each input to make the settings clear for users, allowing even those unfamiliar with candlestick patterns to understand and use the indicator effectively.
---
### **How It Works:**
- The script first checks the specified timeframe and identifies the current and previous candlesticks.
- It then applies the user-defined conditions for detecting the **Bullish Harami** and **Bearish Harami** patterns by checking the relative positions and sizes of the candlesticks over the selected number of previous candles.
- Once a pattern is detected, it plots a label on the chart (green for **Bullish Harami** and red for **Bearish Harami**) at the appropriate location (below or above the candle).
- The script updates dynamically as the price action unfolds.
---
### **Use Cases:**
- **Traders**: This script is useful for traders who want to identify reversal patterns like **Bullish Harami** and **Bearish Harami** on their chosen timeframes and adjust the sensitivity by changing the number of prior candles for pattern detection.
- **Customization**: Users can fine-tune the script’s settings based on their specific trading strategy, adjusting both the timeframe and the number of candles for pattern detection.
---
### **Conclusion:**
This indicator is an effective tool for detecting candlestick patterns, specifically **Bullish Harami** and **Bearish Harami**, on **TradingView**. By allowing customization in terms of timeframe and the number of prior candles to consider, users can tailor the script to fit their trading strategy and market conditions.
Wick %Heyo Fellas,
thanks for checking out my new indicator.
Introduction
Wick % is a simple indicator to compare wick size with body size (mode 1) and to compare wick size with candle size (mode 2).
Upper wicks are bullish when close is higher than open pricen.
Lower wicks are bearish when close is lower than open price.
Wick Theory
In general, big wick and small bodie on a bar means that bull and bears are fighting heavily.
A big wick below the body means the bulls are leading in that fight,
and a big wick above the body means the bears are leading in that fight.
Calculation Formula
Mode 1 – Percentual Increase Wick/Body:
upperWickPercentage = (upperWick / body) * 100 - 100
lowerWickPercentage = (lowerWick / body) * 100 - 100
Mode 2 – Percent Wick/Candlestick:
upperWickPercentage = (upperWick / (high - low)) * 100
lowerWickPercentage = (lowerWick / (high - low)) * 100
Usage
You can use it on every symbol and every timeframe.
The indicator repaints by default, but you can disable it in the settings.
When you disable repaint, it moves the label one bar to the right.
If you want to use the indicator for signals, you must disable repainting.
Best regards,
simwai
Infiten's Return Candle OscillatorInfiten's Return Candle Oscillator is an oscillator which shows the percentage return on the open, high, close and low over a customizable period in the form of candlesticks. It may be helpful for seeing volatility, swing trading, or mean reversion trading.
The RCO consists of two plotted elements :
RCO Candles (short length): candlesticks which are plotted with low = the product of the percentage changes in the low over a period, high = the product of the percentage changes in the high over a period, close = the product of the percent changes in close over a period, and open = the product of the percentage changes in return over a period. Similarly to with standard candlesticks, if the percentage change on the close is higher than the percentage change on the open, the candlestick is green, otherwise it is red.
Smoothed RCO Line (long length) : a moving average of the average of the low, close, open and high calculated for the RCO Candles. The line's transparency is determined by the percentage difference between the RCO and the highest or lowest RCO over the long length. A more transparent line means that the RCO is closer to the highest or lowest RCO, and may be indicative of a reversal, or weakening trend.
Directional filter VERSION 2The idea is to make it more visible if the moment is to seek buying or selling, based on moving averages, being SMA 21 and EMA 9.
best BUYBAR has the EMA9 and SMA21 rising and closing above them. "relevance A"
best SELLBAR has the EMA9 and SMA21 dropping and closing below them. "relevance A"
Conditions for all colors of the candlesticks:
BuyBar A = price closes above EMA9 and SMA21 with EMA9 and SMA21 rising.
BuyBar B = price closes above SMA21 with SMA21 rising OR price closes above EMA9 and SMA21.
BuyBar C = price closes above EMA9 with EMA9 rising and SMA21 falling.
BuyBar Neutral = close> open.
SellBar A = price closes below EMA9 and SMA21 with EMA9 and SMA21 falling.
SellBar B = price closes below SMA21 with SMA21 falling OR price closes below EMA9 and SMA21.
SellBar C = price closes below EMA9 with EMA9 falling and SMA21 rising.
SellBar Neutral = close abertura.
SellBar A = preço fecha abaixo de EMA9 e SMA21 com EMA9 e SMA21 caindo.
SellBar B = preço fecha abaixo de SMA21 com SMA21 caindo OU preço fecha abaixo de EMA9 e SMA21.
SellBar C = preço fecha abaixo de EMA9 com EMA9 caindo e SMA21 subindo.
SellBar Neutral = fechamento < abertura.
As medias moveis também alteram de acordo com a direção em que estão:
EMA 9 subindo = azul
EMA 9 caindo = laranja
SMA 21 subindo = verde
SMA21 caindo = vermelho
Trident Pattern [SpeculationLab]This indicator is based on the increasingly popular Trident strategy, and is best suited for the 30-minute timeframe. It performs particularly well on naturally bullish instruments such as gold, Bitcoin, and Nasdaq.All components of this indicator are original work by Speculation Lab.
Rather than stacking random features, this script is designed as a modular structure where each part works in synergy to build the Trident logic.
🔧 Modules Included:
Session Highlight — Visual display of the London Kill Zone
5 Customizable EMAs — Fully adjustable length, color, and toggling
Bullish Fair Value Gap (FVG) detection
Four types of Doji candlestick recognition
🧫 Logic Breakdown:
1. Time Session Filter
By default, the indicator highlights the London Kill Zone, defined as 03:00–06:30 New York time.Users can freely adjust the time zone, time range, and background color, with preconfigured zones including New York, London, Tokyo, Shanghai, and Sydney.
⚠️ Note: To maintain flexibility, the London Kill Zone is not enforced as a mandatory entry condition.
Users may apply it as an optional filter based on their own trading style.
2. 5 EMA Trend Filter
The script uses a five-EMA structure to confirm market trend.The default EMA lengths are 5, 9, 13, 21, and 200.A valid entry requires:
EMAs 5, 9, 13, 21 stacked in descending order
AND the 1-hour close is above EMA(200)
All EMAs are fully customizable and can be toggled on/off.
3. Bullish Fair Value Gap (FVG)
Bullish FVGs are detected using a 3-bar logic, from high to low .To filter noise, the gap must be greater than 0.7 × ATR(14) by default.Both the ATR period and multiplier are adjustable.
The FVG Extend setting has two roles:
It controls how many bars the FVG box extends to the right (default: 20)
It defines the active window for confirming entries within the FVG zone
Users can fully customize the box color, text, and center line.
4. Doji Detection
The script detects four types of Doji candlesticks:
Standard Doji
Long-legged Doji
Dragonfly Doji
Gravestone Doji
The Body Ratio setting controls how small the candle body must be relative to the full range (default ≤ 0.1).Long Wick Ratio and Short Wick Ratio further help fine-tune wick length criteria.
✅ Entry Signal Logic:
A Trident entry is confirmed when all the following conditions are met:
Trend Filter Passes
EMAs are stacked: 5 > 9 > 13 > 21
1H close is above EMA(200)
A Doji candle appears inside an active FVG zone
The next candle closes below the Doji’s high
If all conditions are satisfied, a Trident signal is triggered at the close of the confirming candle.
⚠️ Disclaimer
This indicator is intended for educational and research purposes only. It does not constitute financial advice or trading signals.Trading involves high risk. Please act according to your own risk management.Speculation Lab and the author bear no responsibility for any financial outcomes resulting from the use of this script.
本指标基于近年来日益流行的 Trident(三叉戟)策略,推荐使用在 30分钟时间框架,尤其适用于黄金、比特币、纳斯达克等具有自然上涨倾向的交易品种。本指标由 Speculation Lab 原创开发,结构严谨,逻辑清晰。
本指标采用模块化设计,各部分功能相辅相成,共同构建三叉戟策略逻辑,而非杂乱堆砌。
🔧 指标包含以下功能模块:
交易时段高亮 — 默认显示 伦敦杀戮区
五条可调节 EMA 均线 — 长度与颜色可自定义,模块可单独开关
看涨 Fair Value Gap(公平价值缺口)检测
四种 Doji(十字星)K线形态识别
🧫 逻辑说明:
1. 交易时段过滤
默认高亮显示的伦敦杀戮区为 纽约时间03:00–06:30。用户可自由调整 参考时区、具体时段和 背景颜色,支持预设时区包括纽约、伦敦、东京、上海和悉尼。
⚠️ 说明:为保持策略灵活性,伦敦杀戮区并非强制入场条件。
是否采用此过滤,可由用户自行决定。
2. 趋势过滤(五条EMA)
该指标采用五条 EMA 来确认市场趋势。默认长度为 5、9、13、21、200。入场信号要求满足以下条件:
EMA 5、9、13、21 从上到下依次排列(多头排列)
且 1小时图上的收盘价高于 EMA200
所有均线均可单独启用/关闭,长度与颜色均可自定义。
3. 看涨 FVG 区域识别
FVG 使用 3 根K线结构进行检测,从 high 到 low 。默认要求缺口 大于等于 0.7 × ATR(14),以过滤微小无效缺口。ATR周期与乘数均可自定义设置。
“FVG Extend”参数有两个作用:
控制图表上 FVG 区域箱体的右延伸长度(默认20根K线)
用作 FVG 活跃期的判断标准,仅在此区间内出现的 Doji 才会被视为有效信号触发条件
用户可自由设置 FVG 的背景颜色、文字样式与中线颜色。
4. Doji(十字星)识别
支持以下四种常见 Doji 形态识别:
标准十字星
长腿十字星
蜻蜓线(下影线长)
墓碑线(上影线长)
“Body Ratio” 控制实体占K线全长的比例,默认不超过0.2。“Long Wick Ratio” 与 “Short Wick Ratio” 可进一步调节影线长度识别标准。
✅ 入场信号逻辑:
符合以下所有条件时,触发三叉戟入场信号:
趋势过滤通过
EMA 依次排列为 5 > 9 > 13 > 21
且 1小时收盘价高于 EMA200
在 FVG 区域内出现有效 Doji 十字星
下一根K线收盘价 低于 Doji 的最高价
若以上条件均满足,则在确认K线收盘时触发三叉戟入场信号。
⚠️ 免责声明 Disclaimer
本指标旨在提供技术分析工具,仅用于教育与研究目的,不构成任何投资建议或交易指令。交易具有高风险,请根据自身风险承受能力合理操作。使用本脚本所导致的任何盈亏,作者与 Speculation Lab 不承担任何责任。
Bullish & Bearish Engulfing ProHello Traders!
Overview
The Bullish & Bearish Engulfing Pro indicator is a powerful pattern recognition tool that identifies key reversal points and trend continuation opportunities. These engulfing patterns often mark the beginning of a significant price move and are widely used in technical analysis. For example, in an uptrend, a Bullish Engulfing pattern can provide an ideal pullback entry signal.
This indicator combines traditional candlestick theory with advanced technical filters like trend direction and volatility analysis to offer traders precise, high-confidence signals.
Key Features :
Accurate pattern detection:
Uses refined algorithms to detect true Bullish and Bearish Engulfing patterns, filtering out noise and false positives.
Trend filter:
Customizable Simple Moving Average (SMA) ensures trades are aligned with the market’s broader trend, improving trade success rates.
Volatility awareness:
ATR-based filtering ensures that only statistically significant engulfing patterns are highlighted.
Visual clarity:
Bullish and Bearish Engulfing patterns are displayed with distinct, customizable colors and labels for instant recognition.
Flexible customization:
Users can adjust detection criteria, SMA settings, and visual options to suit their personal strategy.
Filtered signal display:
Option to visualize filtered-out signals to better understand how the logic makes its decisions.
Bullish Engulfing Pattern
Appears after a downtrend or during a pullback in an uptrend
Consists of two candles
A smaller bearish candle
Followed by a larger bullish candle that completely engulfs the previous body
Bearish Engulfing Pattern
Appears after an uptrend or during a pullback in a downtrend
Consists of two candles
A smaller bullish candle
Followed by a larger bearish candle that completely engulfs the previous body
Key differences in this implementation
What makes this indicator unique
Trend and volatility filters
Ensure patterns occur in meaningful market conditions
Comprehensive pattern analysis:
Factors in candle body ratios, wick sizes, and relative size to past candles for smarter detection
Adaptive to market conditions:
Dynamic thresholds based on ATR allow pattern recognition to adjust to different volatility regimes
Educational value:
Visualizing rejected patterns helps traders build intuition and refine their discretion
How to Trade with this Indicator
Engulfing patterns can signal strong reversals or pullback continuations. Use them with trend and volume confirmation to maximize their effectiveness.
snapshot
Bullish Opportunities:
Look for Bullish Engulfing patterns (aqua-colored candles and labels) during or after a pullback in an uptrend.
Bearish Opportunities:
Watch for Bearish Engulfing patterns (orange-colored candles and labels) during or after a rally in a downtrend.
Entry: Enter on the next bar open after the engulfing candle completes.
Stop loss: 2 ticks below/above the engulfing candle’s low/high.
Take profit: Aim for at least a 2R target, a swing high/low or manage the tradewith a trailing stop.
Trend Alignment:
For higher win probability, take trades only in the direction of the SMA-defined trend.
Note: To ensure the candle coloring appears correctly, place the indicator at the top of the object tree.
Intrabar Volume Distribution [BigBeluga]Intrabar Volume Distribution is an advanced volume and order flow indicator that visualizes the buy and sell volume distribution within each candlestick.
🔔 Before Use:
Turn off the background color of your candles for clear visibility.
Overlay the indicator on the top layout to ensure accurate alignment with the price chart.
🔵 Key Features:
Inside Bar Volume Visualization:
Each candlestick is divided into two columns:
Left column displays the sell % volume amount.
Right column displays the buy % volume amount.
Provides a clear representation of buyer-seller activity within individual bars.
Percentage Volume Labels:
Labels above each bar show the percentage share of sell and buy volume relative to the total (100%).
Quickly assess market sentiment and volume imbalances.
Point of Control (POC) Levels:
Orange dashed lines mark the POC inside each bar, indicating the price level with the highest traded volume.
Helps identify key liquidity zones within individual candlesticks.
Multi-Timeframe Volume Analysis:
The indicator automatically uses a timeframe 20-30 times lower than the current one to gather detailed volume data.
For each higher timeframe candle, it collects 20-30 bars of lower timeframe data for precise volume mapping.
Each bar is divided into 100 volume bins to capture detailed volume distribution across the price range.
Bins are filled based on the aggregated volume from the lower timeframe data.
Lookback Period:
Allows traders to select how many bars to display with delta and volume information.
The beginning of the selected lookback period is marked with a gray line and label for quick reference.
Indicator displays up to 80 bars back
🔵 Usage:
Order Flow Analysis: Monitor buy/sell volume distribution to spot potential reversals or continuations.
Liquidity Identification: Use POC levels to locate areas of strong market interest and potential support/resistance.
Volume Imbalance Detection: Pay attention to percentage labels for quick recognition of buyer or seller dominance.
Scalping & Intraday Trading: Ideal for traders seeking real-time insight into order flow and volume behavior.
Historical Analysis: Adjust the lookback period to analyze past price action and volume activity.
Intrabar Volume Distribution is a powerful tool for traders aiming to gain deeper insight into market sentiment through detailed volume analysis, allowing for more informed trading decisions based on real-time order flow dynamics.
Strategy without indicators v11. General Script Strategy
The objective of this strategy is to open buy or sell orders every new hour based on:
Whether the previous candle closed high (buy) or low (sell).
The presence of tops and bottoms to avoid opening orders at times of possible reversals.
The strategy also allows the user to set a date range (start date and end date) to calculate profit, loss, percentage of gain and percentage of loss only in that period.
2. Initial Settings and Parameters
Start Date and End Date: The start_date and end_date variables define the date range to account for profits and losses. These dates can be adjusted by the user to view results in specific periods.
3. Conditions for Order Entry
At each time change, the script checks the conditions for buying or selling, using the following variables and logic:
Detection of Bullish or Bearish Candle:
bullish_candle: True if the previous candle closed high.
bearish_candle: True if the previous candle closed lower.
Analysis of Tops and Bottoms:
To avoid opening orders close to tops and bottoms, the script uses the function find_top_and_bottom(period), which analyzes the last 500 candles and identifies the highest value (top) and the lowest value (bottom).
The variables current_top and current_bottom store these values.
next_top and next_bottom indicate whether the current candle is close to a top (prevents buying) or a bottom (prevents selling).
4. Opening Orders (Buy and Sell)
At each time change, the script checks the conditions to open buy or sell orders:
Condition for Sell:
The sell order is opened if the previous candle was bullish (bullish_candle) and is not close to a top (not next_top).
If there is an open buy order, it is closed before the new sell order.
Buy Condition:
The buy order is opened if the previous candle was bearish (bearish_candle) and is not near a bottom (not_near_bottom).
If there is an open sell order, it is closed before the new buy order.
5. Calculating Profit and Loss
The profit and loss calculation is only done within the configured date range (start_date and end_date):
Profit and Loss:
total_profit and total_loss accumulate the profit and loss values of all operations during the defined period.
percentage_gain and percentage_loss calculate the percentage of gain and loss in relation to the initial capital.
6. Displaying Results on the Chart
The script displays on the chart, next to the candles, the information on Total Profit, Total Loss, % Gain and % Loss:
Strategy Summary
Setting the Date Range: Allows you to set the period for calculating profit and loss.
Previous Candlestick Analysis: Decide whether to buy or sell based on the previous candlestick.
Preventing Entries at Tops and Bottoms: Avoids buying at tops and selling at bottoms to reduce false signals.
Result Calculation: Accumulates profits, losses and percentages within the configured date range.
Results Display on Chart: Displays the configured statistics directly on the chart, next to the candlesticks.
1. Estratégia Geral do Script
O objetivo dessa estratégia é abrir ordens de compra ou venda a cada nova hora com base em:
Se a vela anterior fechou em alta (compra) ou em baixa (venda).
A presença de topos e fundos para evitar abrir ordens em momentos de possíveis reversões.
A estratégia também permite que o usuário configure um intervalo de datas (data inicial e data final) para calcular o lucro, perda, percentual de ganho e percentual de perda apenas nesse período.
2. Configurações e Parâmetros Iniciais
Data Inicial e Data Final: As variáveis data_inicial e data_final definem o intervalo de datas para contabilizar os lucros e perdas. Essas datas podem ser ajustadas pelo usuário para visualizar resultados em períodos específicos.
3. Condições para Entrada de Ordens
A cada mudança de hora, o script verifica as condições de compra ou venda, usando as seguintes variáveis e lógicas:
Detecção de Vela de Alta ou Baixa:
vela_de_alta: Verdadeiro se a vela anterior fechou em alta.
vela_de_baixa: Verdadeiro se a vela anterior fechou em baixa.
Análise de Topos e Fundos:
Para evitar abrir ordens próximas de topos e fundos, o script utiliza a função find_top_and_bottom(periodo), que analisa as últimas 500 velas e identifica o valor mais alto (topo) e o valor mais baixo (fundo).
As variáveis topo_atual e fundo_atual armazenam esses valores.
topo_proximo e fundo_proximo indicam se a vela atual está perto de um topo (evita compra) ou de um fundo (evita venda).
4. Abertura de Ordens (Compra e Venda)
A cada mudança de hora, o script verifica as condições para abrir ordens de compra ou venda:
Condição para Venda:
A ordem de venda é aberta se a vela anterior foi de alta (vela_de_alta) e não está perto de um topo (not topo_proximo).
Se houver uma ordem de compra aberta, ela é fechada antes da nova ordem de venda.
Condição para Compra:
A ordem de compra é aberta se a vela anterior foi de baixa (vela_de_baixa) e não está perto de um fundo (not fundo_proximo).
Se houver uma ordem de venda aberta, ela é fechada antes da nova ordem de compra.
5. Cálculo de Lucros e Perdas
O cálculo de lucro e perda só é feito dentro do intervalo de datas configurado (data_inicial e data_final):
Lucro e Perda:
lucro_total e perca_total acumulam os valores de lucro e perda de todas as operações durante o período definido.
percentual_ganho e percentual_perca calculam o percentual de ganho e perda em relação ao capital inicial.
6. Exibição dos Resultados no Gráfico
O script exibe no gráfico, próximo das velas, as informações de Lucro Total, Perda Total, % de Ganho e % de Perda:
Resumo da Estratégia
Configuração de Intervalo de Datas: Permite configurar o período para cálculo do lucro e da perda.
Análise de Vela Anterior: Decide se a ordem é de compra ou venda com base na vela anterior.
Prevenção de Entradas em Topos e Fundos: Evita compras em topos e vendas em fundos para reduzir sinais falsos.
Cálculo de Resultados: Acumula lucros, perdas e percentuais dentro do período de datas configurado.
Exibição dos Resultados no Gráfico: Exibe as estatísticas configuradas diretamente no gráfico, próximo das velas.
Morning & Evening Star Pro (Candle Pattern)Hello Traders!
The Morning & Evening Star Pro indicator often catches the absolute top or bottom of a move and is a reliable reversal indicator. It also provides excellent entries in a strong trending market. For example, in an uptrend you can use a morning star as a pullback entry signal.
The indicator is an advanced tool for identifying powerful reversal patterns in the market. It combines traditional candlestick analysis with modern technical indicators to provide traders with high-probability entry and exit signals.
Key features:
Accurate pattern detection:
Utilizes sophisticated algorithms to identify genuine Morning Star and Evening Star patterns, filtering out false signals.
Trend filter:
Incorporates a customizable Simple Moving Average (SMA) to align signals with the overall market trend, enhancing trade quality.
Volatility awareness:
Integrates Average True Range (ATR) calculations to ensure detected patterns are significant relative to recent price action.
Visual clarity:
Highlights Morning Star and Evening Star patterns with customizable colors and shapes, making them easy to spot on the chart.
Flexible customization:
Offers a wide range of user inputs to tailor the indicator to various trading styles and preferences.
Filtered signal display:
Option to show filtered-out signals, providing insight into the indicator's decision-making process.
Morning Star
Is a bearish reversal (or continuation) pattern consisting of three candles:
A large bearish candle
A small-bodied candle like a Doji or Pin bar
A bullish candle
Evening Star
Is a bullish reversal (or continuation) pattern consisting of three candles:
A large bullish candle
A small-bodied candle like a Doji or Pin bar
A bearish candle
Key differences in this implementation
The middle candle can be either a Doji or a Pin bar, expanding the traditional definition.
The second candle can be a Pin bar, and the third candle can be an outside bar reversal, allowing for more flexibility in pattern recognition.
What makes this indicator unique
Comprehensive pattern analysis:
Goes beyond simple price action by considering multiple factors such as candle body ratios, wick lengths, and relative positions to previous candles.
Adaptive to market conditions:
Uses dynamic thresholds based on recent volatility (ATR) to adjust pattern detection criteria.
Educational value:
The option to display filtered signals helps traders understand why some patterns are rejected, aiding in skill development.
How to Trade with this Indicator:
This indicator often catches the absolute top or bottom of a move and is a reliable reversal indicator. It also provides excellent entries in a trending market. For example, in a strong uptrend you can use morning star signals to enter in a pullback.
Bullish Opportunities:
Look for Morning Star patterns (aqua-colored candles and labels) as potential buy signals.
Bearish Opportunities:
Watch for Evening Star patterns (orange-colored candles and labels) as potential sell signals.
Entry: At next bar open (after the aqua-colored candle for bullish or orange-colored candle for bearish completes)
Stop loss: 2 ticks below/above the pattern's low/high.
Stop loss alternative: If the colored candle is a very strong candle (e.g. for morning star a candle with almost no down wick and a close near the top) the stop goes 2 ticks below/above the colored candle.
Take profit: 3R or use a trailing stop.
Trend Alignment:
For conservative trading, only take trades in the direction of the overall trend as indicated by the SMA.
Note: if you want to see candle coloring of the morning and evening star, you must put the indicator to the top of the object tree.
Gradient Candles
The Gradient Candles indicator is crafted to be a comprehensive replacement for default candlesticks, offering users an enhanced and visually stunning alternative. To experience the intended results and fully immerse in the distinctive features of Gradient Candles, it's recommended to hide the default candlesticks. This ensures that traders can fully appreciate the unique color gradient and dynamic visual representation that this indicator brings to chart analysis.
Designed to elevate chart analysis, Gradient Candles not only offer a fresh perspective on price movements but also captivate users with their visually appealing representation of market dynamics. Departing from traditional candlestick coloration, the dynamic adaptation of colors, the 'color.from_gradient()' function plays a pivotal role in translating the current source value into a color that reflects its proximity to the highest and lowest values and corresponding colors. Beyond its analytical capabilities, Gradient Candles transform market analysis into an aesthetically enriching experience, providing traders with a unique and comprehensive tool for their technical analysis toolkit.
Traders can tailor the indicator's appearance to suit their preferences and seamlessly integrate it into their personal trading environment. From color inversion to transparency adjustments and the option to fill candles instead of outlining them, the customization features empower users to create a visual representation that aligns precisely with their unique preferences.






















