ZigzagMethodsLibrary   "ZigzagMethods" 
Object oriented implementation of Zigzag methods. Please refer to ZigzagTypes library for User defined types used in this library
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts ZigzagTypes/Pivot object to string representation
  Parameters:
     this : ZigzagTypes/Pivot
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of ZigzagTypes/Pivot
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts Array of Pivot objects to string representation
  Parameters:
     this : Pivot object array
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of Pivot object array
 tostring(this) 
  Converts ZigzagFlags object to string representation
  Parameters:
     this : ZigzagFlags object
  Returns: string representation of ZigzagFlags
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts ZigzagTypes/Zigzag object to string representation
  Parameters:
     this : ZigzagTypes/Zigzagobject
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of ZigzagTypes/Zigzag
 calculate(this, ohlc, indicators, indicatorNames) 
  Calculate zigzag based on input values and indicator values
  Parameters:
     this : Zigzag object
     ohlc : Array containing OHLC values. Can also have custom values for which zigzag to be calculated
     indicators : Array of indicator values
     indicatorNames : Array of indicator names for which values are present. Size of indicators array should be equal to that of indicatorNames
  Returns: current Zigzag object
 calculate(this) 
  Calculate zigzag based on properties embedded within Zigzag object
  Parameters:
     this : Zigzag object
  Returns: current Zigzag object
 nextlevel(this) 
  Calculate Next Level Zigzag based on the current calculated zigzag object
  Parameters:
     this : Zigzag object
  Returns: Next Level Zigzag object
 clear(this) 
  Clears zigzag drawings array
  Parameters:
     this : array
  Returns: void
 drawfresh(this) 
  draws fresh zigzag based on properties embedded in ZigzagDrawing object
  Parameters:
     this : ZigzagDrawing object
  Returns: ZigzagDrawing object
 drawcontinuous(this) 
  draws zigzag based on the zigzagmatrix input
  Parameters:
     this : ZigzagDrawing object
  Returns: 
엘리엇 웨이브
ZigzagTypesLibrary   "ZigzagTypes" 
Zigzag related user defined types. Depends on DrawingTypes library for basic types
 Indicator 
  Indicator is collection of indicator values applied on high, low and close
  Fields:
     indicatorHigh : Indicator Value applied on High
     indicatorLow : Indicator Value applied on Low
 PivotCandle 
  PivotCandle represents data of the candle which forms either pivot High or pivot low or both
  Fields:
     _high : High price of candle forming the pivot
     _low : Low price of candle forming the pivot
     length : Pivot length
     pHighBar : represents number of bar back the pivot High occurred.
     pLowBar : represents number of bar back the pivot Low occurred.
     pHigh : Pivot High Price
     pLow : Pivot Low Price
     indicators : Array of Indicators - allows to add multiple
 Pivot 
  Pivot refers to zigzag pivot. Each pivot can contain various data
  Fields:
     point : pivot point coordinates
     dir : direction of the pivot. Valid values are 1, -1, 2, -2
     level : is used for multi level zigzags. For single level, it will always be 0
     ratio : Price Ratio based on previous two pivots
     indicatorNames : Names of the indicators applied on zigzag
     indicatorValues : Values of the indicators applied on zigzag
     indicatorRatios : Ratios of the indicators applied on zigzag based on previous 2 pivots
 ZigzagFlags 
  Flags required for drawing zigzag. Only used internally in zigzag calculation. Should not set the values explicitly
  Fields:
     newPivot : true if the calculation resulted in new pivot
     doublePivot : true if the calculation resulted in two pivots on same bar
     updateLastPivot : true if new pivot calculated replaces the old one.
 Zigzag 
  Zigzag object which contains whole zigzag calculation parameters and pivots
  Fields:
     length : Zigzag length. Default value is 5
     numberOfPivots : max number of pivots to hold in the calculation. Default value is 20
     offset : Bar offset to be considered for calculation of zigzag. Default is 0 - which means calculation is done based on the latest bar.
     level : Zigzag calculation level - used in multi level recursive zigzags
     zigzagPivots : array which holds the last n pivots calculated. 
     flags : ZigzagFlags object which is required for continuous drawing of zigzag lines.
 ZigzagObject 
  Zigzag Drawing Object
  Fields:
     zigzagLine : Line joining two pivots
     zigzagLabel : Label which can be used for drawing the values, ratios, directions etc.
 ZigzagProperties 
  Object which holds properties of zigzag drawing. To be used along with ZigzagDrawing
  Fields:
     lineColor : Zigzag line color. Default is color.blue
     lineWidth : Zigzag line width. Default is 1
     lineStyle : Zigzag line style. Default is line.style_solid. 
     showLabel : If set, the drawing will show labels on each pivot. Default is false
     textColor : Text color of the labels. Only applicable if showLabel is set to true.
     maxObjects : Max number of zigzag lines to display. Default is 300
     xloc : Time/Bar reference to be used for zigzag drawing. Default is Time - xloc.bar_time.
 ZigzagDrawing 
  Object which holds complete zigzag drawing objects and properties.
  Fields:
     properties : ZigzagProperties object which is used for setting the display styles of zigzag
     drawings : array which contains lines and labels of zigzag drawing.
     zigzag : Zigzag object which holds the calculations.
DrawingMethodsLibrary   "DrawingMethods" 
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Point object to string representation
  Parameters:
     this : DrawingTypes/Point object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Point
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/LineProperties object to string representation
  Parameters:
     this : DrawingTypes/LineProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/LineProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Line object to string representation
  Parameters:
     this : DrawingTypes/Line object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Line
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/LabelProperties object to string representation
  Parameters:
     this : DrawingTypes/LabelProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/LabelProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Label object to string representation
  Parameters:
     this : DrawingTypes/Label object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Label
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Linefill object to string representation
  Parameters:
     this : DrawingTypes/Linefill object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Linefill
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/BoxProperties object to string representation
  Parameters:
     this : DrawingTypes/BoxProperties object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/BoxProperties
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/BoxText object to string representation
  Parameters:
     this : DrawingTypes/BoxText object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/BoxText
 tostring(this, sortKeys, sortOrder, includeKeys) 
  Converts DrawingTypes/Box object to string representation
  Parameters:
     this : DrawingTypes/Box object
     sortKeys : If set to true, string output is sorted by keys.
     sortOrder : Applicable only if sortKeys is set to true. Positive number will sort them in ascending order whreas negative numer will sort them in descending order. Passing 0 will not sort the keys
     includeKeys : Array of string containing selective keys. Optional parmaeter. If not provided, all the keys are considered
  Returns: string representation of DrawingTypes/Box
 delete(this) 
  Deletes line from DrawingTypes/Line object
  Parameters:
     this : DrawingTypes/Line object
  Returns: Line object deleted
 delete(this) 
  Deletes label from DrawingTypes/Label object
  Parameters:
     this : DrawingTypes/Label object
  Returns: Label object deleted
 delete(this) 
  Deletes Linefill from DrawingTypes/Linefill object
  Parameters:
     this : DrawingTypes/Linefill object
  Returns: Linefill object deleted
 delete(this) 
  Deletes box from DrawingTypes/Box object
  Parameters:
     this : DrawingTypes/Box object
  Returns: DrawingTypes/Box object deleted
 delete(this) 
  Deletes lines from array of DrawingTypes/Line objects
  Parameters:
     this : Array of DrawingTypes/Line objects
  Returns: Array of DrawingTypes/Line objects
 delete(this) 
  Deletes labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 delete(this) 
  Deletes linefill from array of DrawingTypes/Linefill objects
  Parameters:
     this : Array of DrawingTypes/Linefill objects
  Returns: Array of DrawingTypes/Linefill objects
 delete(this) 
  Deletes boxes from array of DrawingTypes/Box objects
  Parameters:
     this : Array of DrawingTypes/Box objects
  Returns: Array of DrawingTypes/Box objects
 clear(this) 
  clear items from array of DrawingTypes/Line while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Label while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Linefill while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 clear(this) 
  clear items from array of DrawingTypes/Box while deleting underlying objects
  Parameters:
     this : array
  Returns: void
 draw(this) 
  Creates line from DrawingTypes/Line object
  Parameters:
     this : DrawingTypes/Line object
  Returns: line created from DrawingTypes/Line object
 draw(this) 
  Creates lines from array of DrawingTypes/Line objects
  Parameters:
     this : Array of DrawingTypes/Line objects
  Returns: Array of DrawingTypes/Line objects
 draw(this) 
  Creates label from DrawingTypes/Label object
  Parameters:
     this : DrawingTypes/Label object
  Returns: label created from DrawingTypes/Label object
 draw(this) 
  Creates labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 draw(this) 
  Creates linefill object from DrawingTypes/Linefill
  Parameters:
     this : DrawingTypes/Linefill objects
  Returns: linefill object created
 draw(this) 
  Creates linefill objects from array of DrawingTypes/Linefill objects
  Parameters:
     this : Array of DrawingTypes/Linefill objects
  Returns: Array of DrawingTypes/Linefill used for creating linefills
 draw(this) 
  Creates box from DrawingTypes/Box object
  Parameters:
     this : DrawingTypes/Box object
  Returns: box created from DrawingTypes/Box object
 draw(this) 
  Creates labels from array of DrawingTypes/Label objects
  Parameters:
     this : Array of DrawingTypes/Label objects
  Returns: Array of DrawingTypes/Label objects
 createLabel(this, lblText, tooltip, properties) 
  Creates DrawingTypes/Label object from DrawingTypes/Point
  Parameters:
     this : DrawingTypes/Point object
     lblText : Label text
     tooltip : Tooltip text. Default is na
     properties : DrawingTypes/LabelProperties object. Default is na - meaning default values are used.
  Returns: DrawingTypes/Label object
 createLine(this, other, properties) 
  Creates DrawingTypes/Line object from one DrawingTypes/Point to other
  Parameters:
     this : First DrawingTypes/Point object
     other : Second DrawingTypes/Point object
     properties : DrawingTypes/LineProperties object. Default set to na - meaning default values are used.
  Returns: DrawingTypes/Line object
 createLinefill(this, other, fillColor, transparency) 
  Creates DrawingTypes/Linefill object from DrawingTypes/Line object to other DrawingTypes/Line object
  Parameters:
     this : First DrawingTypes/Line object
     other : Other DrawingTypes/Line object
     fillColor : fill color of linefill. Default is color.blue
     transparency : fill transparency for linefill. Default is 80
  Returns: Array of DrawingTypes/Linefill object
 createBox(this, other, properties, textProperties) 
  Creates DrawingTypes/Box object from one DrawingTypes/Point to other
  Parameters:
     this : First DrawingTypes/Point object
     other : Second DrawingTypes/Point object
     properties : DrawingTypes/BoxProperties object. Default set to na - meaning default values are used.
     textProperties : DrawingTypes/BoxText object. Default is na - meaning no text will be drawn
  Returns: DrawingTypes/Box object
 createBox(this, properties, textProperties) 
  Creates DrawingTypes/Box object from DrawingTypes/Line as diagonal line
  Parameters:
     this : Diagonal DrawingTypes/PoLineint object
     properties : DrawingTypes/BoxProperties object. Default set to na - meaning default values are used.
     textProperties : DrawingTypes/BoxText object. Default is na - meaning no text will be drawn
  Returns: DrawingTypes/Box object
DrawingTypesLibrary   "DrawingTypes" 
User Defined Types for basic drawing structure. Other types and methods will be built on these.
 Point 
  Point refers to point on chart
  Fields:
     price : pivot price
     bar : pivot bar
     bartime : pivot bar time
 LineProperties 
  Properties of line object
  Fields:
     xloc : X Reference - can be either xloc.bar_index or xloc.bar_time. Default is xloc.bar_index
     extend : Property which sets line to extend towards either right or left or both. Valid values are extend.right, extend.left, extend.both, extend.none. Default is extend.none
     color : Line color
     style : Line style, valid values are line.style_solid, line.style_dashed, line.style_dotted, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both. Default is line.style_solid
     width : Line width. Default is 1
 Line 
  Line object created from points
  Fields:
     start : Starting point of the line
     end : Ending point of the line
     properties : LineProperties object which defines the style of line
     object : Derived line object
 LabelProperties 
  Properties of label object
  Fields:
     xloc : X Reference - can be either xloc.bar_index or xloc.bar_time. Default is xloc.bar_index
     yloc : Y reference - can be yloc.price, yloc.abovebar, yloc.belowbar. Default is yloc.price
     color : Label fill color
     style : Label style as defined in www.tradingview.com Default is label.style_none
     textcolor : text color. Default is color.black
     size : Label text size. Default is size.normal. Other values are size.auto, size.tiny, size.small, size.normal, size.large, size.huge
     textalign : Label text alignment. Default if text.align_center. Other allowed values - text.align_right, text.align_left, text.align_top, text.align_bottom
     text_font_family : The font family of the text. Default value is font.family_default. Other available option is font.family_monospace
 Label 
  Label object
  Fields:
     point : Point where label is drawn
     lblText : label text
     tooltip : Tooltip text. Default is na
     properties : LabelProperties object
     object : Pine label object
 Linefill 
  Linefill object
  Fields:
     line1 : First line to create linefill
     line2 : Second line to create linefill
     fillColor : Fill color
     transparency : Fill transparency range from 0 to 100
     object : linefill object created from wrapper
 BoxProperties 
  BoxProperties object
  Fields:
     border_color : Box border color. Default is color.blue
     bgcolor : box background color
     border_width : Box border width. Default is 1
     border_style : Box border style. Default is line.style_solid
     extend : Extend property of box. default is extend.none
     xloc : defines if drawing needs to be done based on bar index or time. default is xloc.bar_index
 BoxText 
  Box Text properties.
  Fields:
     boxText : Text to be printed on the box
     text_size : Text size. Default is size.auto
     text_color : Box text color. Default is color.yellow. 
     text_halign : horizontal align style - default is text.align_center
     text_valign : vertical align style - default is text.align_center
     text_wrap : text wrap style - default is text.wrap_auto
     text_font_family : Text font. Default is
 Box 
  Box object
  Fields:
     p1 : Diagonal point one
     p2 : Diagonal point two
     properties : Box properties
     textProperties : Box text properties
     object : Box object created
Simple Zigzag UDT█  OVERVIEW 
This indicator displays zigzag based on high and low, which is using  user-defined types (UDT) or objects .
 █  CREDITS 
 LonesomeTheBlue 
 █  FEATURES 
