OPEN-SOURCE SCRIPT
Updated [EmreKb] Custom Pattern

Custom Pattern
With this indicator, you can create and display as many patterns as you want on the chart. The indicator works by taking two inputs. We can start the explanation by describing these inputs.
Inputs
Explanation Of Patternscript
Patternscript (it's a completely fictional script language) is a scripting language that allows you to write your own patterns, and it operates within Pinescript). Let's take a look at the syntax of this language.
This means that the Fibonacci levels drawn from the from_point to the to_point must have the target_point between the min_fib_level and max_fib_level.
Let's see a few practical examples.
Patternscript Code For ABCD Pattern
ABC(0.618, 0.886): Fibonacci drawn from the A to B, must have the C between the 0.618 and 0.886
BCD(1.272, 1.618): Fibonacci drawn from the B to C, must have the D between the 1.272 and 1.618
Patternscript Code For Multiple Pattern
Notes:
With this indicator, you can create and display as many patterns as you want on the chart. The indicator works by taking two inputs. We can start the explanation by describing these inputs.
Inputs
- Zigzag Length: Length for zigzag legs.
- Patternscript Code: Patternscript code. (But what is patternscript?)
Explanation Of Patternscript
Patternscript (it's a completely fictional script language) is a scripting language that allows you to write your own patterns, and it operates within Pinescript). Let's take a look at the syntax of this language.
Pine Script®
<pattern_name>{
<from_point><to_point><target_point>(<min_fib_level>, <max_fib_level>)
}
...
This means that the Fibonacci levels drawn from the from_point to the to_point must have the target_point between the min_fib_level and max_fib_level.
Let's see a few practical examples.
Patternscript Code For ABCD Pattern
Pine Script®
ABCD{
ABC(0.618, 0.886)
BCD(1.272, 1.618)
}
ABC(0.618, 0.886): Fibonacci drawn from the A to B, must have the C between the 0.618 and 0.886
BCD(1.272, 1.618): Fibonacci drawn from the B to C, must have the D between the 1.272 and 1.618
Patternscript Code For Multiple Pattern
Pine Script®
BAT{
XAB(0.382, 0.5)
ABC(0.382, 0.886)
BCD(1.618, 2.618)
XAD(0.382, 0.886)
}
ABCD{
ABC(0.618, 0.886)
BCD(1.272, 1.618)
}
Notes:
- You can set the pattern name as you like, this is not related to the pattern rules.
- There is no limit for pattern count, but remember pine limits.
Release Notes
Changed default values of inputs.Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.