Strategy · Pine Script v5 · On the chart

Sassiz Ichimoku

by sassiz-root· code credited to mohammadrezapour622

This overlay strategy plots a full Ichimoku set on the price chart: Tenkan, Kijun, displaced Chikou, and Senkou Spans A and B with a colored cloud.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code83
Settings12inputs
LicenceMIT
Last update3 years ago23 Feb 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 strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

83 lines of Pine Script v5 from sassiz_ichimoku_rsi_strategy-v1.txt, published under MIT. Keep the author's credit and licence lines when you reuse it.

sassiz_ichimoku_rsi_strategy-v1.txt
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © mohammadrezapour622

//@version=5
strategy("Sassiz Ichimoku",shorttitle="SassizMoku",overlay=true)

//input
TK_length = input.int(9,title="Tenken Length",minval=1)
KJ_length = input.int(26,title="Kijun Length",minval=1)
SKB_length = input.int(52,title="Senkou Span B Length",minval=1)
Offset = input.int(26,title="Displacement",minval=1)
rsiHighValue = input.int(70,title="Rsi High",minval=50)
rsiLowValue = input.int(30,title="Rsi Low",minval=10)
slLong = input.float(0.996,title="sl Long")
tpLong = input.float(1.008,title="tp long")
slShort = input.float(1.004,title="sl short")
tpShort = input.float(0.992,title="tp short")

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

//calculate tenkan,kijun,chikou,senkou span A, senkou span B
TK = Midpoint(TK_length)
KJ = Midpoint(KJ_length)
SKA = math.avg(TK,KJ)
SKB = Midpoint(SKB_length)
CK = close

//plot 5 ichimoku line
plot(TK,title="Tenken",color = color.aqua,linewidth=2)
plot(KJ,title="Kijun",color = color.red,linewidth=2)
plot(CK,title="Chikou",color = color.lime,linewidth=1,offset = -Offset+1)
SKA_plot = plot(SKA,title="Senkou Span A",color = color.green,linewidth=1,offset = Offset-1)
SKB_plot = plot(SKB,title="Senkou Span B",color = color.red,linewidth=1,offset = Offset-1)

Kumo_Color = SKA >= SKB? color.new(color.green,65): color.new(color.maroon,65)
fill(SKA_plot,SKB_plot,color = Kumo_Color)

//end of calculate and shape ichimoku line

//Start strategy function 
rsiVal = ta.rsi(close,14)
CrossBars = input.int(1,minval=0,title="Number of Bars to Confirm Cross")
CrossOverConfirm(x,y) =>
 ta.barssince(ta.crossover(x,y)) == CrossBars and x>=y
CrossUnderConfirm(x,y) =>
 ta.barssince(ta.crossunder(x,y)) == CrossBars and x<=y

//condition chikou cross kijun
// condition_chikou_x_kijun = input(true,title="Show Chikou crossed Kijun")
// CK_X_KJ = 
//  CrossOverConfirm(CK,KJ[Offset])?1
//  :CrossUnderConfirm(CK,KJ[Offset])?-1
//  :0
// CK_X_KJ_ColUp = color.new(color.green,0)
// CK_X_KJ_ColDn = color.new(color.red,0)

// plotarrow(condition_chikou_x_kijun and CK_X_KJ !=0?CK_X_KJ:na,title="Chikou Crossed Kijun!",colorup = CK_X_KJ_ColUp,colordown=CK_X_KJ_ColDn,maxheight=50,minheight=30)

//condition tenkan cross kijun and chikou is clear
condition_tenkan_x_kijun = input(true,title="Show Tenkan crossed Kijun")
TK_X_KJ = 
//long
//( cross over tk and kj)    (      ck clear                                                      )    (  price> tk and kj)    (                     price > komu       ) 
 CrossOverConfirm(TK,KJ) and (CK>TK and CK>SKA[(Offset-1)*2] and CK>SKB[(Offset-1)*2] ) and (low>TK and low>KJ) and (low>SKA[Offset-1] and low>SKB[Offset-1]) and (SKA>SKB) and (KJ>KJ[1] and SKB>SKB[1]) and rsiVal<rsiHighValue?1
 //short
 :CrossUnderConfirm(TK,KJ) and (CK<low[Offset-1] and CK<SKA[(Offset-1)*2] and CK<SKB[(Offset-1)*2] ) and (low<TK and low<KJ) and (low<SKA[Offset-1] and low<SKB[Offset-1]) and (SKA<SKB) and (KJ<KJ[1] and SKB<SKB[1]) and rsiVal>rsiLowValue?-1
 :0