1. Label can be resized.
2. Label can be display either short (Eg : HH, LL, H, L, etc) and long (Eg : Higher Low, etc)
3. Color can be customized either contrast color of chart background, trend color or customized color.
 █  EXAMPLES / USAGES 
  
  
  
  
  
 
3 Zigzag for MTF Fib Alert [MsF]Japanese below / 日本語説明は英文の後にあります。
-------------------------
This indicator that automatically displays Fibonacci from each High & Low based on 3 Zigzags. It's useful for multi-timeframe analysis.
For example, Fibonacci calculated from the high and low prices (Zigzag 3 Period=100) of the upper timeframe can be displayed on the lower timeframe.
Also, you can set alerts for each Fibonacci point. It is useful when you are waiting for the price to return to the discount (50% or less) or the premium (50% or more) of the upper timeframe.
"Fib 1 - Crossing 0.00" … Trigger an alert when crossing the 0% line in Fibonacci of Zigzag1
"Fib 1 - Crossing 100.0" … Trigger an alert when crossing the 100% line in Fibonacci of Zigzag1
"Fib 1 - Crossing 23.6" … Trigger an alert when crossing the 23.6% line in Fibonacci of Zigzag1
"Fib 1 - Crossing 38.2" … Trigger an alert when crossing the 38.2% line in Fibonacci of Zigzag1
"Fib 1 - Crossing 50.0" … Trigger an alert when crossing the 50.0% line in Fibonacci of Zigzag1
"Fib 1 - Crossing 61.8" … Trigger an alert when crossing the 61.8% line in Fibonacci of Zigzag1
"Fib 1 - Crossing 76.4" … Trigger an alert when crossing the 76.4% line in Fibonacci of Zigzag1
*Same as Zigzag 1 and Zigzag 2 too.
"Choose Zig Zag Leg for fib" parameter means...
  Latest    : Calculate Fibonacci based on "the most recent Zigzag line".
  Previous : Calculate Fibonacci based on "the previous Zigzag line".
-------------------------
3つのZigzagを元に各High&Lowからフィボナッチを自動で表示するインジケーターです。
Zigzagの期間を工夫することで、マルチタイムフレーム分析に役立ちます。
例えば、以下の設定とした場合:
Zigzag 1 Period … 8
Zigzag 2 Period … 25
Zigzag 3 Period … 100
上位時間足Zigzag(Period=100)の高値安値から形成されるフィボナッチを下位時間足に表示することができるのです。
また、このインジケーターではフィボナッチのポイント毎にアラートの設定が可能です。
上位時間足の割安価格(50%以下)や割高価格(50%以上)に価格が戻ってくるのを待っている時などに力を発揮してくれます。
"Fib 1 - Crossing 0.00" … Zigzag1のフィボナッチにおいて、0%ラインとクロスした場合にアラートを発報します
"Fib 1 - Crossing 100.0" … Zigzag1のフィボナッチにおいて、100%ラインとクロスした場合にアラートを発報します
"Fib 1 - Crossing 23.6" … Zigzag1のフィボナッチにおいて、23.6%ラインとクロスした場合にアラートを発報します
"Fib 1 - Crossing 38.2" … Zigzag1のフィボナッチにおいて、38.2%ラインとクロスした場合にアラートを発報します
"Fib 1 - Crossing 50.0" … Zigzag1のフィボナッチにおいて、50.0%ラインとクロスした場合にアラートを発報します
"Fib 1 - Crossing 61.8" … Zigzag1のフィボナッチにおいて、61.8%ラインとクロスした場合にアラートを発報します
"Fib 1 - Crossing 76.4" … Zigzag1のフィボナッチにおいて、76.4%ラインとクロスした場合にアラートを発報します
※Zigzag1およびZigzag2のフィボナッチも同様
"Choose Zig Zag Leg for fib"パラメータについて:
  Latest  … 一番新しいZigzagのライン(UpまたはDown)を元にフィボナッチを計算します。
  Previous … ひとつ前のZigzagのライン(UpまたはDown)を元にフィボナッチを計算します。
Multi-Timeframe MA Based Zigzag[liwei666]🎲  Overview
🎯 This Zigzag indicator build based on different MA such as EMA/HMA/RMA/SMA,  support multi-timeframe setting .
you can get customer zigzag indicator by change short/long ma length and high-timeframe config(5m/15m/30m/1h/2h) in any symbol.
🎲  Indicator design logic
🎯 entired logic is simple and code looks complex, I‘ll explain core logic here, code already equipped with detailed comments.
1. use close-in EMA's highest/lowest value mark as SWING High/Low when EMA crossover/under,  not use func ta.pivothigh()/ta.pivotlow()
2. when EMA crossover/under plot a char as signal like ●/❄/▲,  crossover get blue char crossunder get red char
3. latest zigzag line is  not drawn until EMA is turned (crossover/under),  but signal is realtime
4. you can see diff zigzag structure when you open high-timeframe config,  then find regular pattern benefit your trading. 
🎲  Settings
🎯 there are 3 group properties in script, just  focus on 5 properties in 'GRP1' ,
   'GRP2' and 'GRP3' are display config.
 
'GRP1':
 
 MA_Type:      MA type you can choose(EMA/RMA/SMA/HMA/WMA), default is EMA
 short_ma_len: short MA length of your current timeframe on chart
 long_ma_len:  long MA length of your current timeframe on chart
 htf_ma_len:   MA length of high timeframe, MA type same as 'MA_Type' config
 htf_ma_tf:    high timeframe ma length, 15/30/60/120 minute
 
 
'GRP2':
 • show_short_zz    • show_long_zz   • show_htf_zz:  
'GRP3':
• show_short_ma_line   • show_short_ma_signal
• show_long_ma_line    • show_long_ma_signal
• show_htf_ma_line      • show_htf_ma_signal
🎲  Usage
🎯 As we know, MA based signal usually  worked fine in trend market , low volatility is unprofitable.
🎯 One of pattern as the chart show below. 
   1.  success example : after a blue ▲ signal, entry long when blue ● signal appear,  marked with green box.
   2. failed example: after a blue ▲ signal, a red ▼ signal appear, marked with white box.
  
🎯 BoS(Break of Structure) based on ma zigzag is a good idea I'm implementing, it will be published  in next script.
Additionally, I plan to publish 20 profitable strategies in 2023; this indicatior not one of them,
let‘s witness it together!
Hope this indicator will be useful for you :)
enjoy!   🚀🚀🚀
ZigCycleBarCount [MsF]Japanese below / 日本語説明は英文の後にあります。
Based on "ZigZag++" indicator by DevLucem. Thanks for the great indicator.
-------------------------
This indicator that displays the candle count (bar count) at the peaks of Zigzag .
It also displays the price of the peaks.
You can easily count candles (bars) from peak to peak. Helpful for candles (bars) in cycle theory.
This logic of the indicator is based from the mt4 zigzag indicator .
Parameter:
Depth = depth (price range)
Backstep = Period
Deviation = Percentage of how much the price has wrapped around the previous line.
Example:
Depth = 12
Backstep = 3
Deviation = 5
In this case, the price range is updated by 12 pips or more (Depth), and after 3 or more candlesticks line up (Backstep), if the price deviates from the previous line by 5% or more (Deviation), a peak is added.
-------------------------
Zigzagの頂点にローソクカウント(バーカウント)を表示するインジケータです。
頂点の価格も表示します。
頂点から頂点までのローソク(バー)を容易にカウントすることができます。
サイクル理論のローソク(バー)に役立ちます。
Zigzagロジック自体はMT4のzigzagインジケータを流用しています。
<パラメータ>
Depth=深さ(値幅)
Backstep=期間
Deviation=価格がどれだけ直前のラインの折り返したかの割合
例:
Depth=12
Backstep=3
Deviation=5
この場合、値幅を12pips以上更新し(Depth)、ローソク足が3本以上並んだ後(Backstep)、価格が直前のラインの5%以上折り返せば(Deviation)、頂点を付けます。
<表示オプション>
Label_Style = "TEXT"…テキスト表示、"BALLOON"…吹き出し表示
Channel Based Zigzag [HeWhoMustNotBeNamed]🎲 Concept
Zigzag is built based on the price and number of offset bars. But, in this experiment, we build zigzag based on different bands such as Bollinger Band, Keltner Channel and Donchian Channel. The process is simple:
🎯 Derive bands based on input parameters
🎯 High of a bar is considered as pivot high only if the high price is above or equal to upper band.
🎯 Similarly low of a bar is considered as pivot low only if low price is below or equal to lower band.
🎯 Adding the pivot high/low follows same logic as that of regular zigzag where pivot high is always followed by pivot low and vice versa.
🎯 If the new pivot added is of same direction as that of last pivot, then both pivots are compared with each other and only the extreme one is kept. (Highest in case of pivot high and lowest in case of pivot low)
🎯 If a bar has both pivot high and pivot low - pivot with same direction as previous pivot is added to the list first before adding the pivot with opposite direction.
🎲 Use Cases
Can be used for pattern recognition algorithms instead of standard zigzag. This will help derive patterns which are relative to bands and channels.
Example: John Bollinger explains how to manually scan double tap using Bollinger Bands in this video: www.youtube.com This modified zigzag base can be used to achieve the same using algorithmic means.
🎲 Settings
Few simple configurations which will let you select the band properties. Notice that there is no zigzag length here. All the calculations depend on the bands.
With bands display, indicator looks something like this
Note that pivots do not always represent highest/lowest prices. They represent highest/lowest price relative to bands.
As mentioned many times, application of zigzag is not for buying at lower price and selling at higher price. It is mainly used for pattern recognition either manually or via algorithms. Lets build new Harmonic, Chart patterns, Trend Lines using the new zigzag?
Moving Average Based Zig ZagMoving Average Based Zig Zag differs from the traditional Zig Zag indicator in that pivot points are determined by a moving average, Volume Weighted Hull Moving Average, rather than looking for the highest or lowest point in a left / right period.
 Settings 
 
 Source: the source for the pivot points.
 Moving Average Length: the length of the Volume Weighted Hull Moving Average, increase for longer zig zags, decrease for shorter zig zags.
 
 Usage 
Like all Zig Zag indicators, the Moving Average Based Zig Zag is not intended to be used as a live trading tool. This indicator is intended to be an alternative way of determining pivot points on your chart. Pivot points can be used for a multitude of different analytical techniques. One may use pivot points in order to draw potential support and resistance lines, trend lines or chart patterns. Additionally, pivot points can be used to determine variations of highs and lows important to market structure analysis such as break of structure or change of character.
 Details 
The moving average used is a Volume Weighted Hull Moving Average, this particular moving average was used due to it's relatively low-lag characteristics when compared to an Exponential Moving Average, additionally by considering volume in the moving average calculation, insignificant pivot points can be further filtered. 
Rather than using built-in functions `ta.pivothigh()` and `ta.pivotlow()` to determine pivot points, this indicator waits for the moving average to pivot then searches for the highest or lowest value from the bar index of the moving average pivot to the bar index of the previous found price pivot. This method of determining pivots provides a more  dynamic  approach to determining pivot points.
Zig Zag Ratio Simplified█ OVERVIEW
This indicator was to show ratio between zig zag. Ideally to find Fibonacci Retracement / Projection, Harmonic Patterns, ABCD, Elliot Wave and etc.
 █ CREDITS 
 LonesomeTheBlue 
 █ FEATURES 
Table can positioned by any position and font size can be resized.
 █ USAGE / TIPS EXAMPLES (Description explained in each image) 
  
  
  
 
Davin's 10/200MA Pullback on SPY Strategy v2.0Strategy:
Using 10 and 200 Simple moving averages, we capitalize on price pullbacks on a general uptrend to scalp 1 - 5% rebounds. 200 MA is used as a general indicator for bullish sentiment, 10 MA is used to identify pullbacks in the short term for buy entries. 
An optional bonus: market crash of 20% from 52 days high is regarded as a buy the dip signal.
An optional bonus: can choose to exit on MA crossovers using 200 MA as reference MA (etc. Hard stop on 50 cross 200)
Recommended Ticker: SPY 1D (I have so far tested on SPY and other big indexes only, other stocks appear to be too volatile to use the same short period SMA parameters effectively) + AAPL 4H
How it works:
Buy condition is when:
- Price closes above 200 SMA
- Price closes below 10 SMA
- Price dumps at least 20% (additional bonus contrarian buy the dip option)
Entry is on the next opening market day the day after the buy condition candle was fulfilled.
Sell Condition is when:
- Prices closes below 10 SMA
- Hard stop at 15% drawdown from entry price (adjustable parameter)
- Hard stop at medium term and long term MA crossovers (adjustable parameters)
So far this strategy has been pretty effective for me, feel free to try it out and let me know in the comments how you found :)
Feel free to suggest new strategy ideas for discussion and indicator building
Trend/Retracement - ZigZag - New wayZigZag  for Trend and Retracements -  New way 
It's another way to plot ZigZag based on lookback period for trend and % of trend lookback period to plot retracements.
█   OVERVIEW  
Plot ZigZag, Trend lines, Retracements, Support levels, Resistance levels
█  Objective: 
Draw ZigZag lines along with unbroken support and resistance levels. ZigZag lines are drawn for main trend and the retracements.
Main Trend – This is calculated based on lookback period. 
Retracements – Retracements are calculated as 25% of main trend.
Support and Resistance line: The indicator draws 2 types of support and resistance lines
    1.	Un-broken – Once formed (plotted), these are the support and resistance which are not yet broken
    2.	Tested – One can also choose to see support and resistance lines which are tested but not broken. Tested support/resistance are those levels which are touched by high/low price but close price has not crossed the level.
█  How main trend point is calculated: 
E.g.
Chart timeframe = 15m 
Lookback period  = 250 
Retracement = 25% of main trend ( 25% of 250 = 62 )
A price point on a chart is considered as trend point if distance between current price and previous highest price is 250 candles
A price point is considered as a retracement if distance between current price and previous highest price is 62 candles. Please note retracements are calculated only after finding a main trend point. 
█  Input parameters: 
 Zigzag Parameters  
 
     Use predefined Lookback – If checked pre-defined timeframe-based lookback parameters are used. 
     Trend lookback candles – If ‘Use predefined Lookback’ is unchecked then this value is used as lookback period.
     Retracement % of look back candles– If ‘Use predefined Lookback’ is unchecked then this value is used for calculating retracement lookback period
     Mark retracements – If unchecked only main trend lines are plotted
     Plot support/resistance – To plot support/resistance levels
     Show support/resistance tested lines – If checked tested support/resistance liens are shown on the chart
 
█  TF based Lookback period config   (Defaults are set as specified below, One can change these defaults to use different lookback periods)
The defaults set here are used based on the chart timeframe.  e.g. if chart timeframe is changed from say 15m to 60m then 60m chart defaults (i.e. trend lookback = 90) are used to plot the trend and the retracements. At the bottom-right of the chart, parameters used for plotting are displayed all the time.
 
     Timeframe in minute – Default = 5m
     Trend lookback candles – Default = 375 (~ 5 days of data)
 
     Timeframe in minute – Default = 15m
     Trend lookback candles – Default = 250 (~10 days of data)
     Timeframe in minute – Default = 60m
     Trend lookback candles = Default = 90 (~ 15 days of data)
     Trend lookback candles for timeframe 'D' – Default =  30 (~1 month data)
     Trend lookback candles for timeframe 'W' – Default = 21 (~6 months data)
     Trend lookback candles for timeframe 'M' – Default = 12 (~1year data)
     Retracement % of look back candles – Default = 25%
 
█  When and where one can use this indicator (Refer to chart examples) 
 
       To view support and resistance based on lookback period
       To view ZigZag lines
       One can use it to find chart patterns easily 
       Trend and retracement lines can help in drawing Elliott waves.
 
█ Chart examples: 
1. Chart patterns can be easily identified - One can disable the candle charts which will help to identify and draw chart patterns easily
  
2. Trend and retracement lines can also help is analyzing charts (e.g. Elliott Waves can be marked based on trend lines)
  
3. Tested but not broken support and resistance lines can be viewed
  
4. You can select 'NOT' to plot tested support and resistance lines
  
5. Uncheck  the Mark retracements to plot main trend lines (Retracements are not marked)
  
RSI + MA, LinReg, ZZ (HH HL LH LL), Div, Ichi, MACD and TSI HistRelative Strength Index with Moving Average, Linear Regression, Zig Zag (Highs and Lows), Divergence, Ichimoku Cloud, Moving Average Convergence Divergence and True Strength Index Histogram
This script is based on zdmre's RSI script, I revamped a lot of things and added a few indicators from ParkF's RSI script.
Disable Labels in the Style tab and the histogram if you don't enlarge the indicator and it seems too small.
Look to buy in the oversold area and bounce of the support of the linear regression.
Look to sell in the overbought area and bounce of the resistance of the linear regression.
Look for retracement to the moving average or horizontal lines, and divergences for potential reversal.
RSI
The Relative Strength Index (RSI) is a well versed momentum based oscillator which is used to measure the speed (velocity) as well as the change (magnitude) of directional price movements.
Moving Average
Moving Average (MA) is a good way to gauge momentum as well as to confirm trends, and define areas of support and resistance.
Linear Regression
The Linear Regression indicator visualizes the general price trend of a specific part of the chart based on the Linear Regression calculation.
Zig Zag (Highs and Lows)
The Zig Zag indicator is used to identify price trends, and in doing so plots points on the chart to mark whenever prices reverse by a larger percentage point than a predetermined variable or marker.
Divergence
The divergence indicator warns traders and technical analysts of changes in a price trend, oftentimes that it is weakening or changing direction.
Ichimoku Cloud
The Ichimoku Cloud is a package of multiple technical indicators that signal support, resistance, market trend, and market momentum.
MACD and TSI Histogram
MACD can be used to identify aspects of a security's overall trend.
The True Strength Index indicator is a momentum oscillator designed to detect, confirm or visualize the strength of a trend.
RSI TrendRSI Hull Trend is a hybrid indicator with RSI of HULL Signal. The Hull MA is combined with RSI to see if the Hull MA  Buy/Sell Signal is in overbought or oversold condition. Buy Sell Signals are plotted based on settings of OB/OS or RSI. This indicator is very useful to see if the Trend is in Exhaustion or Beginning  of a Trend. Entry and Exit conditions can be more precise based on OB/OS condition of price action. In addition normal RSI trend is plotted with trend color from Hull MA. Best Performance with Heiken Ashi Candles.
 
  OB/OS Settings provided
  Hull Buy/Sell Signals plotted
  Double RSI FAST and DEFAULT signal with crossover
  Bar Color applied based on Hull RSI Trend
  Hull Trend + RSI + Price Action
PharshK RSI and Zigzag with H/LIt is with RSI level
and Zigzag Pattern that Market goes on Maximum level and Lower Level
And it is also Showing High and Law Level of last Moving Candle so it is easy to entry and Hold
PharshK RSI and Zigzag with H/LIt is with RSI level
and Zigzag Pattern that Market goes on Maximum level and Lower Level
And it is also Showing High and Law Level of last Moving Candle so it is easy to entry and Hold
CHS Zig ZagCHS ZigZag stands for Changeable Source ZigZag
The original ZigZag indicator offered by TradingView doesn't have the ability to measure the tips and troughs based on closing prices (line chart), however, this indicator is capable of receiving an input from user that determines the price source used for further calculations. 
The default inputs of the original ZigZag indicator have been also changed in order to make it adapt to pivots formed on line chart but users can change arbitrarily.
Structured zigzag support&resistance [LM]Hello Traders,
I would like to introduce you Structured zigzag support&resistance. It is based on the ZigZag semafor script made by DevLucem so shout out to him
The indicator is used to spot future multi-level Supports and Resistance zones. It is also useful to spot HL or LL or HH or LH zones
I's the same zigzag indicator as my other zigzag indicator with highlight on diagonal lines(highs and lows are automatically classified and also new types of diagonal lines  that connects low or highs and extends to right are drawn )
It has two settings:
Fist is to control horizontal lines and zigzag setting
Second is to control diagonal lines
I hope you will enjoy it as I enjoyed to write it.
Lukas
RSI Divergence Scanner by zdmreDivergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
If the stock is rising and making new highs, ideally the RSI is reaching new highs as well. If the stock is making new highs, but the RSI starts making lower highs, this warns the price uptrend may be weakening. This is negative divergence. 
Positive divergence is the opposite situation. Imagine the price of a stock is making new lows while the RSI makes higher lows with each swing in the stock price. Investors may conclude that the lower lows in the stock price are losing their downward momentum and a trend reversal may soon follow.
Divergence is one of the common uses of many technical indicators, primarily the oscillators. 
 Use it at your own risk
Support and Resistance Multiperiod (Zig Zag Based)Support and Resistance Multiperiod (Zig Zag Based) 
 What is the indicator? 
• The indicator is a multi period (up to 5 lengths) Support and Resistance indicator calculated based on Zig Zag.
 Who can use? 
Scalpers to Long term investors
 What timeframe to use? 
• Any timeframe
 What are the lines? 
• Green lines are Support levels.
• Orange lines are Resistance levels.
 How to use? 
• Buy Low and Sell High.
• Brighter zones means strong Support or Resistance.
• Weaker zones appear lighter.
• Brighter zones are formed by overlapping of lines from multiple levels of support or resistance.
 Indicator Menu 
• The indicator can input 5 different Lengths.
• The default settings uses 13, 21, 52, 100 & 200.
• Every option are customizable.
rzigzagLibrary   "rzigzag" 
Recursive Zigzag Using Matrix allows to create zigzags recursively on multiple levels. After bit of consideration, decided to make this public.
 zigzag(length, ohlc, numberOfPivots, offset) 
  calculates plain zigzag based on input
  Parameters:
     length : Zigzag Length
     ohlc : Array containing ohlc values. Can also contain custom series
     numberOfPivots : Number of max pivots to be returned
     offset : Offset from current bar. Can be used for calculations based on confirmed bars
  Returns:  
 nextlevel(zigzagmatrix, numberOfPivots) 
  calculates next level zigzag based on present zigzag coordinates
  Parameters:
     zigzagmatrix : Matrix containing zigzag pivots, bars, bar time, direction and level
     numberOfPivots : Number of max pivots to be returned
  Returns: matrix zigzagmatrix
 draw(zigzagmatrix, newPivot, doublePivot, lineColor, lineWidth, lineStyle, showLabel, xloc) 
  draws zigzag based on the zigzagmatrix input
  Parameters:
     zigzagmatrix : Matrix containing zigzag pivots, bars, bar time, direction and level
     newPivot : Flag indicating there is update in the pivots
     doublePivot : Flag containing there is double pivot update on same bar
     lineColor : Zigzag line color
     lineWidth : Zigzag line width
     lineStyle : Zigzag line style
     showLabel : Flag to indicate display pivot labels
     xloc : xloc preference for drawing lines/labels
  Returns:  
 draw(length, ohlc, numberOfPivots, offset, lineColor, lineWidth, lineStyle, showLabel, xloc) 
  calculates and draws zigzag based on zigzag length and source input
  Parameters:
     length : Zigzag Length
     ohlc : Array containing ohlc values. Can also contain custom series
     numberOfPivots : Number of max pivots to be returned
     offset : Offset from current bar. Can be used for calculations based on confirmed bars
     lineColor : Zigzag line color
     lineWidth : Zigzag line width
     lineStyle : Zigzag line style
     showLabel : Flag to indicate display pivot labels
     xloc : xloc preference for drawing lines/labels
  Returns:  
 drawfresh(zigzagmatrix, zigzaglines, zigzaglabels, lineColor, lineWidth, lineStyle, showLabel, xloc) 
  draws fresh zigzag for all pivots in the input matrix.
  Parameters:
     zigzagmatrix : Matrix containing zigzag pivots, bars, bar time, direction and level
     zigzaglines : array to which all newly created lines will be added
     zigzaglabels : array to which all newly created lables will be added
     lineColor : Zigzag line color
     lineWidth : Zigzag line width
     lineStyle : Zigzag line style
     showLabel : Flag to indicate display pivot labels
     xloc : xloc preference for drawing lines/labels
  Returns: 






















