Indicator · Pine Script v5 · On the chart

Woverine - Ichimou & Cloud

by RyKaj

Calculates and plots customizable Ichimoku Kinko Hyo components directly on the price chart.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code178
Settings20inputs
LicenceMIT
Last update3 years ago11 Oct 2023

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

178 lines of Pine Script v5 from Ichimou & Cloud.pinescript, published under MIT. Keep the author's credit and licence lines when you reuse it.

Ichimou & Cloud.pinescript
//@version=5
//=============================================================================================  
//  Creator: Woverine
//    
//    Source Code: https://github.com/RyKaj/PineScript/tree/main
//
//    Purpose: 
//          Ichimou & Cloud
//
//=============================================================================================  

indicator('Woverine - Ichimou & Cloud', overlay=true, shorttitle='Ichimou')


//-------------------------------------------------------------------------------------------------------------------------
// Plot colors
// https://chir.ag/projects/name-that-color/#6195ED
// https://kodify.net/tradingview/colours/basic-colours/
//-------------------------------------------------------------------------------------------------------------------------
// color colorAquaIsland = #B2DFDB
// color colorAzureRadiance = #0094ff
color colorBlack = #363A45
// color colorBlazeOrange = #ff6a00
color colorBlue = #2196F3
// color colorBlueChill = #088A8D
// color colorBlushPink = #fd7fe6
// color colorBurntSienna = #EF5350
// color colorCandelLight = #FCD917
// color colorCoral = #FF7F50
// color colorCyan = #17FFFF
// color colorDeathCross = #e32636
// color colorFreshEggplant = #800080
// color colorFruitSalad = #4CAF50
// color colorGoldenCross = #61ed77
color colorGreen = #459915
// color colorJapaneseLaurel = #008000
// color colorGreen = #4CAF50
// color colorJungleGreen = #39ff14
// color colorKeyLimePie = #BCBB26
// color colorLilacBush = #9575cd
// color colorLime = #00E676
// color colorParsley = #0E4813
// color colorPastelPink = #FFCDD2
color colorPurple = #9C27B0
color colorRed = #FF5252
// color colorRobinEggBlue = #00C9C9
// color colorRoseBudCherry = #880e4f
// color colorRusticRed = #4E0404
// color colorSaratoga = #505010
// color colorSpringGreen = #00E676
// color colorStarship = #F2F131
// color colorTamarillo = #991515
color colorTeal = #00897B
// color colorTealBlue = #055355
// color colorTrendyGreen = #86851b
// color colorWhite = #FFFFFF

color colorTemp = colorBlack      // used only to handle differnet logical conditions
int intTransp = 0





//-------------------------------------------------------------------------------------------------------------------------
// Functions
//-------------------------------------------------------------------------------------------------------------------------
middleDonchian( Length ) =>
    lower = ta.lowest( Length )
    upper = ta.highest( Length )
    math.avg( upper, lower ) 

donchian(len) => 
    math.avg( ta.lowest( len ), ta.highest( len ) )

//-------------------------------------------------------------------------------------------------------------------------
// Ichimoku
//-------------------------------------------------------------------------------------------------------------------------
bool bShowIchimoku = input.bool( defval=true, title='Show Ichimoku' )
color colorTenkan = input.color( defval = colorRed , title = "Tenkan", tooltip = "", inline = " ", group = "Ichimoku" , confirm = false ) 
color colorKijun = input.color( defval = colorBlue , title = "Kijun", tooltip = "", inline = " ", group = "Ichimoku" , confirm = false ) 
color colorChikou = input.color( defval = colorTeal , title = "Chikou", tooltip = "", inline = " ", group = "Ichimoku" , confirm = false ) 
color colorSenkouA = input.color( defval = colorPurple , title = "SenkouA", tooltip = "", inline = " ", group = "Ichimoku" , confirm = false ) 
color colorSenkouB = input.color( defval = colorGreen , title = "SenkouB", tooltip = "", inline = " ", group = "Ichimoku" , confirm = false ) 

int ConversionPeriods = input.int( defval=9, minval=1, title='Conversion Periods' )
int basePeriods = input.int( defval=26, minval=1, title='Base Periods'  )
int laggingSpan2Periods = input.int( defval=52, minval=1, title='Lagging Span 2 Periods' )
int displacement = input.int( defval=26, minval=1, title='Displacement' )
float Tenkan = middleDonchian( ConversionPeriods )
float Kijun = middleDonchian( basePeriods )
float SenkouA = middleDonchian( laggingSpan2Periods ) 
float SenkouB = ( Tenkan[ basePeriods ] + Kijun[ basePeriods ] ) / 2
// plot( series=Tenkan, color=color.new( colorRed, transp=0 ), title='Tenkan' )
// plot( series=Kijun, color=color.new( colorBlue, transp=0 ), title='Kijun' )
// plot( series=close, color=color.new( colorTeal, transp=0 ), title='Chikou', offset= -displacement )
// A = plot( series=SenkouA[ displacement ], color=color.new( colorPurple, transp=0 ), title='SenkouA' )
// B = plot( series=SenkouB, color=color.new( colorGreen, transp=0 ), title='SenkouB' )
// fill( A, B, color=color.new( colorGreen, 90 ) )


