Trend Sniper

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Trend Sniper

Postby DanPhi74 » Sat Sep 12, 2020 3:23 pm

Hi

could you code this in LUA ?
//@version=2
//TraderB
study("Trend Sniper", shorttitle="Trend Sniper", precision=0)

showExtra = input(true, title="Show Higher Timeframe", type=bool)
higherTime = input(title="Extra Timeframe:", defval="15", type=resolution)
std = input(false, title="Line chart")
candles = input(true, title="Candle chart")
wicks = input(true, title="Wicks")
src_close = close
src_open = open
src_high = high
src_low = low

len = input(14, minval=1, title="Current Length")
len2 = input(14, minval=1, title="Extra Timeframe Length")

src = input(close, title="Source", type=source)
rsiExtra = security(ticker,higherTime,rsi(src,len2))

norm_close = avg(src_close,src_close[1])
gain_loss_close = change(src_close)/norm_close
RSI_close = 50+50*rma(gain_loss_close, len)/rma(abs(gain_loss_close), len)

norm_open = if wicks==true
avg(src_open,src_open[1])
else
avg(src_close,src_close[1])
gain_loss_open = change(src_open)/norm_open
RSI_open = 50+50*rma(gain_loss_open, len)/rma(abs(gain_loss_open), len)

norm_high = if wicks==true
avg(src_high,src_high[1])
else
avg(src_close,src_close[1])
gain_loss_high = change(src_high)/norm_high
RSI_high = 50+50*rma(gain_loss_high, len)/rma(abs(gain_loss_high), len)

norm_low = if wicks==true
avg(src_low,src_low[1])
else
avg(src_close,src_close[1])
gain_loss_low = change(src_low)/norm_low
RSI_low = 50+50*rma(gain_loss_low, len)/rma(abs(gain_loss_low), len)

plotcandle(candles?RSI_open:na, candles?RSI_high:na, candles?RSI_low:na, candles?RSI_close:na, title='Candles', color = RSI_close > RSI_close[1] ? #5d606b : #5d606b)
plot(std ? RSI_close : na, color=#a64d79ff, title="Line", join=true)
plot(showExtra ? rsiExtra : na, color= not ismonthly ? #004aaf : na, title="Higher Timeframe")
b1 = hline(30, color=#222222, linestyle=dotted, title = "Low")
b2 = hline(70, color=#222222, linestyle=dotted, title = "High")
b3 = hline(20, color=#333333, linestyle=dotted, title = "Lower Low")
b4 = hline(80, color=#333333, linestyle=dotted, title = "Higher High")
DanPhi74
 
Posts: 63
Joined: Tue Dec 22, 2015 4:47 am

Re: Trend Sniper

Postby Apprentice » Mon Sep 14, 2020 6:57 am

Your request is added to the development list.
Development reference 2027.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 27591
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia



Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 7 guests