TradingView
AGHYAD90
Jul 5, 2018 2:37 PM

[AGHYAD]Renko+Sniper+EMA_V1 

EOS / BitcoinBinance

Description

// 2 HOURS
// -------------------------- BUY --------------------------
// 1. MUST: Set Time_Frame To 1D
// 2. STRONG: Any Green Signal!!
// -------------------------- SELL -------------------------
// ON THE FIRST Red SIGNAL
Comments
pioppopippo
repaints
lovelycococo
Great!
Your script made me interested in Renko.
diogosmo
Good Morning! Great job with the script. I would like to know if it will be made available and how?
dpanday
@AGHYAD90, does the CCI script with alerts repaint?
SuperWaveTrend
Would you please tell me how this script will paint again
jggrow0
Is your back-testing done in Pine version 2 or 3? Version 2 is bugged.
AGHYAD90
@jggrow0, version 3
dpanday
Can you post the study script?
AGHYAD90
@dpanday,


strategy(title="[AGHYAD]Renko+Sniper+EMA_V1", shorttitle="[AGHYAD]RENKO_EMA_STRATEGY_V1", overlay=true, default_qty_type=strategy.cash, default_qty_value=200,
initial_capital=1000, currency=currency.USD)

//============================================
//Modified - Renko_Bars--------------------------------------------------------------------------------------------------------------------------------- // Signal 1
//============================================

timeFrame = input(title="SIGNALS_TIME_FRAME", type=resolution, defval="D")

//rt = input(true, title="ATR Based REnko is the Default, UnCheck to use Traditional ATR?")
atrLen = input(1, minval=1, title="RENKO_ATR")
isATR = input(true, title="RENKO_USE_RENKO_ATR")
tradLen1 = input(1000, minval=0, title="RENKO_TRADITIONAL")

//Code to be implemented in V2
//mul = input(1, "Number Of minticks")
//value = mul * syminfo.mintick

tradLen = tradLen1 * 1

param = isATR ? renko(tickerid, "open", "ATR", atrLen) : renko(tickerid, "open", "Traditional", tradLen)

renko_close = security(param, timeFrame, close)
renko_open = security(param, timeFrame, open)


col2 = renko_close < renko_open ? red : lime

p11=plot(renko_close, style=circles, linewidth=1, color=col2, title="RENKO_1", transp=100)
p22=plot(renko_open, style=circles, linewidth=1, color=col2, title="RENKO_2", transp=100)
fill(p11, p22, color=col2, transp=100, title="RENKO_fill")

//============================================
//Sniper------------------------------------------------------------------------------------------------------------------------------------- // Signal 2
//============================================

Factor=input(1, minval=1,maxval = 1000, title="SNIPER_Trend Transition Signal")
Pd=input(1, minval=1,maxval = 1000, title="SNIPER_Period")
Up=((renko_close+renko_open)/2)-(Factor*atr(Pd))
Dn=((renko_close+renko_open)/2)+(Factor*atr(Pd))
TrendUp=renko_close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up
TrendDown=renko_close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn
Trend = renko_close > TrendDown[1] ? 1: renko_close< TrendUp[1]? -1: nz(Trend[1],0)
plotarrow(Trend == 1 and Trend[1] == -1 ? Trend : na, title="SNIPER_Up Entry Arrow", colorup=lime, maxheight=1000, minheight=50, transp=75)
plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="SNIPER_Down Entry Arrow", colordown=red, maxheight=1000, minheight=50, transp=75)


//============================================
//EMA_CROSS-------------------------------------------------------------------------------------------------------------------------------- // Signal 4
//============================================

EMA1_length=input(2, "EMA1_length", integer)
EMA2_length=input(10, "EMA2_length", integer)

a = ema(renko_close, EMA1_length)
b = ema(renko_close, EMA2_length)

BUY = cross(a, b) and a > b and renko_open < renko_close
SELL = cross(a, b) and a < b and renko_close < renko_open


///////////////////////////////



// Determine long and short conditions
longCondition = crossover(a, b)
shortCondition = crossunder(a, b)

// Submit orders
strategy.entry(id="B", long=true, when=longCondition)
strategy.entry(id="S", long=false, when=shortCondition)
dpanday
@AGHYAD90, Thanks but this is the strategy. Do you have the study script with alerts?
More