Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
822 views1 page

Order Block Scalping Indicator (Ai)

Order Block Scalping

Uploaded by

katrin.k1394
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
822 views1 page

Order Block Scalping Indicator (Ai)

Order Block Scalping

Uploaded by

katrin.k1394
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

//@version=5

indicator("Order Block Scalping Indicator", shorttitle="OB-Scalp", overlay=true)

// Inputs
ema_length = input.int(50, title="EMA Length")
rsi_length = input.int(14, title="RSI Length")
rsi_overbought = input.int(70, title="RSI Overbought Level")
rsi_oversold = input.int(30, title="RSI Oversold Level")

// EMA
ema = ta.ema(close, ema_length)
plot(ema, title="EMA", color=color.blue, linewidth=2)

// RSI
rsi = ta.rsi(close, rsi_length)

// Order Block Detection


var float ob_high = na
var float ob_low = na
if (ta.crossover(close, ema))
ob_high := high
ob_low := low
if (ta.crossunder(close, ema))
ob_high := na
ob_low := na

// Buy and Sell Signals


buy_signal = ta.crossover(close, ema) and rsi < rsi_oversold and close > ob_high
sell_signal = ta.crossunder(close, ema) and rsi > rsi_overbought and close < ob_low

plotshape(series=buy_signal, location=location.belowbar, color=color.green,


style=shape.labelup, text="BUY", size=size.small, textcolor=color.white)
plotshape(series=sell_signal, location=location.abovebar, color=color.red,
style=shape.labeldown, text="SELL", size=size.small, textcolor=color.white)

// Plot Order Block Levels


plot(ob_high, title="Order Block High", color=color.green, linewidth=1,
style=plot.style_linebr)
plot(ob_low, title="Order Block Low", color=color.red, linewidth=1,
style=plot.style_linebr)

You might also like