0% found this document useful (0 votes)
18 views46 pages

Naked Options Buy Indicator Guide

The document outlines the Naked Options Buy Indicator and its associated risks, emphasizing that it is for educational purposes only and not investment advice. It details various pivot point methods and technical indicators, including ADX, Ichimoku Cloud, and Bollinger Bands, along with their interpretations and applications in trading. Additionally, it includes a disclaimer about the responsibilities of users in evaluating the information and making independent trading decisions.

Uploaded by

Samrat Sen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views46 pages

Naked Options Buy Indicator Guide

The document outlines the Naked Options Buy Indicator and its associated risks, emphasizing that it is for educational purposes only and not investment advice. It details various pivot point methods and technical indicators, including ADX, Ichimoku Cloud, and Bollinger Bands, along with their interpretations and applications in trading. Additionally, it includes a disclaimer about the responsibilities of users in evaluating the information and making independent trading decisions.

Uploaded by

Samrat Sen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Space for RS 10 NON JUDICIAL STAMP

NAKED OPTIONS BUY INDICATOR

TO BE USED IN RESPECT TO INTERPRETETION AS TAUGHT IN CLASS

DISCLAIMER

There is a very high degree of risk involved in trading. Past results are not indicative of
future returns. Swapnaja Sharma and all individuals affiliated with this assume no
responsibilities for your trading and investment results. The indicators, strategies, columns,
articles and all other features are for educational purposes only and should not be
construed as investment advice. Information for stock observations are obtained from
sources believed to be reliable, but we do not warrant its completeness or accuracy, or
warrant any results from the use of the information. Your use of the stock observations is
entirely at your own risk and it is your sole responsibility to evaluate the accuracy,
completeness and usefulness of the information. You must assess the risk of any trade with
your broker and make your own independent decisions regarding any securities mentioned
herein. Affiliates of Swapnaja Sharma may have a position or effect transactions in the
securities described herein (or options thereon) and/or otherwise employ trading strategies
that may be consistent or inconsistent with the provided strategies.

DISCLOSURE
I understand that Swapnaja Sharma’s Program will prepare me to actively trade
equities/options for my own account. I understand that this course is not preparation to be
a Licensed Broker in the financial industry or will help me get a job.

The Swapnaja Sharma’s Program should not be construed as a recommendation or an offer


to buy or sell any security or the suitability of any investment strategy for a student. The
purchase, sale, or advice regarding any security, other financial instrument or system can
only be performed by a licensed Industry representative; such as, but not limited to a
Broker/Dealer, Introducing Broker, FCM and and/or Registered Investment Advisor. Neither
Swapnaja Sharma’s Training nor its representatives are licensed to make such advisements.
All purchasers of the Swapnaja Sharma’s Program or other Swapnaja Sharma’s Training
products are encouraged to speak with a licensed representative of their choice regarding
the appropriateness of investing/trading or of any particular investment/trading strategy.
The contents given herein is non-transferable and its duty of the undersigned to keep the
confidentiality of the contents and may incur heavy penalty and legal preceding as deemed
fit by Swapnaja Sharma and binding shall be absolute.

________________________
Samrat Sen
Roll-Kol24687/44A-23-22

NAKED OPTIONS BUY INDICATOR

TO BE USED IN RESPECT TO INTERPRETETION AS TAUGHT IN CLASS

Floor Pivot Points:


The floor pivot points are the most basic and popular type of pivots . The pivot point is interpreted
as the primary support/resistance level - the point at which the main trend is determined. First-third
level resistance and support points serve as additional indicators of possible trend reversal or
continuation.

Woodie Pivot Points:


Woodie's pivot points are similar to floor pivot points , the difference being is that more weight is
given to the Close price of the previous period.

Camarilla Pivot Points:


Camarilla pivot points are a set of eight very probable levels which resemble support and resistance
values for a current trend. The most important is that these pivot points work for all traders and help
in setting the right stop-loss and profit-target orders.

Tom DeMark's Pivot Points:


Another popular method of calculating the pivots to forecast the future of the trend is Tom
DeMark's pivot points , which are not pivot points exactly, but are the predicted lows and highs of
the period.

Fibonacci Pivot Points:


Fibonacci pivot point levels are determined by first calculating the floor pivot points . Next, multiply
the previous day's range with its corresponding Fibonacci level. Most traders use the 38.2%, 61.8%
and 100% retracements in their calculations. Finally, add or subtract the figures you get to the pivot
point and you've got your Fibonacci pivot point levels!

Swing Pivot Points:


The only difference with Fibonacci pivot point is that Swing pivots assumes day open as floor pivot
point level and support and resistance levels calculated the same way

Add-Ons

1-ADX Colored Directional Movement Line

Directional Movement (DMI) (created by J. Welles Wilder ) consists of the Average Directional Index
( ADX ), to define whether or not there is a trend present, and Plus Directional Indicator (+D I) and
Minus Directional Indicator (-D I) serve the purpose of determining trend direction

ADX Colored Directional Movement Line is custom interpretation of Directional Movement (DMI)
with aim to present all 3 DMI indicator components with SINGLE line and ability to be added on top
of the price chart (main chart)

How to interpret :
* triangle shapes:
▲- bullish : diplus >= diminus
▼- bearish : diplus < diminus
* colors:
green - bullish trend : adx >= strongTrend and di+ > di-
red - bearish trend : adx >= strongTrend and di+ < di-
gray - no trend : weekTrend < adx < strongTrend
yellow - week trend : adx < weekTrend

* color density:
darker : adx growing
lighter : adx falling

2- Volatility Colored Price/MA Line

Custom interpretation of the idea “Prices high above the moving average (MA) or low below it are
likely to be remedied in the future by a reverse price movement”. Further details can be found under
study “Price Distance to its MA by DGT”

How to interpret :
-▲ – Bullish , Price Action above Moving Average
-▼ – Bearish , Price Action below Moving Average
-Gray/Black - Low Volatility
-Green/Red – Price Action in Threshold Bands
-Dark Green/Red – Price Action Exceeds Threshold Bands

3- Volume Weighted Bars


Volume Weighted Bars, a study of Kıvanç Özbilgiç, aims to present whether volume supports price
movements. Volume Weighted Bars are calculated based on volume moving average.

How to interpret :
-Volume high above the volume moving average be displayed with darker red/green colors
-Average volume values will remain as they are and
-Volume low below the volume moving average will be indicated with lighter colors

note : please be aware that this functionality is subject to re-paint whereas it does not affect the
main idea of this study, Pivot Points

4-Ichimoku Cloud

The Ichimoku Cloud , developed by Goichi Hosoda and published in the late 1960s, is a collection of
technical indicators that give it a unique capacity to show support and resistance levels, momentum
and trend direction. The overall trend is up when price is above the cloud, known as Kumo Cloud,
down when price is below the Kumo Cloud, and trendless or transitioning when price is in the Kumo
Cloud

Traders often use the Kumo Cloud as an area of support and resistance depending on the relative
location of the price. The Kumo Cloud provides support/resistance levels that can be projected into
the future. This sets the Ichimoku Cloud apart from many other technical indicators that only
provide support and resistance levels for the current date and time

Crossovers, also known as TK Cross among Ichimoku Cloud traders, are another way the indicator
can be used

the standard deviation is a measure of the amount of variation or dispersion of a set of values. A low
standard deviation indicates that the values tend to be close to the mean (also called the expected
value) of the set, while a high standard deviation indicates that the values are spread out over a
wider range

the 68–95–99.7 rule, also known as the empirical rule, is a shorthand used to remember the
percentage of values that lie within a band around the mean. more precisely, 68.27%, 95.45% and
99.73% of the values lie within one, two and three standard deviations of the mean, respectively

All the above are the basics of the Bollinger Bands, where build-in BB displays the area of two
standard deviations of the mean.

This update will display all three areas


1- From mean to one standard deviations of the mean, background no color filled
2- Area between one and two standard deviations of the mean, background colored
3- Area between two and three standard deviations of the mean, background colored with different
color

added previous high and low levels as well as projected ones

* Logistic EMA (LEMA) added as another add-on :

Fear & Greed index value, this is custom interpretaion of mine using technical anlysis approach
calculated based on :
⮩1 - Price Momentum : Price Distance to its Moving Average
⮩2 - Strenght : Rate of Return, price movement over a period of time
⮩3 - Money Flow : Chaikin Money Flow, quantify changes in buying and selling pressure. CMF
calculations is based on Accumulation/Distribution
⮩4 - Market Volatility : CBOE Volatility Index ( VIX ), the Volatility Index, or VIX , is a real-time
market index that represents the market's expectation. It provides a measure of market risk and
investors' sentiments
⮩5 -Safe Haven Demand: in this study GOLD demand is assumed

ps: Fear & Greed index presents only daily time frame calculation values regardless of the time
frame the user uses

a meter tool added to display the sentiment of the market

in its calculation its assumes Central Pivot Range and S/R lines of Pivot Point selected

Price action above CPR - neutral bullish,


Price action above CPR and R1 of Pivot Point selected - bullish,
Price action above CPR and R3 of Pivot Point selected - strong bullish,

same approach applied for bearins sentiment.

please be aware that indicators included in statistical panel are not taken into account they are
available there for further confirmation

Range Meter : will display Low and High of the selected Higher Time Frame, pointer to Current Price

START OF CODE (COPY PASTE IN TRADEING VEIW)


//@version=5

//contribution and team work of our students

//
═════════════════════════════════════════════════════════
═════════════════════════════════════════ //

//# *
═════════════════════════════════════════════════════════
═════════════════════════════════════
//# *

//# * Study : Pivot Points

//# * - Pivot Type Options

//# * 1-) Camarilla

//# * 2-) DeMark

//# * 3-) Fibonacci

//# * 4-) Floor - Classic

//# * 5-) Swing - Custom interpretation


//# * 6-) Woodie

//# *

//# * - Additions

//# * 1-) Central Pivot Range

//# * 2-) Previous TimeFrame OHLC Levels

//# *

//# * - Plotting Add-Ons - Plots the following custom and built-in indicators

//# * 1-) ADX Colored DMI Line - custom interpretation of directional movement index

//# * 2-) Volatility Colored Price/MA Line - custom interpretation of "price distance to its
moving average" study

//# * 3-) Volume Weighted Colored Bars - custom volume study presentation

//# * 4-) Ichimoku Cloud Projection - build-in with only kumo cloud display option

//# * 5-) Bollinger Bands : build-in with customized multi bands display

