The "Take Double Action Price" (TakeDAP) indicator is a comprehensive tool designed for TradingView, offering a wide range of features to help traders identify key price action patterns, trend directions, and potential trading opportunities. This indicator combines multiple technical analysis methods, including Exponential Moving Averages (EMAs), cloud trends, super trends, and various price action patterns, to provide a holistic view of the market.
Key Features:
Price Action Settings:
Position Loss %: Allows traders to set the potential loss of a position as a percentage, which is used to calculate the required leverage.
Fixed Leverage: Option to enable or disable fixed leverage.
Set Leverage: Specify the total capital when using fixed leverage.
Total Capital: Define the total capital for leverage calculations.
Price Action Patterns:
Pin Bars: Identify pin bars with customizable colors.
Outside Bars: Detect outside bars with customizable colors.
Inside Bars: Recognize inside bars with customizable colors.
PPR Bars: Identify PPR bars with customizable colors.
Candle and Line Customization:
Customize the colors of candles, wicks, borders, and labels.
Adjust the length of label lines, take lines, and stop lines.
Trend Settings:
Show Cloud Trend: Option to display the cloud trend.
Cloud Lookback Period: Define the lookback period for the cloud trend.
Cloud Highligher Colors: Customize the colors for uptrend and downtrend highlights.
Cloud Trend Transparence: Adjust the transparency of the cloud trend.
Exponential Moving Average (EMA):
Show EMA: Option to display EMAs.
Fill EMA: Option to fill the area between EMAs.
EMA Source: Select the source for EMA calculations.
EMA Lengths and Colors: Customize the lengths and colors for up to nine EMAs.
Offset and Transparency: Adjust the offset and transparency of EMAs.
Super Trend:
Show Super Trend: Option to display the super trend.
ATR Lengths and Factors: Customize the ATR lengths and factors for the super trend.
Super Trend Colors: Customize the colors for uptrend and downtrend highlights.
Super Trend Transparence: Adjust the transparency of the super trend.
EMA Trend Bands:
Show EMA Trend Bands: Option to display EMA trend bands.
EMA Trend Deviation: Customize the deviation for EMA trend bands.
EMA Trend Highligter Colors: Customize the colors for uptrend and downtrend highlights.
EMA Trend Transparence: Adjust the transparency of EMA trend bands.
ATR Trend Bands:
Show ATR Trend Bands: Option to display ATR trend bands.
ATR Length and Smoothing: Customize the ATR length and smoothing method.
ATR Take Multipliers: Customize the take multipliers for ATR trend bands.
ATR Trend Highligter Colors: Customize the colors for uptrend and downtrend highlights.
Price Action Signals Source:
Select the source for displaying price action signals based on the price position.
Alerts:
All Price Actions: Alert for any price action pattern formed.
Only Pin-bar: Alert specifically for pin-bar patterns.
Usage: The "Take Double Action Price" indicator is designed to be a versatile tool for traders, providing multiple layers of analysis to help identify potential trading opportunities. By combining price action patterns with trend analysis and moving averages, traders can gain a comprehensive understanding of market conditions and make more informed trading decisions.
Customization: The indicator offers extensive customization options, allowing traders to tailor the settings to their specific trading strategies and preferences. From adjusting the colors and lengths of various elements to selecting the sources for trend and price action signals, traders can fine-tune the indicator to suit their needs.
Explanation
Pin Bar Detection
The function shouldColorCandle takes the open, close, high, and low prices of a candle as inputs.
It calculates the body size (A), the upper wick size (B), and the lower wick size (C) of the candle.
conditionpinDN: A downward pin bar is detected if the upper wick (B) is at least twice the size of the body (A) and the lower wick (C).
conditionpinUP: An upward pin bar is detected if the lower wick (C) is at least twice the size of the body (A) and the upper wick (B).
The function returns two boolean values: conditionpinDN and conditionpinUP, indicating whether the current candle is a downward or upward pin bar, respectively.
PPR Bar Detection
The function isPPR takes the open, high, low, close prices of the current candle and the previous candle (openPrev, highPrev, lowPrev, closePrev) as inputs.
It checks if the current close price is greater than the previous high price and if the previous open price is greater than the previous close price for a bullish PPR.
It checks if the current close price is less than the previous low price and if the previous open price is less than the previous close price for a bearish PPR.
Outside Bar Detection
The function isOutsideBarAbsorption takes the open, high, low, close prices of the current candle and the previous candle (openPrev, highPrev, lowPrev, closePrev) as inputs.
It checks if the current close price is greater than the previous high price and if the current low price is less than the previous low price for a bullish outside bar.
It checks if the current close price is less than the previous low price and if the current high price is greater than the previous high price for a bearish outside bar.
Line Plotting:
The script builds lines for stop and take profit levels, the multiplier of which can be changed in the settings.
For PPR and outside bars, it builds lines based on previous highs or lows with take profit and stop factors.
For Pin bars, it builds lines based on the long wick of the candle with take profit and stop factors.
Leverage Calculation:
The script calculates the stop value based on the high and low prices of the previous and current candles.
It then calculates the leverage value as a percentage of the stop value (the "X:" on the label).
The leverage value is calculated based on the leverage percentage or the fixed leverage value if enabled.
The position value is calculated based on the capital, shoulder percentage, stop value, and set leverage.
EMA Trend Calculation:
Calculates the standard deviation of the selected EMA multiplied by the deviation multiplier and calculates the upper and lower deviation bands and displays the required ones relative to the current price and the short term EMA.
ATR Bands Calculation:
Calculate the upper and lower ATR bands around the selected ATR source and multipliers and determine which ATR band to plot based on the position of the closing price relative to the ATR source.
EMA Extension:
Calculates the absolute difference between the 3rd EMA and the 5th EMA and store previous values when there is a change
A bullish extension is detected if the current difference is greater than the previous difference and 3rd EMA is above 5th EMA.
A bearish extension is detected if the current difference is greater than the previous difference and 3rd EMA is below 5th EMA.
Plots shapes (triangles) on the chart to indicate the detected extensions.