0% found this document useful (0 votes)
16 views

MACD PULBA CHART REDDIT COMMENT SCRIPT by ITCHY

Uploaded by

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

MACD PULBA CHART REDDIT COMMENT SCRIPT by ITCHY

Uploaded by

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

//@version=5

strategy("STRATEGY FOR RSI, PULBA, MACD and Williams %R", overlay=true)

// RSI
rsi_len = input.int(14, title="RSI Length")
rsi_lvl1 = input.int(70, title="RSI Overbought Level")
rsi_lvl2 = input.int(30, title="RSI Oversold Level")
rsi = ta.rsi(close, rsi_len)

// PULBA
pulba_len = input.int(20, title="PULBA Length")
pulba_up = ta.highest(high, pulba_len)
pulba_dn = ta.lowest(low, pulba_len)

// MACD
macd_fast = input.int(12, title="MACD Fast Length")
macd_slow = input.int(26, title="MACD Slow Length")
macd_sig = input.int(9, title="MACD Signal Length")
[macd_line, macd_signal, _] = ta.macd(close, macd_fast, macd_slow, macd_sig)

// Williams %R
wpr_len = input.int(14, title="Williams %R Length")
wpr_lvl1 = input.int(-20, title="Williams %R Overbought Level")
wpr_lvl2 = input.int(-80, title="Williams %R Oversold Level")
wpr = ta.wma(((ta.highest(high, wpr_len) - close) / (ta.highest(high, wpr_len) - ta.lowest(low,
wpr_len))) * -100, 9)

// Plotting
plot(rsi, title="RSI", color=color.blue)
hline(rsi_lvl1, "RSI Overbought", color=color.red, linestyle=hline.style_dashed)
hline(rsi_lvl2, "RSI Oversold", color=color.green, linestyle=hline.style_dashed)

plot(pulba_up, title="PULBA High", color=color.green)


plot(pulba_dn, title="PULBA Low", color=color.red)

plot(macd_line, title="MACD Line", color=color.orange)


plot(macd_signal, title="MACD Signal", color=color.purple)

plot(wpr, title="Williams %R", color=color.gray)


hline(wpr_lvl1, "Williams %R Overbought", color=color.red, linestyle=hline.style_dashed)
hline(wpr_lvl2, "Williams %R Oversold", color=color.green, linestyle=hline.style_dashed)

// Strategy
long_condition = (rsi < rsi_lvl2) and (close > pulba_up) and (macd_line > macd_signal) and (wpr <
wpr_lvl2)
short_condition = (rsi > rsi_lvl1) and (close < pulba_dn) and (macd_line < macd_signal) and (wpr >
wpr_lvl1)

if (long_condition)
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.entry("Short", strategy.short)

// Exits
stop_loss = input.float(0.5, title="Stop Loss (%)") * 0.01
take_profit = input.float(1, title="Take Profit (%)") * 0.01
strategy.exit("Long Exit", "Long", stop=close * (1 - stop_loss), limit=close * (1 + take_profit))
strategy.exit("Short Exit", "Short", stop=close * (1 + stop_loss), limit=close * (1 - take_profit))

You might also like