//# * 6-) Logistic EMA - Logistic Map Equation apllied EMA

//# * 7-) Volume Weighted Average Price (VWAP) - build-in

//# * 8-) Linear Regression : build-in

//# *

//# * - Panel Add-Ons - Statistical panel presents evaluation of the following custom and
built-in indicators

//# * 1-) Directional Movment Index (DMI)

//# * 2-) Ichimoku Cloud

//# * 3-) Price Distance to its MA - custom interpretation

//# * 4-) RSI Oscillator

//# * 5-) Stochastic Oscillator

//# * 6-) MACD Oscillator

//# * 7-) Fear & Greed - custom interpretation

//# *

//# * - Market Sentiment Meter

//# * - Range Meter with Average True Range AddOn

//# *

//# * Author : © swapnaja sharma

//# *
//# * Revision History

//# * Release : Dec 04, 2020

//# * Update : Dec 09, 2020 : Bollinger Bands addition

//# * Update : Dec 12, 2020 : Code completely reworked by introducing arrays

//# * - Logistic EMA (LEMA) addition

//# * Update : Dec 13, 2020 : Panel additions

//# * - RSI, STOCH and MACD

//# * - Fear & Greed

//# * Update : Dec 14, 2020 : Central Pivot Range (CPR) addition

//# * Update : Dec 17, 2020 : Market Sentiment Meter addition

//# * Update : Dec 28, 2020 : Previous TimeFrame OHLC plotting addition

//# * Update : Dec 31, 2020 : Range Meter addition

//# * Update : Jan 04, 2021 : Added ability to support

//# * - Weekly and/or Monthly Pivot

//# * - Historical Pivots

//# * - Range Meter extended with ATR Range

//# * Update : Jan 07, 2021 : Linear Regresion addition

//# * Update : Mar 01, 2021 : Enchantments with Bollinger Bands, and Linear Regression

//# * Update : Mar 24, 2021 : Linear Regression enable both Deviation Plottings, slightly re-
organized script inputs and added tips for options

//# * Update : Apr 20, 2021 : Added Alerts to Pivot Support & Resistance Levels, Linear
Regression, Previous HL, BB stDev 3rd and 4th Band, LEMA

//# * - Added ability to customize Pivot Support & Resistance Levels

//# * - Added Camarilla Level 6

//# * - Enlarged labels with tooltips added

//# * - Imporved Price Range Meter

//# * Update : Nov 22, 2021 : Pine Error Fix : probable cause of the error is likely pine core update
by pine team may have affected the scripts behaviour

//# * Update : Dec 15, 2021 : Slight improvments and additions

//# * - Volume info along with avearage volume added to statistical panel

//# * - Imporved Price Range Meter

//# * - Converted to Pine v5


//# *

//# *
═════════════════════════════════════════════════════════
═════════════════════════════════════
//
═════════════════════════════════════════════════════════
═════════════════════════════════════════ //

indicator('COMPOSITE [Swapnaja sharmaa & TEAM] ', shorttitle='NAKED OPTIONS ☼☾', overlay=true,
max_lines_count=175, max_bars_back=5000)

// ---------------------------------------------------------------------------------------------- //

// Definitions ---------------------------------------------------------------------------------- //

group_pick_a_pivot = 'Pivot Points Setup'

group_pp_l = 'Pivot Points Line/Label Customization'

group_tools = 'Tool Add-Ons'

group_indicators = 'Indicator Add-Ons'

group_panel = 'Statistical Panel Add-Ons'

tooltip_pick_a_pivot = 'A pivot point is a technical analysis indicator used to determine the overall
trend of the market over different time frames'

tooltip_sentiment = 'Market Sentiment Meter is based on price levels compared to central pivot
range and pivot support and resistance levels'

tooltip_range = 'Displays graphical price range during the higher time frame period as well its
previous higher time frame range\n' + 'includes the range numerical display calculated based on
selected ATR period and multiplier'

tooltip_panel = 'provides evaluated result of some of most used technical indicators and some
custom interpreted indicators'
tooltip_adx = 'ADX Colored Directional Movement Line is custom interpretation of Directional
Movement (DMI) with aim to present all 3 DMI indicator components with SINGLE line\n' + 'Plotted
on top of the Main Price Chart\nUsage details may be found when you hover over Statistical Panel'

tooltpi_bb = 'A Bollinger Band is a technical analysis tool defined by a set of lines plotted two
standard deviations (positively and negatively) away from a simple moving average (SMA) of the
security\'s price\n' + 'This customization allows plotting of eight bands that can be adjusted to user
preferences'

tooltip_linreg = 'A line that best fits the prices specified over a user-defined time period. It is
calculated using the least squares method\n' + 'Both Upper/Lower and Standart Devaiation channels
are plotted'

tooltip_log_ema = 'Logistic Map Equation with combination of Exponential Moving Average ( EMA )'

tooltip_pma = 'Volatility Colored Price/MA Line, Custom interpretation of the idea “Prices high
above the moving average (MA) or low below it are likely to be remedied in the future by a reverse
price movement”\n' + 'Plotted on bottom of the Main Price Chart\nUsage details may be found
when you hover over Statistical Panel\n' + 'for further details, please visit study Price Distance to its
MA by DGT'

tooltip_vwcb = 'Volume Weighted Bars, a study of Kıvanç Özbilgiç, aims to present whether volume
supports price movements'

tooltip_ichimoku = 'The Ichimoku Cloud, is a collection of technical indicators that give it a unique
capacity to show support and resistance levels, momentum and trend direction'

tooltip_adx_pma_line = '◁ how to read adx colored dmi line (top line of triangles) ▷ \n' + '* triangle
shapes:\n' + ' ▲- bullish : diplus >= diminus\n' + ' ▼- bearish : diplus < diminus\n' + '* colors:\n' + '
green - bullish trend : adx >= strongTrend and di+ > di-\n' + ' red - bearish trend : adx >= strongTrend
and di+ < di- \n' + ' gray - no trend : weakTrend < adx < strongTrend\n' + ' yellow - weak trend : adx
< weakTrend\n' + '* color density:\n' + ' darker : adx growing\n' + ' lighter : adx falling \n\n' + '◁
how to read volatility colored price/ma line (bottom line of triangles) ▷ \n' + '* triangle shapes:\n' +
' ▲ – bullish, price action above moving average\n' + ' ▼ – bearish, price action below moving
average\n' + '* colors:\n' + ' gray/black - low volatility\n' + ' green/red – price action in threshold
bands\n' + ' dark green/red – price action exceeds threshold bands\n\n' + 'evaluation given herein
does not constitute professional and/or financial advice'
tooltip_vwap = 'Volume Weighted Average Price (VWAP) is a technical analysis tool used to measure
the average price weighted by volume. VWAP is typically used with intraday charts as a way to
determine the general direction of intraday prices. It\'s similar to a moving average in that when
price is above VWAP, prices are rising and when price is below VWAP, prices are falling. VWAP is
primarily used by technical analysts to identify market trend'

tooltip_rsi = 'Relative strength index. It is calculated based on rma\'s of upward and downward
change of x'

tooltip_stoch = 'A stochastic oscillator is a momentum indicator comparing a particular closing price
of a security to a range of its prices over a certain period of time'

tooltip_macd = 'Moving average convergence divergence (MACD) is a trend-following momentum


indicator that shows the relationship between two moving averages of a security’s price'

// -Inputs
═════════════════════════════════════════════════════════
═════════════════════════════ //

display = [Link]('Camarilla', 'Pick a Pivot', options=['Camarilla', 'DeMark', 'Fibonacci', 'Floor',


'Swing', 'Woodie', ' None'], group=group_pick_a_pivot, tooltip=tooltip_pick_a_pivot)

htf_mode = [Link]('Auto', 'Pivot Points TF', options=['Auto', 'User Defined'], inline='HTF',


group=group_pick_a_pivot)