colorTemp := (bShowIchimoku) ? colorTenkan : colorBlack
intTransp := (bShowIchimoku) ? 0 : 100
plot( Tenkan, color=color.new( colorTemp, transp=intTransp ), title='Tenkan' )

colorTemp := (bShowIchimoku) ? colorKijun : colorBlack
intTransp := (bShowIchimoku) ? 0 : 100
plot( Kijun, color=color.new( colorTemp, transp=intTransp ), title='Kijun' )
 
colorTemp := (bShowIchimoku) ? colorChikou: colorBlack
intTransp := (bShowIchimoku) ? 0 : 100
plot( close, color=color.new( colorTemp, transp=intTransp ), title='Chikou', offset= -displacement )

colorTemp := (bShowIchimoku) ? colorSenkouA: colorBlack
intTransp := (bShowIchimoku) ? 0 : 100
A = plot( SenkouA[ displacement ], color=color.new( colorTemp, transp=intTransp ), title='SenkouA' )
 
colorTemp := (bShowIchimoku) ? colorSenkouB: colorBlack
intTransp := (bShowIchimoku) ? 0 : 100
B = plot( SenkouB, color=color.new( colorTemp, transp=intTransp ), title='SenkouB' )

colorTemp := (bShowIchimoku) ? colorGreen: colorBlack
intTransp := (bShowIchimoku) ? 0 : 90
fill( A, B, color=color.new( colorTemp, intTransp ) )



//-------------------------------------------------------------------------------------------------------------------------
// Ichimoku Cloud
//-------------------------------------------------------------------------------------------------------------------------
bool bShowIchimokuCloud = input.bool( defval=false, title='Show Ichimoku Cloud' )
color colorConversionLine = input.color( defval = colorBlue , title = "Conversion Line", tooltip = "", inline = " ", group = "Ichimoku Cloud" , confirm = false ) 
color colorBaseLine = input.color( defval = colorRed , title = "Base Line", tooltip = "", inline = " ", group = "Ichimoku Cloud" , confirm = false ) 
color colorLaggingSpan = input.color( defval = colorGreen , title = "Lagging Span", tooltip = "", inline = " ", group = "Ichimoku Cloud" , confirm = false ) 
color colorLead1 = input.color( defval = colorGreen , title = "Lead 1", tooltip = "", inline = " ", group = "Ichimoku Cloud" , confirm = false ) 
color colorLead2 = input.color( defval = colorRed , title = "Lead 2", tooltip = "", inline = " ", group = "Ichimoku Cloud" , confirm = false ) 


int conversionPeriods1 = input.int( defval=9, minval=1, title='Conversion Line Periods' )
int basePeriods1 = input.int( defval=26, minval=1, title='Base Line Periods' )
int laggingSpan2Periods1 = input.int( defval=52, minval=1, title='Lagging Span 2 Periods' )
int displacement1 = input.int( defval=26, minval=1, title='Displacement' )

float conversionLine = donchian( conversionPeriods1 )
float baseLine = donchian( basePeriods1 )
float leadLine1 = math.avg( conversionLine, baseLine )
float leadLine2 = donchian( laggingSpan2Periods1 )

// plot( series=conversionLine, color=color.new( colorBlue, 0 ), title='Conversion Line' )
// plot( series=baseLine, color=color.new( colorRed, 0 ), title='Base Line' )
// plot( series=close, offset=-displacement1 + 1, color=color.new( colorGreen, transp=0 ), title='Lagging Span' )
// p1 = plot( series=leadLine1, offset=displacement1 - 1, color=color.new( colorGreen, 0 ), title='Lead 1')
// p2 = plot( series=leadLine2, offset=displacement1 - 1, color=color.new( colorRed, 0 ), title='Lead 2')
// fill( p1, p2, color=leadLine1 > leadLine2 ? color.new( colorGreen, transp=90 ) : color.new( colorRed, transp=90 ) )

colorTemp := (bShowIchimokuCloud) ? colorConversionLine : colorBlack
intTransp := (bShowIchimokuCloud) ? 0 : 100
plot( conversionLine, color=color.new( colorTemp, intTransp ), title='Conversion Line' )