// TK_X_KJ_ColUp = color.new(color.yellow,0)
// TK_X_KJ_ColDn = color.new(color.purple,0)
TK_X_KJ_Long = TK_X_KJ > 0
TK_X_KJ_Short = TK_X_KJ < 0
plotshape(TK_X_KJ_Long and condition_tenkan_x_kijun,title="Ichi Gold Signal Long",style=shape.triangleup,color=color.green,location=location.bottom,size=size.small)
plotshape(TK_X_KJ_Short and condition_tenkan_x_kijun,title="Ichi Gold Signal Short",style=shape.triangledown,color=color.red,location=location.top,size=size.small)
// plotarrow(condition_tenkan_x_kijun and TK_X_KJ !=0?TK_X_KJ:na,title="Tenkan Crossed Kijun!",colorup = TK_X_KJ_ColUp,colordown=TK_X_KJ_ColDn,maxheight=50,minheight=30)

//strategy long
strategy.entry('buy',strategy.long,when=TK_X_KJ_Long and condition_tenkan_x_kijun)
//strategy.exit('buy',limit = strategy.position_avg_price * 1.008,stop=strategy.position_avg_price * 0.996)
strategy.exit('buy',limit = strategy.position_avg_price * tpLong,stop=strategy.position_avg_price * slLong)
//strategy short
strategy.entry('short',strategy.short,when=TK_X_KJ_Short and condition_tenkan_x_kijun)
//strategy.exit('short',limit = strategy.position_avg_price * 0.992,stop=strategy.position_avg_price * 1.004)
strategy.exit('short',limit = strategy.position_avg_price * tpShort,stop=strategy.position_avg_price * slShort)

Overview

Sassiz Ichimoku marks a long when a confirmed Tenkan cross above Kijun occurs with price and Chikou above the lines and cloud, a rising Kijun and Span B, and RSI below the high threshold. Shorts use the opposite cross, cloud, and RSI low filter. Cross confirmation bars and long or short stop and take-profit price multipliers are adjustable. The excerpt does not show the order or exit calls.

Details

Published by

sassiz-root on GitHub

Code credit

mohammadrezapour622, as written in the script's header

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Trend, Oscillators & momentum

Markets

Crypto

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
Tenken Lengthint9TK_length
Kijun Lengthint26KJ_length
Senkou Span B Lengthint52SKB_length
Displacementint26Offset
Rsi Highint70rsiHighValue
Rsi Lowint30rsiLowValue
sl Longfloat0.996slLong
tp longfloat1.008tpLong
sl shortfloat1.004slShort
tp shortfloat0.992tpShort
Number of Bars to Confirm Crossint1CrossBars
Show Tenkan crossed Kijunbooltruecondition_tenkan_x_kijun
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

330 stars

2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the

Strategy v4 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of 2 EMA/SMA + RSI Strategy [Alorse]

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy
285 stars

Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish

Strategy v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Strategy
218 stars

This strategy generates trading signals based on a selectable momentum engine, supporting MACD, RSI, Stochastic, or Rate of Change. Entries trigger on signal crosses, zero-line crosses, or threshold crosses, with an optional moving average trend filter. Risk m

Strategy v6 Oscillators & momentumTrend
Updated 3 months ago · None stated GitHub repository of Momentum Strategy Template

255 EMA Strategy

by hasnocool
106 stars

255 EMA Strategy combines an exponential moving average with Average True Range bands and standard MACD crossovers to generate entry signals. Drawn directly on the price chart, it plots the central 255 EMA along with upper and lower volatility envelopes. Trade

Strategy v4 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 255 EMA Strategy

More strategys

Trade Your Charts With a Regulated Broker

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

Compare brokers