Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
//  Copyright by HPotter v1.0 23/05/2014
//  Ichimoku
middleDonchian(Length) =>
    lower = lowest(Length)
    upper = highest(Length)
    avg(upper, lower)

study(title="Ichimoku2c", shorttitle="Ichimoku2c", overlay = true)
conversionPeriods = input(9, minval=1),
basePeriods = input(26, minval=1)
laggingSpan2Periods = input(52, minval=1),
displacement = input(26, minval=1)
Tenkan = middleDonchian(conversionPeriods)
Kijun =  middleDonchian(basePeriods)
xChikou = close
SenkouA = middleDonchian(laggingSpan2Periods)
SenkouB = (Tenkan[basePeriods] + Kijun[basePeriods]) / 2
plot(Tenkan, color=red, title="Tenkan")
plot(Kijun, color=blue, title="Kijun")
plot(xChikou, color= teal , title="Chikou", offset = -displacement)
A = plot(SenkouA[displacement], color=purple, title="SenkouA")
B = plot(SenkouB, color=green, title="SenkouB")
fill(A, B, color=green)
Donate BTC: 13fXLkhWuGMXRmcvwkG2gaWKcnsiD88bwE


What's the difference with the existing cloud?
+109 Reply
@ckd82, Displacement in cloud like mt5
+1 Reply
This has the red and blue lines colored opposite of what the strategy should be, are you trying to screw people?
+35 Reply
GraceUnderFire GraceUnderFire
@GraceUnderFire, sorry that sounds much harsher than I intended.
+10 Reply
HPotter GraceUnderFire
@GraceUnderFire, No )) I made colors as I know, but it can`t be true.
+12 Reply
What happened to the future cloud ?
+19 Reply
There is a Displacement of one period between, Trading View and your indicator. Why is that?
+17 Reply
Can you suggest a good guide on this?
+4 Reply
Macarry fantasyste
@fantasyste, Japanese Forex Trader Kei, on youtube, you have to have some patience but he knows everything about it.
+1 Reply