100% found this document useful (1 vote)
314 views

Scalping Master

super indicator2

Uploaded by

ali beri
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
100% found this document useful (1 vote)
314 views

Scalping Master

super indicator2

Uploaded by

ali beri
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/ 2

//@version=6

indicator(title = 'Scalping Master', shorttitle = '', overlay = true, precision =


4, linktoseries = false, max_bars_back = 1000, max_lines_count = 500)

// BULB Indicator settings


recommendation = input(true, title = 'BULB')
rsiSource = close
rsiLength = 13
rsiOverbought = 65
rsiOvesold = 30
rsiValue = ta.rsi(rsiSource, rsiLength)
isOverbought = rsiValue >= rsiOverbought
isOversold = rsiValue <= rsiOvesold
var laststate = 0
var hh = low
var ll = high
var label labelll = na
var label labelhh = na
var last_actual_label_hh_price = 0.0
var last_actual_label_ll_price = 0.0

obLabelText() =>
if last_actual_label_hh_price < high
'sell'
else
'sell'

osLabelText() =>
if last_actual_label_ll_price < low
'buy'
else
'buy'

createOverBoughtLabel(isIt) =>
if isIt
label.new(x = bar_index, y = na, yloc = yloc.price, style =
label.style_label_down, color = #F70700, size = size.normal, text = obLabelText(),
textcolor = color.white)
else
label.new(x = bar_index, y = na, yloc = yloc.price, style =
label.style_label_up, color = #22E139, size = size.normal, text = osLabelText(),
textcolor = color.white)

moveOversoldLabel() =>
label.set_x(labelll, bar_index)
label.set_y(labelll, low)
label.set_text(labelll, osLabelText())

moveOverBoughtLabel() =>
label.set_x(labelhh, bar_index)
label.set_y(labelhh, high)
label.set_text(labelhh, obLabelText())

if laststate == 2 and isOverbought and recommendation


hh := high
labelhh := createOverBoughtLabel(true)
last_actual_label_ll_price := label.get_y(labelll)
labelll_ts = label.get_x(labelll)
labelll_price = label.get_y(labelll)
labelll_price

if laststate == 1 and isOversold and recommendation


ll := low
labelll := createOverBoughtLabel(false)
last_actual_label_hh_price := label.get_y(labelhh)
labelhh_ts = label.get_x(labelhh)
labelhh_price = label.get_y(labelhh)
labelhh_price

if isOverbought and recommendation


if high >= hh
hh := high
moveOverBoughtLabel()
laststate := 1
laststate

if isOversold and recommendation


if low <= ll
ll := low
moveOversoldLabel()
laststate := 2
laststate

if laststate == 1 and isOverbought and recommendation


if hh <= high
hh := high
moveOverBoughtLabel()

if laststate == 2 and isOversold and recommendation


if low <= ll
ll := low
moveOversoldLabel()

if laststate == 1 and recommendation


if hh <= high
hh := high
moveOverBoughtLabel()

if laststate == 2 and recommendation


if ll >= low
ll := low
moveOversoldLabel()

// Custom ATR Bands settings


mal = input(defval = 47, title = 'Half Length')
mva = ta.sma(close, mal)
atrl = input(defval = 89, title = 'Atr Length')
atrv = ta.atr(atrl)
atrm = input(defval = 3.0, title = 'Atr Multiplier')
pEnv = mva + mva * atrv / close * atrm
mEnv = mva - mva * atrv / close * atrm

plot(mva, title = 'Simple Moving Average', linewidth = 2)


plot(pEnv, color = color.new(color.red, 0), title = 'High Envelope', linewidth = 2)
plot(mEnv, color = color.new(color.green, 0), title = 'Low Envelope', linewidth =
2)

You might also like