i_htf_user = [Link]('Weekly', ' or User Defined', options=['15 Min', '1


Hour', '4 Hour', 'Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'], inline='HTF2',
group=group_pick_a_pivot)

htf_user = i_htf_user == '15 Min' ? '15' : i_htf_user == '1 Hour' ? '60' : i_htf_user == '4 Hour' ? '240' :
i_htf_user == 'Daily' ? 'D' : i_htf_user == 'Weekly' ? 'W' : i_htf_user == 'Monthly' ? 'M' : i_htf_user ==
'Quarterly' ? '3M' : '12M'

srLabel = [Link]('Levels', 'Pivot Support & Resistance Level Labels', options=['Levels', 'Levels +
Prices', 'None'], group=group_pick_a_pivot)

i_show_r = [Link](true, 'Resistance Lines', inline='rLevel1', group=group_pick_a_pivot)

i_show_r1 = [Link](true, 'R1', inline='rLevel1', group=group_pick_a_pivot)

i_show_r2 = [Link](true, 'R2', inline='rLevel1', group=group_pick_a_pivot)

i_show_r3 = [Link](true, 'R3', inline='rLevel1', group=group_pick_a_pivot)


i_show_r4 = [Link](true, 'R4', inline='rLevel1', group=group_pick_a_pivot)

i_show_r5 = [Link](true, 'R5', inline='rLevel1', group=group_pick_a_pivot)

i_show_r6 = [Link](true, 'R6', inline='rLevel1', group=group_pick_a_pivot)

i_color_r = [Link](#e91e63, ' ', inline='rLevel', group=group_pick_a_pivot)

i_style_r = [Link]('Solid', '', options=['Dashed', 'Dotted', 'Solid'], inline='rLevel',


group=group_pick_a_pivot)

i_width_r = [Link](2, '', minval=1, inline='rLevel', group=group_pick_a_pivot)

i_show_p = [Link](true, 'Pivot Point Line', inline='ppLeve', group=group_pick_a_pivot)

i_color_p = [Link](#0000f0, ' ', inline='ppLeve', group=group_pick_a_pivot)

i_style_p = [Link]('Solid', '', options=['Dashed', 'Dotted', 'Solid'], inline='ppLeve',


group=group_pick_a_pivot)

i_width_p = [Link](2, '', minval=1, inline='ppLeve', group=group_pick_a_pivot)

i_show_s = [Link](true, 'Support Lines ', inline='sLevel1', group=group_pick_a_pivot)

i_show_s1 = [Link](true, 'S1', inline='sLevel1', group=group_pick_a_pivot)

i_show_s2 = [Link](true, 'S2', inline='sLevel1', group=group_pick_a_pivot)

i_show_s3 = [Link](true, 'S3', inline='sLevel1', group=group_pick_a_pivot)

i_show_s4 = [Link](true, 'S4', inline='sLevel1', group=group_pick_a_pivot)

i_show_s5 = [Link](true, 'S5', inline='sLevel1', group=group_pick_a_pivot)

i_show_s6 = [Link](true, 'S6', inline='sLevel1', group=group_pick_a_pivot)

i_color_s = [Link](#26a69a, ' ', inline='sLevel', group=group_pick_a_pivot)

i_style_s = [Link]('Solid', '', options=['Dashed', 'Dotted', 'Solid'], inline='sLevel',


group=group_pick_a_pivot)

i_width_s = [Link](2, '', minval=1, inline='sLevel', group=group_pick_a_pivot)

dispWM = [Link]('None', 'Add Weekly/Monthly Pivots', options=['Both', 'Weekly', 'Monthly',


'None'], group=group_pick_a_pivot)

dispHist = [Link]('None', 'Show Historical Pivots', options=['Selected Pivots', 'Central Pivot


Range', 'None'], group=group_pick_a_pivot)

i_dispPVT = [Link](true, 'Subsequent Pivots, Hours Prior to Session End', inline='SPVT',


group=group_pick_a_pivot)
i_when = [Link](6, '', minval=1, inline='SPVT', group=group_pick_a_pivot)

dispCPR = [Link](true, 'Central Pivot Range', group=group_pick_a_pivot)

i_color_tc = [Link](#fa8072, 'TC', inline='CPR', group=group_pick_a_pivot)

i_color_cpr = [Link](#4262ba, 'CPR', inline='CPR', group=group_pick_a_pivot)

i_color_bc = [Link](#9ef2e8, 'BC', inline='CPR', group=group_pick_a_pivot)

i_style_cpr = [Link]('Dotted', '', options=['Dashed', 'Dotted', 'Solid'], inline='CPR',


group=group_pick_a_pivot)

i_width_cpr = [Link](2, '', minval=1, inline='CPR', group=group_pick_a_pivot)

dispOHLC = [Link](true, 'Previous HTF OHLC', inline='OHLC', group=group_pick_a_pivot)

i_style_ohlc = [Link]('Dashed', '', options=['Dashed', 'Dotted', 'Solid'], inline='OHLC',


group=group_pick_a_pivot)

addons = [Link](true, '╞══════ ═══╡ Add-Ons On/Off ╞═══ ══════╡',


group='Add-Ons')

isMeter = [Link](true, 'Market Sentiment Meter', group=group_tools,


tooltip=tooltip_sentiment)

isRange = [Link](true, 'Price Range Meter / ATR Range Meter ⮯', group=group_tools,
tooltip=tooltip_range)

atrLength = [Link](14, ' ⮩ ATR : Length', inline='ATR', group=group_tools)

atrRange = [Link](2., 'Mult', step=.1, inline='ATR', group=group_tools)

isLabel = [Link](true, 'On/Off | Statistical Panel | Position', inline='STAT', group=group_tools,


tooltip=tooltip_panel)

pLabel = [Link](3, '', inline='STAT', group=group_tools)

dispBB = [Link](true, '⮮ Bollinger Bands ⮯ ═════════════════════╡',


group=group_indicators, tooltip=tooltpi_bb)

extendBB = [Link](false, '⮩ Bollinger Bands : Extend Bands Display', group=group_indicators)

bgShow = [Link](false, '⮩ Bollinger Bands : Fill Background', group=group_indicators)

bbSrc = [Link](close, ' ⮩ Bollinger Bands : Source', group=group_indicators)

bbLen = [Link](21, ' ⮩ Bollinger Bands : Length', minval=1, group=group_indicators)


bbMult1 = [Link](1., ' ⮩ Bollinger Bands : 1st Band Multiplier', minval=1,
group=group_indicators)

bbMult2 = [Link](1.618, ' ⮩ Bollinger Bands : 2nd Band Multiplier', minval=1,


group=group_indicators)

bbMult3 = [Link](2.618, ' ⮩ Bollinger Bands : 3rd Band Multiplier', minval=1,


group=group_indicators)

bbMult4 = [Link](3.618, ' ⮩ Bollinger Bands : 4th Band Multiplier', minval=1,


group=group_indicators)

dispDM = [Link](true, '⮮ ADX Colored DMI Line ⮯ ══════════════════╡',


group=group_indicators, tooltip=tooltip_adx)

adxS = [Link](14, ' ⮩ DMI : ADX Smoothing', minval=1, group=group_indicators)

diLen = [Link](14, ' ⮩ DMI : DI Length', minval=1, group=group_indicators)

strTr = [Link](25, ' ⮩ DMI : Strong Trend Theshold', group=group_indicators)

wkTr = [Link](17, ' ⮩ DMI : Weak Trend Theshold', group=group_indicators)

dispPM = [Link](true, '⮮ Volatility Colored Price/MA Line ⮯ ══════════╡',


group=group_indicators, tooltip=tooltip_pma)

pmrLen = [Link](21, ' ⮩ P/MA : MA Length', minval=1, group=group_indicators)

stDevL = [Link](.75, ' ⮩ P/MA : Lower Deviation', minval=0, step=.25, maxval=3,


group=group_indicators)

stDevH = [Link](2., ' ⮩ P/MA : Higher Deviation', minval=0, step=.25, maxval=3,


group=group_indicators)

vwcb = [Link](true, '⮮ Volume Weighted Colored Bars ⮯ ════════════╡',


group=group_indicators, tooltip=tooltip_vwcb)

vwcbLen = [Link](21, ' ⮩ VWCB : Volume MA Length', minval=1, group=group_indicators)

vwcbUpper = [Link](1.618, ' ⮩ VWCB : Upper Theshold', minval=0.1, step=.1,


group=group_indicators)

vwcbLower = [Link](.618, ' ⮩ VWCB : Lower Theshold', minval=0.1, step=.1,


group=group_indicators)

dispLEMA = [Link](true, '⮮ Logistic EMA (LEMA) ⮯ ═══════════════════╡',


group=group_indicators, tooltip=tooltip_log_ema)
lemaSrc = [Link](close, ' ⮩ LEMA : Source', group=group_indicators)

lemaLen = [Link](21, ' ⮩ LEMA : Length', minval=1, maxval=50, group=group_indicators)

vwapPlot = [Link](true, '⮮ Volume Weighted Average Price (VWAP) ⮯ ═════╡',


group=group_indicators, tooltip=tooltip_vwap)

hideonDWM = [Link](false, title='⮩ VWAP : Hide VWAP on 1D or Above',


group=group_indicators)

var anchor = [Link](defval='Session', title=' ⮩ VWAP : Anchor Period', options=['Session',


'Week', 'Month', 'Quarter', 'Year', 'Decade', 'Century'], group=group_indicators)

src = [Link](title=' ⮩ VWAP : Source', defval=hlc3, group=group_indicators)

offset = [Link](0, title=' ⮩ VWAP : Offset', group=group_indicators)

showBands = [Link](true, title='⮩ VWAP : Calculate Bands, ', inline='VWAP',


group=group_indicators)

stdevMult = [Link](1.0, title='Bands Multiplier', inline='VWAP', group=group_indicators)

ichimoku = [Link](true, '⮮ Ichimoku Cloud Projection ⮯ ═══════════════╡',


group=group_indicators, tooltip=tooltip_ichimoku)

showKumo = [Link](true, '⮩ Ichimoku : Extend Kumo Cloud Display',


group=group_indicators)

conversionPeriods = [Link](9, ' ⮩ Ichimoku : Conversion Line Periods', minval=1,


group=group_indicators)

basePeriods = [Link](26, ' ⮩ Ichimoku : Base Line Periods', minval=1,


group=group_indicators)

laggingSpan2Periods = [Link](52, ' ⮩ Ichimoku : Lagging Span 2 Periods', minval=1,


group=group_indicators)

displacement = [Link](26, ' ⮩ Ichimoku : Displacement', minval=1,


group=group_indicators)

linreg = [Link](true, '⮮ Linear Regression ⮯ ════════════════════╡',


group=group_indicators, tooltip=tooltip_linreg)

upperMult = [Link](2, ' ⮩ LinReg : Upper Deviation', group=group_indicators)

lowerMult = [Link](-2, ' ⮩ LinReg : Lower Deviation', group=group_indicators)

showPearson = [Link](false, '⮩ LinReg : Show Pearson`s R', group=group_indicators)


extendLines = [Link](false, '⮩ LinReg : Extend Lines', group=group_indicators)

linregLength = [Link](100, ' ⮩ LinReg : Count', minval=2, maxval=300,


group=group_indicators)

linregSrc = [Link](close, ' ⮩ LinReg : Source', group=group_indicators)

dummy6 = [Link](true, '⮮ RSI Oscillator ⮯ ═══════════════════════╡',


group=group_panel, tooltip=tooltip_rsi)

rsiSrc = [Link](close, ' ⮩ RSI : Source', group=group_panel)

rsiLength = [Link](14, ' ⮩ RSI : Length', minval=1, group=group_panel)

rsiOversold = [Link](30, ' ⮩ RSI : OverSold Theshold', minval=1, group=group_panel)

rsiOverbought = [Link](70, ' ⮩ RSI : OverBought Theshold', minval=1, group=group_panel)

dummy7 = [Link](true, '⮮ Stochastic Oscillator ⮯ ══════════════════╡',


group=group_panel, tooltip=tooltip_stoch)

stochLengthK = [Link](14, ' ⮩ Stoch : %K', minval=1, group=group_panel)

stochLengthD = [Link](3, ' ⮩ Stoch : %D', minval=1, group=group_panel)

stochSmoothingK = [Link](3, ' ⮩ Stoch : Smoothing', minval=1, group=group_panel)

stochOversold = [Link](20, ' ⮩ Stoch : OverSold Theshold', minval=1, group=group_panel)

stochOverbought = [Link](80, ' ⮩ Stoch : OverBought Theshold', minval=1,


group=group_panel)

dummy8 = [Link](true, '⮮ MACD Oscillator ⮯ ═════════════════════╡',


group=group_panel, tooltip=tooltip_macd)

macdSrc = [Link](close, ' ⮩ MACD : Source', group=group_panel)

macdFastLength = [Link](12, ' ⮩ MACD : Fast Length', minval=1, group=group_panel)

macdSlowLength = [Link](26, ' ⮩ MACD : Slow Length', minval=1, group=group_panel)

macdSignalLength = [Link](9, ' ⮩ MACD : Signal Smoothing Length', minval=1,


group=group_panel)

pll = [Link](377, 'Indicator and Historical Pivots', group='Ploting Length')


// -Calculations
═════════════════════════════════════════════════════════
═══════════════════════ //

//------------------------------------------------------------------------------

// auto higher time frame code snippet from pine wizard @LonesomeTheBlue

htf_auto = [Link] == '1' ? '60' : [Link] == '3' ? '60' : [Link] == '5' ?


'240' : [Link] == '15' ? '240' : [Link] == '30' ? 'D' : [Link] == '45' ?
'D' : [Link] == '60' ? 'D' : [Link] == '120' ? 'D' : [Link] == '180' ? 'D' :
[Link] == '240' ? 'D' : [Link] == 'D' ? 'W' : [Link] == 'W' ? 'M' :
'12M'

htf = htf_mode == 'Auto' ? htf_auto : htf_user

//------------------------------------------------------------------------------

// security() function free higher timeframe price calculations

f_htf_ohlc(_htf) =>

var htf_o = 0. // higher time frame open

var htf_h = 0. // higher time frame high

var htf_l = 0. // higher time frame low

htf_c = close // higher time frame close

var htf_ox = 0. // previous higher time frame open

var htf_hx = 0. // previous higher time frame high

var htf_lx = 0. // previous higher time frame low

var htf_cx = 0. // previous higher time frame close

if [Link](time(_htf))

htf_ox := htf_o

htf_o := open

htf_hx := htf_h

htf_h := high

htf_lx := htf_l
htf_l := low

htf_cx := htf_c[1]

htf_cx

else

htf_h := [Link](high, htf_h) //high > htf_h ? high : htf_h

htf_l := [Link](low, htf_l) //low < htf_l ? low : htf_l

htf_l

[htf_ox, htf_hx, htf_lx, htf_cx, htf_o, htf_h, htf_l, htf_c]

[htf_o1, htf_h1, htf_l1, htf_c1, htf_o, htf_h, htf_l, htf_c] = f_htf_ohlc(htf)

[htf_ow, htf_hw, htf_lw, htf_cw, htf_ow0, _, _, _] = f_htf_ohlc('W')

[htf_om, htf_hm, htf_lm, htf_cm, htf_om0, _, _, _] = f_htf_ohlc('M')

//------------------------------------------------------------------------------

// Get Pivot Points and Support & Resistance Levels

f_get_pivot(_o, _h, _l, _c, _o0) =>

var r6x = 0.

var r5x = 0.

var r4x = 0.

var r3x = 0.

var r2x = 0.

var r1x = 0.

var px = 0.

var s1x = 0.

var s2x = 0.

var s3x = 0.

var s4x = 0.

var s5x = 0.

var s6x = 0.
if display == 'Camarilla'

r5x := _h / _l * _c

r4x := _c + (_h - _l) * 1.1 / 2

r3x := _c + (_h - _l) * 1.1 / 4

//r2x := _c + (_h - _l) * 1.1 / 6

//r1x := _c + (_h - _l) * 1.1 / 12

r6x := r5x + 1.168 * (r5x - r4x)

//s1x := _c - (_h - _l) * 1.1 / 12

//s2x := _c - (_h - _l) * 1.1 / 6

s3x := _c - (_h - _l) * 1.1 / 4

s4x := _c - (_h - _l) * 1.1 / 2

s5x := _c - (r5x - _c)

s6x := _c - (r6x - _c)

s6x

else if display == 'DeMark'

x = _c < _o ? _h + 2 * _l + _c : _c > _o ? 2 * _h + _l + _c : _h + _l + 2 * _c

px := x / 4

s1x := x / 2 - _h

r1x := x / 2 - _l

r1x

else if display == 'Floor'

px := [Link](_h, _l, _c)

s1x := px * 2 - _h

s2x := px - (_h - _l)

s3x := _l - 2 * (_h - px)

r1x := px * 2 - _l

r2x := px + _h - _l

r3x := _h + 2 * (px - _l)


r3x

else if display == 'Fibonacci'

px := [Link](_h, _l, _c)

r3x := px + _h - _l

r2x := px + (_h - _l) * .618

r1x := px + (_h - _l) * .382

s1x := px - (_h - _l) * .382

s2x := px - (_h - _l) * .618

s3x := px - (_h - _l)

s3x

else if display == 'Swing'

r3x := _o0 + _h - _l

r2x := _o0 + (_h - _l) * .618

r1x := _o0 + (_h - _l) * .5

s1x := _o0 - (_h - _l) * .5

s2x := _o0 - (_h - _l) * .618

s3x := _o0 - (_h - _l)

s3x

else if display == 'Woodie'

px := (_h + _l + 2 * _o0) / 4

r1x := 2 * px - _l

r2x := px + _h - _l

r3x := _h + 2 * (px - _l)

r4x := r3x + _h - _l

s1x := 2 * px - _h

s2x := px - (_h - _l)

s3x := _l - 2 * (_h - px)

s4x := s3x - (_h - _l)


s4x

[r6x, r5x, r4x, r3x, r2x, r1x, px, s1x, s2x, s3x, s4x, s5x, s6x]

[r6m, r5m, r4m, r3m, r2m, r1m, pm, s1m, s2m, s3m, s4m, s5m, s6m] = f_get_pivot(htf_om, htf_hm,
htf_lm, htf_cm, htf_om0)

[r6w, r5w, r4w, r3w, r2w, r1w, pw, s1w, s2w, s3w, s4w, s5w, s6w] = f_get_pivot(htf_ow, htf_hw,
htf_lw, htf_cw, htf_ow0)

[r61, r51, r41, r31, r21, r11, p1, s11, s21, s31, s41, s51, s61] = f_get_pivot(htf_o1, htf_h1, htf_l1,
htf_c1, htf_o)

[r6, r5, r4, r3, r2, r1, p, s1, s2, s3, s4, s5, s6] = f_get_pivot(htf_o, htf_h, htf_l, htf_c, htf_o)

// Central Pivot Range

f_cpr(_h, _l, _c) =>

[[Link](_h, _l, _c), [Link](_h, _l), 2 * [Link](_h, _l, _c) - [Link](_h, _l)]

[cpr1, bc1, tc1] = f_cpr(htf_h1, htf_l1, htf_c1)

[cpr, bc, tc] = f_cpr(htf_h, htf_l, htf_c)

//------------------------------------------------------------------------------

f_drawLineX(_x1, _y1, _x2, _y2, _xloc, _extend, _color, _style, _width) =>

var id = [Link](_x1, _y1, _x2, _y2, _xloc, _extend, _color, _style, _width)

line.set_xy1(id, _x1, _y1)

line.set_xy2(id, _x2, _y2)

line.set_color(id, _color)

f_drawLabelX(_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip) =>

var id = [Link](_x, _y, _text, _xloc, _yloc, _color, _style, _textcolor, _size, _textalign, _tooltip)

label.set_xy(id, _x, _y)

label.set_text(id, _text)
f_crossingLevelX(_price, _level) =>

_level > _price and _level < _price[1] or _level < _price and _level > _price[1]

f_getStyle(_style) =>

_style == 'Solid' ? line.style_solid : _style == 'Dotted' ? line.style_dotted : line.style_dashed

//------------------------------------------------------------------------------

// Linear Regression - Build-in : slight presentation changes

extend = extendLines ? [Link] : [Link]

calcSlope(linregSrc, linregLength) =>

max_bars_back(linregSrc, 300)

if not [Link] or linregLength <= 1

[float(na), float(na), float(na)]

else

sumX = 0.0

sumY = 0.0

sumXSqr = 0.0

sumXY = 0.0

for i = 0 to linregLength - 1 by 1

val = linregSrc[i]

per = i + 1.0

sumX += per

sumY += val

sumXSqr += per * per

sumXY += val * per

sumXY
slope = (linregLength * sumXY - sumX * sumY) / (linregLength * sumXSqr - sumX * sumX)

average = sumY / linregLength

intercept = average - slope * sumX / linregLength + slope

[slope, average, intercept]

[slope, average, intercept] = calcSlope(linregSrc, linregLength)

calcDev(linregSrc, linregLength, slope, average, intercept) =>

upDev = 0.0

dnDev = 0.0

stdDevAcc = 0.0

dsxx = 0.0

dsyy = 0.0

dsxy = 0.0

periods = linregLength - 1

daY = intercept + slope * periods / 2

val = intercept

for i = 0 to periods by 1

price = high[i] - val

if price > upDev

upDev := price

upDev

price := val - low[i]

if price > dnDev

dnDev := price

dnDev
price := linregSrc[i]

dxt = price - average

dyt = val - daY

price -= val

stdDevAcc += price * price

dsxx += dxt * dxt

dsyy += dyt * dyt

dsxy += dxt * dyt

val += slope

val

stdDev = [Link](stdDevAcc / (periods == 0 ? 1 : periods))

pearsonR = dsxx == 0 or dsyy == 0 ? 0 : dsxy / [Link](dsxx * dsyy)

[stdDev, pearsonR, upDev, dnDev]

[stdDev, pearsonR, upDev, dnDev] = calcDev(linregSrc, linregLength, slope, average, intercept)

startPrice = intercept + slope * (linregLength - 1)

endPrice = intercept

if addons and linreg

iStart = bar_index - linregLength + 1

iEnd = bar_index

f_drawLineX(iStart, startPrice, iEnd, endPrice, xloc.bar_index, extend, startPrice > endPrice ?


[Link] : [Link], line.style_solid, 1)

f_drawLineX(iStart, startPrice + upperMult * stdDev, iEnd, endPrice + upperMult * stdDev,


xloc.bar_index, extend, startPrice > endPrice ? [Link] : [Link], line.style_dotted, 2)

f_drawLineX(iStart, startPrice + lowerMult * stdDev, iEnd, endPrice + lowerMult * stdDev,


xloc.bar_index, extend, startPrice > endPrice ? [Link] : [Link], line.style_dotted, 2)
f_drawLineX(iStart, startPrice + upDev, iEnd, endPrice + upDev, xloc.bar_index, extend, startPrice
> endPrice ? [Link] : [Link], line.style_dotted, 3)

f_drawLineX(iStart, startPrice - dnDev, iEnd, endPrice - dnDev, xloc.bar_index, extend, startPrice >
endPrice ? [Link] : [Link], line.style_dotted, 3)

if f_crossingLevelX(close, endPrice)

alert('LinReg (PVTvX) : ' + [Link] + ' crossing linear regression line')

if f_crossingLevelX(close, endPrice + upperMult * stdDev)

alert('LinReg (PVTvX) : ' + [Link] + ' crossing linear regression upper standart deviation
line')

if f_crossingLevelX(close, endPrice + lowerMult * stdDev)

alert('LinReg (PVTvX) : ' + [Link] + ' crossing linear regression lower standart deviation
line')

if addons and linreg and showPearson and not na(pearsonR)

f_drawLabelX(bar_index - linregLength + 1, startPrice - dnDev, [Link](pearsonR,


'#.################'), xloc.bar_index, [Link], #00000000, label.style_label_up, #f000ff,
[Link], text.align_center, 'Pearson`s R')

//------------------------------------------------------------------------------

// ADX Colored Directional Movement Index Line

[diplus, diminus, adxValue] = [Link](diLen, adxS)

dmiBull = diplus >= diminus and adxValue >= strTr

dmiBear = diplus < diminus and adxValue >= strTr

dmiWeak = adxValue < strTr and adxValue > wkTr

dmiColor = dmiBull ? adxValue > adxValue[1] ? #006400 : [Link] : dmiBear ? adxValue >
adxValue[1] ? #910000 : [Link] : dmiWeak ? adxValue > adxValue[1] ? [Link] : [Link] :
adxValue > adxValue[1] ? #FFC40C : [Link]

//------------------------------------------------------------------------------

// Price Distance to its Moving Average


pmar = (close / [Link](close, pmrLen) - 1) * 100

[_, uL, lL] = [Link](pmar, pmrLen * 10, stDevL)

[_, uH, lH] = [Link](pmar, pmrLen * 10, stDevH)

[pmaColor, pmaText] = if pmar >= 0

if pmar > uH

[#006400, ' strong bullish\n -over overbought zone']

else if pmar < uH and pmar > uL

[[Link], ' bullish \n -in overbought zone']

else

[[Link], ' trendless \n -low volotile price action in bullish zone']

else

if pmar < lH

[#910000, ' strong bearish\n -below oversold zone']

else if pmar > lH and pmar < lL

[[Link], ' bearish \n -in oversold zone']

else

[[Link], ' trendless \n -low volotile price action in bearish zone']

//------------------------------------------------------------------------------

// Volume Weighted Colored Bars by Kıvanç ÖZBİLGİÇ

volMA = [Link](volume, vwcbLen)

vwcbColor = if close < open

if volume > volMA * vwcbUpper

#910000

else if volume < volMA * vwcbLower

#FF9800

else
if volume > volMA * vwcbUpper

#006400

else if volume < volMA * vwcbLower

#7FFFD4

//------------------------------------------------------------------------------

// Ichimoku Cloud - build-in, slight presentation changes

donchian(len) =>

[Link]([Link](len), [Link](len))

conversionLine = donchian(conversionPeriods)

baseLine = donchian(basePeriods)

leadLine1 = [Link](conversionLine, baseLine)

leadLine2 = donchian(laggingSpan2Periods)

aboveCloud = close > leadLine1[displacement - 1] and close > leadLine2[displacement - 1]

belowCloud = close < leadLine1[displacement - 1] and close < leadLine2[displacement - 1]

inCloud = close > leadLine1[displacement - 1] and close < leadLine2[displacement - 1] or close <
leadLine1[displacement - 1] and close > leadLine2[displacement - 1]

//------------------------------------------------------------------------------

// Bollinger Bands - build-in

[_, u1, l1] = [Link](bbSrc, bbLen, bbMult1)

[_, u2, l2] = [Link](bbSrc, bbLen, bbMult2)

[_, u3, l3] = [Link](bbSrc, bbLen, bbMult3)

[_, u4, l4] = [Link](bbSrc, bbLen, bbMult4)

//------------------------------------------------------------------------------

// Logistic EMA by DGT - custom application of Logistic Map Equation


//

logeq(_source, _length) =>

[Link](_source, _length) / _source[_length] * _source / [Link](_length) * (1 - _source /


[Link](_length))

logema(_source, _length) =>

(logeq(lemaSrc, lemaLen) + 1) * [Link](_source, _length)

lema = logema(lemaSrc, lemaLen)

lema50 = logema(lemaSrc, 50)

lema100 = logema(lemaSrc, 100)

lema200 = logema(lemaSrc, 200)

lemaHigh = logema(high, 11)

lemaLow = logema(low, 23)

dir = close > lemaHigh[1] ? 1 : close < lemaLow[1] ? -1 : 0

trend = [Link](dir != 0, dir, 0)

maColor = lema > lema200 ? lema > lema100 ? lema > lema50 ? [Link] : [Link] :
[Link] : [Link]

hlColor = trend == 1 ? #006400 : #910000

//------------------------------------------------------------------------------

// Trading Psychology - Fear & Greed Index

//

slowLength = 144

fastLength = 21

smoothLen = 5

pmacd = (close / [Link](close, slowLength) - 1) * 100

ror = [Link](close, slowLength) / close[slowLength] * 100

accDist = close == high and close == low or high == low ? 0 : (2 * close - low - high) / (high - low)
fgVol = nz(volume)

moneyFlow = [Link](accDist * fgVol, fastLength) / [Link](fgVol, fastLength) * 100

vix = [Link]('VIX', [Link], -(close / [Link](close, slowLength) - 1) * 100,


barmerge.gaps_off, barmerge.lookahead_on)

gold = [Link]('GOLD', [Link], -(1 - close[fastLength] / close) * 100,


barmerge.gaps_off, barmerge.lookahead_on)

avg = fgVol ? [Link](pmacd, ror, vix, gold, moneyFlow) : [Link](pmacd, ror, vix, gold)

feargreed = [Link](avg, smoothLen)

//------------------------------------------------------------------------------

// VWAP - build-in

computeVWAP(src, isNewPeriod, stDevMultiplier) =>

var float sumSrcVol = na

var float sumVol = na

var float sumSrcSrcVol = na

sumSrcVol := isNewPeriod ? src * volume : src * volume + sumSrcVol[1]

sumVol := isNewPeriod ? volume : volume + sumVol[1]

// sumSrcSrcVol calculates the dividend of the equation that is later used to calculate the standard
deviation

sumSrcSrcVol := isNewPeriod ? volume * [Link](src, 2) : volume * [Link](src, 2) +


sumSrcSrcVol[1]

_vwap = sumSrcVol / sumVol

variance = sumSrcSrcVol / sumVol - [Link](_vwap, 2)

variance := variance < 0 ? 0 : variance

stDev = [Link](variance)

lowerBand = _vwap - stDev * stDevMultiplier

upperBand = _vwap + stDev * stDevMultiplier

[_vwap, lowerBand, upperBand]


timeChange(period) =>

[Link](time(period))

isNewPeriod = na(src[1]) ? true : anchor == 'Session' ? timeChange('D') : anchor == 'Week' ?


timeChange('W') : anchor == 'Month' ? timeChange('M') : anchor == 'Quarter' ? timeChange('3M') :
anchor == 'Year' ? timeChange('12M') : anchor == 'Decade' ? timeChange('12M') and year % 10 == 0 :
anchor == 'Century' ? timeChange('12M') and year % 100 == 0 : false

float vwapValue = na

float std = na

float upperBandValue = na

float lowerBandValue = na

if not(hideonDWM and [Link])

[_vwap, bottom, top] = computeVWAP(src, isNewPeriod, stdevMult)

vwapValue := _vwap

upperBandValue := showBands ? top : na

lowerBandValue := showBands ? bottom : na

lowerBandValue

// -Plotting
═════════════════════════════════════════════════════════
═══════════════════════════ //

time_x1w = [Link]([Link](time('W')), time, 0)

time_x1m = [Link]([Link](time('M')), time, 0)

time_x10 = [Link]([Link](time(htf)), time, 1)

time_x11 = [Link]([Link](time(htf)), time, 0)

time_x21 = time_x11 + time_x11 - time_x10

time_x1 = time_x21 + [Link]([Link](time) * 7)

time_x2 = time_x21 + [Link]([Link](time) * 13)


islast = [Link]([Link], htf, [Link], lookahead=barmerge.lookahead_on)

htf_time = [Link](time(htf))

//------------------------------------------------------------------------------

// Pivots

var ln = array.new_line()

var lb = array.new_label()

if [Link](time) and [Link](ln) > 0

for i = 1 to [Link](ln) by 1

ln1 = [Link](ln)

[Link](ln1)

if srLabel != 'None'

for i = 1 to [Link](lb) by 1

lb1 = [Link](lb)

[Link](lb1)

f_drawLineLabelX(_x1, _y, _x2, _c, _s, _w, _lb) =>

if _y > 0

[Link](ln, [Link](_x1, _y, _x2, _y, xloc.bar_time, [Link], _c, _s, _w))

if srLabel != 'None' and _lb != ''

[Link](lb, [Link](time_x21, _y, srLabel == 'Levels' ? _lb : _lb + ' ' + [Link](_y,
[Link]), xloc.bar_time, [Link], #00000000, label.style_label_left, _c, [Link],
tooltip=_lb + ' ' + [Link](_y, [Link])))

f_processLevelX(_show, _x1, _y, _x2, _c, _s, _w, _lb, _a) =>

if _show

f_drawLineLabelX(_x1, _y, _x2, _c, _s, _w, _lb)


if f_crossingLevelX(close, _y) and _show

alert(display + ' (PVTvX) : ' + [Link] + ' crossing ' + display + ' level ' + _lb)

when = [Link] and display != ' None' and i_dispPVT and time_x21 - timenow < 3600000 *
i_when

f_processLevelX(when and i_show_r and i_show_r6, time_x1, r6, time_x2, i_color_r,


f_getStyle(i_style_r), i_width_r, '', false)

f_processLevelX(when and i_show_r and i_show_r5, time_x1, r5, time_x2, i_color_r,


f_getStyle(i_style_r), i_width_r, '', false)

f_processLevelX(when and i_show_r and i_show_r4, time_x1, r4, time_x2, i_color_r,


f_getStyle(i_style_r), i_width_r, '', false)

f_processLevelX(when and i_show_r and i_show_r3, time_x1, r3, time_x2, i_color_r,


f_getStyle(i_style_r), i_width_r, '', false)

f_processLevelX(when and i_show_r and i_show_r2, time_x1, r2, time_x2, i_color_r,


f_getStyle(i_style_r), i_width_r, '', false)

f_processLevelX(when and i_show_r and i_show_r1, time_x1, r1, time_x2, i_color_r,


f_getStyle(i_style_r), i_width_r, '', false)

f_processLevelX(when and i_show_p, time_x1, p, time_x2, i_color_p, f_getStyle(i_style_p),


i_width_p, '', false)

f_processLevelX(when and i_show_s and i_show_s1, time_x1, s1, time_x2, i_color_s,


f_getStyle(i_style_s), i_width_s, '', false)

f_processLevelX(when and i_show_s and i_show_s2, time_x1, s2, time_x2, i_color_s,


f_getStyle(i_style_s), i_width_s, '', false)

f_processLevelX(when and i_show_s and i_show_s3, time_x1, s3, time_x2, i_color_s,


f_getStyle(i_style_s), i_width_s, '', false)

f_processLevelX(when and i_show_s and i_show_s4, time_x1, s4, time_x2, i_color_s,


f_getStyle(i_style_s), i_width_s, '', false)

f_processLevelX(when and i_show_s and i_show_s5, time_x1, s5, time_x2, i_color_s,


f_getStyle(i_style_s), i_width_s, '', false)

f_processLevelX(when and i_show_s and i_show_s6, time_x1, s6, time_x2, i_color_s,


f_getStyle(i_style_s), i_width_s, '', false)

when := [Link] and display != ' None'


f_processLevelX(when and i_show_r and i_show_r6, time_x11, r61, time_x21, i_color_r,
f_getStyle(i_style_r), i_width_r, 'R6', true)

f_processLevelX(when and i_show_r and i_show_r5, time_x11, r51, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R5', true)

f_processLevelX(when and i_show_r and i_show_r4, time_x11, r41, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R4', true)

f_processLevelX(when and i_show_r and i_show_r3, time_x11, r31, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R3', true)

f_processLevelX(when and i_show_r and i_show_r2, time_x11, r21, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R2', true)

f_processLevelX(when and i_show_r and i_show_r1, time_x11, r11, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R1', true)

plot(dispHist == 'Selected Pivots' and i_show_r6 and r61 > 0 ? htf_time or islast ? na : r61 : na,
'Historical R6', [Link](#e91e63, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_r5 and r51 > 0 ? htf_time or islast ? na : r51 : na,
'Historical R5', [Link](#e91e63, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_r4 and r41 > 0 ? htf_time or islast ? na : r41 : na,
'Historical R4', [Link](#e91e63, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_r3 and r31 > 0 ? htf_time or islast ? na : r31 : na,
'Historical R3', [Link](#e91e63, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_r2 and r21 > 0 ? htf_time or islast ? na : r21 : na,
'Historical R2', [Link](#e91e63, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_r1 and r11 > 0 ? htf_time or islast ? na : r11 : na,
'Historical R1', [Link](#e91e63, 0), 1, plot.style_linebr, show_last=pll)

f_processLevelX(when and i_show_p, time_x11, p1, time_x21, i_color_p, f_getStyle(i_style_p),


i_width_p, 'P', true)

plot(dispHist == 'Selected Pivots' and i_show_p and p1 > 0 ? htf_time or islast ? na : p1 : na,
'Historical P ', [Link](#0000f0, 0), 1, plot.style_linebr, show_last=pll)

f_processLevelX(when and i_show_s and i_show_s1, time_x11, s11, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S1', true)

f_processLevelX(when and i_show_s and i_show_s2, time_x11, s21, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S2', true)
f_processLevelX(when and i_show_s and i_show_s3, time_x11, s31, time_x21, i_color_s,
f_getStyle(i_style_s), i_width_s, 'S3', true)

f_processLevelX(when and i_show_s and i_show_s4, time_x11, s41, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S4', true)

f_processLevelX(when and i_show_s and i_show_s5, time_x11, s51, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S5', true)

f_processLevelX(when and i_show_s and i_show_s6, time_x11, s61, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S6', true)

plot(dispHist == 'Selected Pivots' and i_show_s1 and s11 > 0 ? htf_time or islast ? na : s11 : na,
'Historical S1', [Link](#26a69a, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_s2 and s21 > 0 ? htf_time or islast ? na : s21 : na,
'Historical S2', [Link](#26a69a, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_s3 and s31 > 0 ? htf_time or islast ? na : s31 : na,
'Historical S3', [Link](#26a69a, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_s4 and s41 > 0 ? htf_time or islast ? na : s41 : na,
'Historical S4', [Link](#26a69a, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_s5 and s51 > 0 ? htf_time or islast ? na : s51 : na,
'Historical S5', [Link](#26a69a, 0), 1, plot.style_linebr, show_last=pll)

plot(dispHist == 'Selected Pivots' and i_show_s6 and s61 > 0 ? htf_time or islast ? na : s61 : na,
'Historical S6', [Link](#26a69a, 0), 1, plot.style_linebr, show_last=pll)

when := [Link] and dispWM == 'Weekly' or dispWM == 'Both'

f_processLevelX(when and i_show_r and i_show_r6, time_x1w, r6w, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R6W', true)

f_processLevelX(when and i_show_r and i_show_r5, time_x1w, r5w, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R5W', true)

f_processLevelX(when and i_show_r and i_show_r4, time_x1w, r4w, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R4W', true)

f_processLevelX(when and i_show_r and i_show_r3, time_x1w, r3w, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R3W', true)

f_processLevelX(when and i_show_r and i_show_r2, time_x1w, r2w, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R2W', true)

f_processLevelX(when and i_show_r and i_show_r1, time_x1w, r1w, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R1W', true)
f_processLevelX(when and i_show_p, time_x1w, pw, time_x21, i_color_p, f_getStyle(i_style_p),
i_width_p, 'PW ', true)

f_processLevelX(when and i_show_s and i_show_s1, time_x1w, s1w, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S1W', true)

f_processLevelX(when and i_show_s and i_show_s2, time_x1w, s2w, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S2W', true)

f_processLevelX(when and i_show_s and i_show_s3, time_x1w, s3w, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S3W', true)

f_processLevelX(when and i_show_s and i_show_s4, time_x1w, s4w, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S4W', true)

f_processLevelX(when and i_show_s and i_show_s5, time_x1w, s5w, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S5W', true)

f_processLevelX(when and i_show_s and i_show_s6, time_x1w, s6w, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S6W', true)

when := [Link] and dispWM == 'Monthly' or dispWM == 'Both'

f_processLevelX(when and i_show_r and i_show_r6, time_x1m, r6m, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R6M', true)

f_processLevelX(when and i_show_r and i_show_r5, time_x1m, r5m, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R5M', true)

f_processLevelX(when and i_show_r and i_show_r4, time_x1m, r4m, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R4M', true)

f_processLevelX(when and i_show_r and i_show_r3, time_x1m, r3m, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R3M', true)

f_processLevelX(when and i_show_r and i_show_r2, time_x1m, r2m, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R2M', true)

f_processLevelX(when and i_show_r and i_show_r1, time_x1m, r1m, time_x21, i_color_r,


f_getStyle(i_style_r), i_width_r, 'R1M', true)

f_processLevelX(when and i_show_p, time_x1m, pm, time_x21, i_color_p, f_getStyle(i_style_p),


i_width_p, 'PM ', true)

f_processLevelX(when and i_show_s and i_show_s1, time_x1m, s1m, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S1M', true)
f_processLevelX(when and i_show_s and i_show_s2, time_x1m, s2m, time_x21, i_color_s,
f_getStyle(i_style_s), i_width_s, 'S2M', true)

f_processLevelX(when and i_show_s and i_show_s3, time_x1m, s3m, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S3M', true)

f_processLevelX(when and i_show_s and i_show_s4, time_x1m, s4m, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S4M', true)

f_processLevelX(when and i_show_s and i_show_s5, time_x1m, s5m, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S5M', true)

f_processLevelX(when and i_show_s and i_show_s6, time_x1m, s6m, time_x21, i_color_s,


f_getStyle(i_style_s), i_width_s, 'S6M', true)

when := [Link] and dispCPR

f_processLevelX(when, time_x11, tc1, time_x21, i_color_tc, f_getStyle(i_style_cpr), i_width_cpr, 'TC',


false)

f_processLevelX(when, time_x11, cpr1, time_x21, i_color_cpr, f_getStyle(i_style_cpr), i_width_cpr,


'CPR', false)

f_processLevelX(when, time_x11, bc1, time_x21, i_color_bc, f_getStyle(i_style_cpr), i_width_cpr,


'BC', false)

when := [Link] and dispCPR and i_dispPVT and time_x21 - timenow < 3600000 * i_when

f_processLevelX(when, time_x1, tc, time_x2, i_color_tc, f_getStyle(i_style_cpr), i_width_cpr, '', false)

f_processLevelX(when, time_x1, cpr, time_x2, i_color_cpr, f_getStyle(i_style_cpr), i_width_cpr, '',


false)

f_processLevelX(when, time_x1, bc, time_x2, i_color_bc, f_getStyle(i_style_cpr), i_width_cpr, '',


false)

plot(dispHist == 'Central Pivot Range' and dispCPR ? htf_time or islast ? na : cpr1 : na, 'Historical CPR
P ', [Link](#fa8072, 0), 1, plot.style_cross, show_last=pll)

plot(dispHist == 'Central Pivot Range' and dispCPR ? htf_time or islast ? na : bc1 : na, 'Historical CPR
BC', [Link](#4262ba, 0), 1, plot.style_cross, show_last=pll)

plot(dispHist == 'Central Pivot Range' and dispCPR ? htf_time or islast ? na : tc1 : na, 'Historical CPR
TC', [Link](#9ef2e8, 0), 1, plot.style_cross, show_last=pll)

if [Link] and dispOHLC


ohlcC = htf_o1 > htf_c1 ? [Link] : [Link]

f_drawLineX(time_x10, htf_o1, time_x21, htf_o1, xloc.bar_time, [Link], ohlcC,


f_getStyle(i_style_ohlc), 1)

f_drawLineX(time_x10, htf_h1, time_x21, htf_h1, xloc.bar_time, [Link], ohlcC,


f_getStyle(i_style_ohlc), 2)

f_drawLineX(time_x10, htf_l1, time_x21, htf_l1, xloc.bar_time, [Link], ohlcC,


f_getStyle(i_style_ohlc), 2)

f_drawLineX(time_x10, htf_c1, time_x21, htf_c1, xloc.bar_time, [Link], ohlcC,


f_getStyle(i_style_ohlc), 1)

f_drawLabelX(time_x10, htf_o1, 'O', xloc.bar_time, [Link], #00000000, label.style_label_right,


ohlcC, [Link], text.align_center, 'PREVIOUS HTF OPEN : ' + [Link](htf_o1, [Link]))

f_drawLabelX(time_x10, htf_h1, 'H', xloc.bar_time, [Link], #00000000, label.style_label_right,


ohlcC, [Link], text.align_center, 'PREVIOUS HTF HIGH : ' + [Link](htf_h1, [Link]))

f_drawLabelX(time_x10, htf_l1, 'L', xloc.bar_time, [Link], #00000000, label.style_label_right,


ohlcC, [Link], text.align_center, 'PREVIOUS HTF LOW : ' + [Link](htf_l1, [Link]))

f_drawLabelX(time_x10, htf_c1, 'C', xloc.bar_time, [Link], #00000000, label.style_label_right,


ohlcC, [Link], text.align_center, 'PREVIOUS HTF CLOSE : ' + [Link](htf_c1, [Link]))

if f_crossingLevelX(close, htf_h1) and [Link] and dispOHLC

alert('OHLC (PVTvX) : ' + [Link] + ' crossing previous htf high')

if f_crossingLevelX(close, htf_l1) and [Link] and dispOHLC

alert('OHLC (PVTvX) : ' + [Link] + ' crossing previous htf low')

//------------------------------------------------------------------------------

// ADX Colored Directional Movement Line

didir = diplus >= diminus ? true : false

plotshape(addons and dispDM and diplus >= diminus, style=[Link], location=[Link],


color=dmiColor, title='DMI Bull', show_last=pll)

plotshape(addons and dispDM and diplus < diminus, style=[Link],


location=[Link], color=dmiColor, title='DMI Bear', show_last=pll)
//------------------------------------------------------------------------------

// Price Distance to its Moving Average

plotshape(addons and dispPM and pmar >= 0, style=[Link] , location=[Link],


color=pmaColor, title="Price/MA Bull", show_last = pll)

plotshape(addons and dispPM and pmar < 0, style=[Link], location=[Link],


color=pmaColor, title="Price/MA Bear", show_last = pll)

//------------------------------------------------------------------------------

// Volume weighted Colored Bars by KIVANÇ ÖZBİLGİÇ

barcolor(addons and nz(volume) and vwcb ? vwcbColor : na, title='Volume Based Colored Bars by
[KıvançÖZBİLGİÇ]', show_last=pll)

//------------------------------------------------------------------------------

// Ichimoku Cloud - presentation customized

pi1 = plot(leadLine1, offset=displacement - 1, color=[Link]([Link], 0), title='Lead 1',


display=[Link], show_last=displacement - 1)

pi2 = plot(leadLine2, offset=displacement - 1, color=[Link]([Link], 0), title='Lead 2',


display=[Link], show_last=displacement - 1)

fill(pi1, pi2, color=addons and ichimoku ? leadLine1 > leadLine2 ? [Link]([Link], 73) :
[Link]([Link], 73) : na, show_last=showKumo ? pll + 1 : 1)

//------------------------------------------------------------------------------

// Bolligner Bands - presentation customized

pu4 = plot(addons and dispBB and islast and not extendBB ? u4 : na, 'Bollinger Bands Upper stDev
bbMult4', [Link]([Link], 0), 1)

pu3 = plot(addons and dispBB and islast and not extendBB ? u3 : na, 'Bollinger Bands Upper stDev
bbMult3', [Link]([Link], 0), 1)

pu2 = plot(addons and dispBB and islast and not extendBB ? u2 : na, 'Bollinger Bands Upper stDev
bbMult2', [Link]([Link], 0), 1)
pu1 = plot(addons and dispBB and islast and not extendBB ? u1 : na, 'Bollinger Bands Upper stDev
bbMult1', [Link]([Link], 0), 1)

pl1 = plot(addons and dispBB and islast and not extendBB ? l1 : na, 'Bollinger Bands Lower stDev
bbMult1', [Link]([Link], 0), 1)

pl2 = plot(addons and dispBB and islast and not extendBB ? l2 : na, 'Bollinger Bands Lower stDev
bbMult2', [Link]([Link], 0), 1)

pl3 = plot(addons and dispBB and islast and not extendBB ? l3 : na, 'Bollinger Bands Lower stDev
bbMult3', [Link]([Link], 0), 1)

pl4 = plot(addons and dispBB and islast and not extendBB ? l4 : na, 'Bollinger Bands Lower stDev
bbMult4', [Link]([Link], 0), 1)

fill(pl3, pl4, color=bgShow ? [Link](#006400, 73) : na)

fill(pl2, pl3, color=bgShow ? [Link]([Link], 73) : na)

fill(pl1, pl2, color=bgShow ? [Link](#9ef2e8, 73) : na)

fill(pu1, pu2, color=bgShow ? [Link](#fa8072, 73) : na)

fill(pu2, pu3, color=bgShow ? [Link]([Link], 73) : na)

fill(pu3, pu4, color=bgShow ? [Link](#910000, 73) : na)

pu4e = plot(addons and dispBB and extendBB ? u4 : na, 'Bollinger Bands Upper stDev bbMult4',
[Link]([Link], 0), 1, show_last=pll)

pu3e = plot(addons and dispBB and extendBB ? u3 : na, 'Bollinger Bands Upper stDev bbMult3',
[Link]([Link], 0), 1, show_last=pll)

pu2e = plot(addons and dispBB and extendBB ? u2 : na, 'Bollinger Bands Upper stDev bbMult2',
[Link]([Link], 0), 1, show_last=pll)

pu1e = plot(addons and dispBB and extendBB ? u1 : na, 'Bollinger Bands Upper stDev bbMult1',
[Link]([Link], 0), 1, show_last=pll)

pl1e = plot(addons and dispBB and extendBB ? l1 : na, 'Bollinger Bands Lower stDev bbMult1',
[Link]([Link], 0), 1, show_last=pll)

pl2e = plot(addons and dispBB and extendBB ? l2 : na, 'Bollinger Bands Lower stDev bbMult2',
[Link]([Link], 0), 1, show_last=pll)

pl3e = plot(addons and dispBB and extendBB ? l3 : na, 'Bollinger Bands Lower stDev bbMult3',
[Link]([Link], 0), 1, show_last=pll)

pl4e = plot(addons and dispBB and extendBB ? l4 : na, 'Bollinger Bands Lower stDev bbMult4',
[Link]([Link], 0), 1, show_last=pll)

fill(pl3e, pl4e, color=bgShow ? [Link](#006400, 73) : na)


fill(pl2e, pl3e, color=bgShow ? [Link]([Link], 73) : na)

fill(pl1e, pl2e, color=bgShow ? [Link](#9ef2e8, 73) : na)

fill(pu1e, pu2e, color=bgShow ? [Link](#fa8072, 73) : na)

fill(pu2e, pu3e, color=bgShow ? [Link]([Link], 73) : na)

fill(pu3e, pu4e, color=bgShow ? [Link](#910000, 73) : na)

if f_crossingLevelX(close, u4)

alert('BB (PVTvX) : ' + [Link] + ' crossing bollinger bands upper standart deviation line ' +
[Link](bbMult4))

if f_crossingLevelX(close, u3)

alert('BB (PVTvX) : ' + [Link] + ' crossing bollinger bands upper standart deviation line ' +
[Link](bbMult3))

if f_crossingLevelX(close, l3)

alert('BB (PVTvX) : ' + [Link] + ' crossing bollinger bands lower standart deviation line ' +
[Link](bbMult3))

if f_crossingLevelX(close, l4)

alert('BB (PVTvX) : ' + [Link] + ' crossing bollinger bands lower standart deviation line ' +
[Link](bbMult4))

//------------------------------------------------------------------------------

// Logistic EMA (LEMA)

plot(addons and dispLEMA ? lema : na, 'LEMA Trend ', trend != trend[1] ? hlColor[1] : hlColor, 4,
show_last=pll)

plot(addons and dispLEMA ? lema : na, 'Logistic EMA (LEMA)', maColor, 2, show_last=pll)

if f_crossingLevelX(close, lema)

alert('LEMA (PVTvX) : ' + [Link] + ' crossing Logistic EMA (LEMA)')

//------------------------------------------------------------------------------

// Volume Weighted Average Price (VWAP) - Build-In

plot(addons and vwapPlot ? vwapValue : na, title='VWAP', offset=offset, show_last=pll)


upperBand = plot(addons and vwapPlot ? upperBandValue : na, title='VWAP Upper Band',
color=[Link]([Link], 0), display=[Link], offset=offset, show_last=pll)

lowerBand = plot(addons and vwapPlot ? lowerBandValue : na, title='VWAP Lower Band',


color=[Link]([Link], 0), display=[Link], offset=offset, show_last=pll)

fill(upperBand, lowerBand, title='Bands Fill', color=showBands ? [Link]([Link], 73) : na,


show_last=pll)

//------------------------------------------------------------------------------

// Statistical Panel

if addons and isLabel

// Directional Movement

diStat = diplus >= diminus ? ', diplus(' + [Link](diplus, '#.##') + ') >= diminus(' +
[Link](diminus, '#.##') + ')' : ', diplus(' + [Link](diplus, '#.##') + ') < diminus(' +
[Link](diminus, '#.##') + ')'

adxMom = adxValue > adxValue[1] ? ' and rising' : ' and falling'

dmiText = dmiBull ? ' bullish \n -adx(' + [Link](adxValue, '#.##') + ')' + adxMom + diStat :
dmiBear ? ' bearish \n -adx(' + [Link](adxValue, '#.##') + ')' + adxMom + diStat : '
trendless\n -adx(' + [Link](adxValue, '#.##') + ')' + adxMom + diStat

// Ichimoku Cloud

tkStat = conversionLine >= baseLine ? '\n -tenkan-sen(' + [Link](conversionLine,


[Link]) + ') >= kijun-sen(' + [Link](baseLine, [Link]) + ')' : '\n -tenkan-sen(' +
[Link](conversionLine, [Link]) + ') < kijun-sen(' + [Link](baseLine, [Link])
+ ')'

ichiTxt = aboveCloud ? ' bullish\n -price action above the kumo cloud' + tkStat : belowCloud ?
' bearish\n -price action below the kumo cloud' + tkStat : inCloud ? ' trendless or
transitioning\n -price action within the kumo cloud' + tkStat : na

// RSI

rsiValue = [Link](rsiSrc, rsiLength)


rsiText = rsiValue >= 50 ? rsiValue > rsiOverbought ? ' bullish (overbought)' : rsiValue > 60 ? '
bullish (rsi > 60)' : ' bullish (50 < rsi < 60)' : rsiValue < rsiOversold ? ' bearish (oversold)' :
rsiValue < 40 ? ' bearish (rsi < 40)' : ' bearish (40 < rsi < 50)'

rsiText := [Link](rsiValue) > 0 ? rsiText + '\n -rsi(' + [Link](rsiValue, '#.##') + ') and rising' :
rsiText + '\n -rsi(' + [Link](rsiValue, '#.##') + ') and falling'

// Stochastic

stochK = [Link]([Link](close, high, low, stochLengthK), stochSmoothingK)

stochD = [Link](stochK, stochLengthD)

stochMom = [Link](stochK) > 0 ? ', stochK rising' : ', stochK falling'

stochStat = stochK > stochOverbought ? ' (overbought)' : stochK < stochOversold ? ' (oversold)' : ''

stochText = stochK > stochD ? ' bullish' + stochStat + '\n -%k(' + [Link](stochK, '#.##') + ')
> %d(' + [Link](stochD, '#.##') + ')' + stochMom : ' bearish' + stochStat + '\n -%k(' +
[Link](stochK, '#.##') + ') < %d(' + [Link](stochD, '#.##') + ')' + stochMom

// MACD

[macdLine, signalLine, histLine] = [Link](macdSrc, macdFastLength, macdSlowLength,


macdSignalLength)

macdMom = [Link](histLine) > 0 ? ', momentum rising' : ', momentum falling'

macdText = macdLine > signalLine ? ' bullish (macd > signal)' + macdMom : ' bearish (macd <
signal)' + macdMom

// Fear & Greed

fgTxt = feargreed > 73 ? ' extreame greed' : feargreed > 33 ? ' greed' : feargreed < -25 ? '
fear' : feargreed < -41 ? ' extreame fear' : ' neutral'

fgTxt += ' (' + [Link]([Link](feargreed)) + '%)' + '\n\nVolume : ' + [Link](volume,


[Link]) + ' / Average(' + [Link](vwcbLen) + ') : ' + [Link](volMA, [Link])

text_1 = '🖜 ' + display + ' Pivots for ' + [Link] + '\n -time frame (' + [Link]
+ '), pivot time frame (' + htf + ')' + '\n\nDirectional Movement : ' + dmiText + '\n\nIchimoku Cloud : '
+ ichiTxt + '\n\nPrice/MA : ' + pmaText + '\n\nRSI : ' + rsiText + '\n\nStochastic : ' + stochText +
'\n\nMACD : ' + macdText + '\n\nFear & Greed : ' + fgTxt

f_drawLabelX(time_x21 - timenow < 3600000 * i_when ? time_x2 + [Link]([Link](time) *


pLabel) : time_x21 + [Link]([Link](time) * (srLabel == 'Levels + Prices' ? pLabel + 9 : pLabel
+ 2)), close, text_1, xloc.bar_time, [Link], #4262ba, label.style_label_left, [Link],
[Link], text.align_left, tooltip_adx_pma_line)

//------------------------------------------------------------------------------

// Market Sentiment Meter

if addons and isMeter

l = 13

a = [Link](10) / 5

f = [Link](startPrice, endPrice) + dnDev //highest(3 * l) + 5 * a

t = time

var lns = array.new_line()

var c = array.new_color(na)

if [Link]

[Link](c, [Link])

[Link](c, [Link])

[Link](c, #910000)

[Link](c, [Link])

[Link](c, [Link])

[Link](c, #006400)

if [Link](time) and [Link](lns) > 0

for i = 1 to [Link](lns) by 1

lns1 = [Link](lns)

[Link](lns1)

if [Link]

for i = 0 to l - 1 by 1

[Link](lns, [Link](t[l + i], f + a * [Link]([Link](l, 2) - [Link](i, 2)), t[l + i + 1], f


+ a * [Link]([Link](l, 2) - [Link](i + 1, 2)), xloc.bar_time, [Link], [Link](c,
[Link]((i - 2) / 5)), line.style_solid, 5))
for i = 1 to [Link](lns) - 1 by 1

[Link](lns, [Link](t[i + 1], f + a * [Link]([Link](l, 2) - [Link](l - i, 2)), t[i], f + a


* [Link]([Link](l, 2) - [Link](l - i + 1, 2)), xloc.bar_time, [Link], [Link](c,
[Link](3 + (l - i - 2) / 5)), line.style_solid, 5))

[t1, t2, p2, nc] = if close < bc1

min = s51 != 0 ? s51 : s31 != 0 ? s31 : s21 != 0 ? s21 : s11

min2 = s11 != 0 ? s11 : s31

if close < min and min != 0

[0, 11, -10, #910000]

else if close < min2 and min2 != 0

[0, 6, -4, [Link]]

else

[0, 2, -2, [Link]]

else if close > tc1

max2 = r11 != 0 ? r11 : r31

if close > [Link](r51, r31, r21, r11) and [Link](r51, r31, r21, r11) != 0

[1, -10, -10, #006400]

else if close > max2 and max2 != 0

[1, -6, -4, [Link]]

else

[1, -2, -2, [Link]]

else

[0, 0, -2, [Link]]

[Link](lns, [Link](t[l + t1], f + a, t[l + t2], f + a * (l + p2), xloc.bar_time, [Link], nc,


line.style_solid, 3))

[Link](lns, [Link](t[l + t1], f + a, t[l + t2], f + a * (l + p2), xloc.bar_time, [Link], nc,


line.style_arrow_right, 1))

//------------------------------------------------------------------------------
// Price Range Meter / ATR Range Display

f_atr(_length) =>

[Link](_length)

atr = [Link]([Link], htf, f_atr(atrLength))

if addons and isRange

l = 50

a = [Link](10) / 5

t = time

tco = [Link]([Link](t))

f = [Link](startPrice, endPrice) - dnDev //[Link] or [Link] ?


lowest(l) : lowest(3 * l) - 5 * a

//------------------------------------------------------------------------------

highVolatility = htf_h - htf_l > atr * 1.618

atrValue = [Link](atrLength)

highVolatility0 = high - low > atrValue * 1.618

if [Link]

oo = [Link](l * (htf_h - htf_o) / (htf_h - htf_l))

co = [Link](l * (htf_h - close) / (htf_h - htf_l))

f_drawLineX(t - l * tco, f - a, t, f - a, xloc.bar_time, [Link], [Link], line.style_solid, 7)

f_drawLineX(t - oo * tco, f - a, t - co * tco, f - a, xloc.bar_time, [Link], htf_o < close ?


#006400 : #910000, line.style_solid, 7)

f_drawLabelX(t - l * tco, f - a, [Link](htf_l, [Link]), xloc.bar_time, [Link],


#00000000, label.style_label_right, [Link], [Link], text.align_center, 'HTF LOW')

f_drawLabelX(t, f - a, [Link](htf_h, [Link]), xloc.bar_time, [Link], #00000000,


label.style_label_left, [Link], [Link], text.align_center, 'HTF HIGH')
tooltip = (highVolatility0 ? ' ' : '') + 'Current TF (' + [Link] + ')\nATR(' +
[Link](atrLength) + ') Value : ' + [Link](atrValue, [Link]) + '\nPrice Range (H-L) : ' +
[Link](high - low, [Link]) + '\n' + [Link](atrRange) + ' x ATR Bands : ' +
[Link](open - atrRange * atrValue, [Link]) + ' / ' + [Link](open + atrRange *
atrValue, [Link]) + '\n\nHigher TF (' + htf + ')\nATR(' + [Link](atrLength) + ') Value : ' +
[Link](atr, [Link]) + '\nPrice Range (H-L) : ' + [Link](htf_h - htf_l, [Link]) +
'\n' + [Link](atrRange) + ' x ATR Bands : ' + [Link](htf_o - atrRange * atr, [Link]) + '
/ ' + [Link](htf_o + atrRange * atr, [Link])

text_2 = (highVolatility0 ? ' ' : '') + (highVolatility ? ' ' : '') + 'CHANGE (' + htf + ') ' +
[Link](htf_c - htf_o) + ' (' + [Link]((htf_c / htf_c1 - 1) * 100, '#.##') + '%)'

f_drawLabelX(t - [Link](l / 2) * tco, f - a, text_2, xloc.bar_time, [Link], #00000000,


label.style_label_down, [Link], [Link], text.align_center, tooltip)

f_drawLabelX(t - co * tco, f - a, '', xloc.bar_time, [Link], htf_o < close ? #006400 : #910000,
label.style_label_up, [Link], [Link], text.align_center, 'CURRENT PRICE(' + [Link](close,
[Link]) + ')')

if not [Link]

oo1 = [Link](l * (htf_h1 - htf_o1) / (htf_h1 - htf_l1))

co1 = [Link](l * (htf_h1 - htf_c1) / (htf_h1 - htf_l1))

f_drawLineX(t - l * tco, f - 7 * a, t, f - 7 * a, xloc.bar_time, [Link], [Link],


line.style_solid, 5)

f_drawLineX(t - oo1 * tco, f - 7 * a, t - co1 * tco, f - 7 * a, xloc.bar_time, [Link], htf_o1 <


htf_c1 ? #006400 : #910000, line.style_solid, 5)

f_drawLabelX(t - l * tco, f - 7 * a, [Link](htf_l1, [Link]), xloc.bar_time, [Link],


#00000000, label.style_label_right, [Link], [Link], text.align_center, 'PREVIOUS HTF LOW')

f_drawLabelX(t, f - 7 * a, [Link](htf_h1, [Link]), xloc.bar_time, [Link],


#00000000, label.style_label_left, [Link], [Link], text.align_center, 'PREVIOUS HTF HIGH')

f_drawLabelX(t - [Link](l / 2) * tco, f - 7 * a, 'PREVIOUS HTF\'s RANGE (' + htf + ')',


xloc.bar_time, [Link], #00000000, label.style_label_up, [Link], [Link], text.align_center,
'PREVIOUS HTF RANGE (H-L) : ' + [Link](htf_h1 - htf_l1, [Link]))

var table info = [Link](position.top_right, 1, 1)


var table logo = [Link](position.bottom_right, 1, 1)

if [Link]

[Link](logo, 0, 0, '☼☾ ', text_size=[Link], text_color=[Link])

[Link](info, 0, 0, 'PVTvX \n' + display, text_size=[Link], text_color=[Link])

________________________
Samrat Sen
Roll-Kol24687/44A-23-22

You might also like