TradingView
mongolor
7 de Ago de 2020 08:24

Renko Level Strategy 2 

SberbankMOEX

Descrição

Renko Level Strategy

Main change of my previous strategy, that it look to one level of RENKO and use ATR value from each previous candle.
I think it is more correct than use levels that appears in first candle of new RENKO level, cause it base on current volatility, but not on volatility that was many candles ago.
Comentários
tradjngv2
reppaint...????
TBHBR1
@tradjngv2, there's no repaint i tested it.
consciousPlaye69725
This is a really good strategy. I have included the TP, SL and also sell order.

//@version=4
strategy("Renko Level Strategy 2", shorttitle="RLS2", overlay=true, pyramiding=2, currency=currency.USD, default_qty_value=50, initial_capital=2000, default_qty_type=strategy.percent_of_equity)

TF = input(title='TimeFrame', type=input.resolution, defval="D")
ATRlength = input(title="ATR length", type=input.integer, defval=14, minval=2, maxval=100)
stoploss = input(title="Stop Loss", type=input.integer, defval=50, minval=1, maxval=100)
profit_target = input(title="Profit Target", type=input.integer, defval=100, minval=1, maxval=100)

HIGH = security(syminfo.tickerid, TF, high)
LOW = security(syminfo.tickerid, TF, low)
CLOSE = security(syminfo.tickerid, TF, close)
ATR = security(syminfo.tickerid, TF, atr(ATRlength))

float RENKO = na
color COLOR = na
int BUY = na
int SELL = na
bool UP = na
bool DN = na

RENKO := na(RENKO[1]) ? close : RENKO[1]
COLOR := na(COLOR[1]) ? color.white : COLOR[1]
BUY := na(BUY[1]) ? 0 : BUY[1]
SELL := na(SELL[1]) ? 0 : SELL[1]
UP := false
DN := false

if(close > RENKO[1]+ATR[1])
UP := true
RENKO := close
COLOR := color.lime
SELL := 0
BUY := BUY+1

if(close < RENKO[1]-ATR[1])
DN := true
RENKO := close
COLOR := color.red
BUY := 0
SELL := SELL+1

if(BUY[1]==1 and BUY==2)
strategy.entry("long", strategy.long, stop=strategy.position_avg_price - stoploss*syminfo.mintick, limit=strategy.position_avg_price + profit_target*syminfo.mintick)

if(DN)
strategy.cancel_all()
strategy.close_all(comment = "close")

if(SELL[1]==1 and SELL==2)
strategy.entry("short", strategy.short, stop=strategy.position_avg_price + stoploss*syminfo.mintick, limit=strategy.position_avg_price - profit_target*syminfo.mintick)

plot(RENKO, style=plot.style_line, linewidth=2, color=COLOR)
kkhaial
Nice! you planning on adding a Take profit and and also shorts?
mongolor
@kkhaial, nope in shorts it works bad.
kkhaial
@mongolor, How about TP ?
MahmutYilmaz
very nice
Mais