Pine Script (TradingView)
This is a TradingView Pine Script strategy example for this page concept. Paste it into the TradingView Pine Editor, add it to your chart, and run it in the Strategy Tester.
//@version=6
strategy("Ichimoku Cloud Strategy", overlay=true)
conv = (ta.highest(high, 9) + ta.lowest(low, 9)) / 2
base = (ta.highest(high, 26) + ta.lowest(low, 26)) / 2
spanA = (conv + base) / 2
spanB = (ta.highest(high, 52) + ta.lowest(low, 52)) / 2
longSignal = close > math.max(spanA, spanB) and conv > base
exitSignal = close < base
if longSignal
strategy.entry("Long", strategy.long)
if exitSignal
strategy.close("Long")
plot(conv, "Conversion", color=color.aqua)
plot(base, "Base", color=color.orange)