colorTemp := (bShowIchimokuCloud) ? colorBaseLine : colorBlack
intTransp := (bShowIchimokuCloud) ? 0 : 100
plot( baseLine, color=color.new( colorTemp, intTransp ), title='Base Line' )

colorTemp := (bShowIchimokuCloud) ? colorLaggingSpan : colorBlack
intTransp := (bShowIchimokuCloud) ? 0 : 100
plot( close, offset=-displacement1 + 1, color=color.new( colorTemp, transp=intTransp ), title='Lagging Span' )

colorTemp := (bShowIchimokuCloud) ? colorLead1 : colorBlack
intTransp := (bShowIchimokuCloud) ? 0 : 100
p1 = plot( leadLine1, offset=displacement1 - 1, color=color.new( colorGreen, intTransp ), title='Lead 1')

colorTemp := (bShowIchimokuCloud) ? colorLead2 : colorBlack
intTransp := (bShowIchimokuCloud) ? 0 : 100
p2 = plot( leadLine2, offset=displacement1 - 1, color=color.new( colorTemp, intTransp ), title='Lead 2' )

colorTemp := (bShowIchimokuCloud) ? (leadLine1 > leadLine2) ? colorGreen: colorRed : colorBlack
intTransp := (bShowIchimokuCloud) ? 0 : 100
fill( p1, p2, color=color.new( colorTemp, transp=intTransp ) )

Overview

Woverine - Ichimou & Cloud provides options to display standard Ichimoku lines including Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, and Chikou Span, as well as an overlay for the Ichimoku Cloud. Users can independently toggle visibility for lines and clouds, adjust calculation periods for conversion, base, and lagging span lengths, and customize visual color schemes.

Details

Published by

RyKaj on GitHub

Draws

On the price chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Show IchimokubooltruebShowIchimoku
TenkancolorcolorRedcolorTenkan
KijuncolorcolorBluecolorKijun
ChikoucolorcolorTealcolorChikou
SenkouAcolorcolorPurplecolorSenkouA
SenkouBcolorcolorGreencolorSenkouB
Conversion Periodsint9ConversionPeriods
Base Periodsint26basePeriods
Lagging Span 2 Periodsint52laggingSpan2Periods
Displacementint26displacement
Show Ichimoku CloudboolfalsebShowIchimokuCloud
Conversion LinecolorcolorBluecolorConversionLine
Show all 20 settings
SettingTypeDefaultVariable
Base LinecolorcolorRedcolorBaseLine
Lagging SpancolorcolorGreencolorLaggingSpan
Lead 1colorcolorGreencolorLead1
Lead 2colorcolorRedcolorLead2
Conversion Line Periodsint9conversionPeriods1
Base Line Periodsint26basePeriods1
Lagging Span 2 Periodsint52laggingSpan2Periods1
Displacementint26displacement1
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

575 stars

This indicator detects equal highs and lows by comparing prices within user-defined left and right bars using a tolerance percentage. It plots horizontal lines on the price chart for equal highs in one color and lows in another. A screener allows input of mult

Indicator v5 Support & resistanceTrend
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows with Screener

Function - Linear Regression

by ricardosantos79
261 stars

This indicator fits a linear regression through stored pivot highs and lows and draws the resulting channel on the price chart. A function returns predicted values, maximum and minimum deviations, and the average absolute deviation. Confirmed two-bar pivots up

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Function - Linear Regression

AI Trend

by dearvn
257 stars

AI Trend is an indicator that plots pivot points, trend lines, and support and resistance levels directly on the price chart. It marks high and low pivots based on user-defined length, draws trend lines that check for violations at specified points, and identi

Indicator v5 TrendSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of AI Trend

Dynamic Linear Regression

by TradersPost
228 stars

Dynamic Linear Regression calculates and plots linear regression trendlines and standard deviation channels directly on the price chart over a user-selected time period. Traders can configure static channels locked at the end time, dynamic channels that contin

Indicator v6 TrendSupport & resistance
Updated 3 months ago · None stated GitHub repository of Dynamic Linear Regression

Ichimoku Cloud

by harryguiacorn
220 stars

This indicator plots Ichimoku Cloud elements on the price chart, including Tenkan-sen, Kijun-sen, Senkou Span A and B lines with optional Chikou Span. It signals trend changes via Tenkan-sen and Kijun-sen crosses and places arrows at Kijun-sen direction shifts

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ichimoku Cloud
219 stars

This indicator identifies local swing highs and swing lows to construct a Zig Zag pattern on the main price chart. It evaluates pivot points based on a customizable number of surrounding left and right bars. Using persistent variables, the script tracks previo

Indicator v4 Support & resistanceTrend Repaints
Updated 5 years ago · None stated GitHub repository of Teaching: Finding Highs and Lows 6

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers