guikroth

Range Filter Buy and Sell 5min

Original Version credits to DonovanWall

Actual Version i just set alerts and change the parameters for BTCUSDC 5min Chart.

NO REPAINT.

Wait For Barclose

从常用的脚本中删除 添加到常用的脚本
thx for putting the soucre code public

guys check this strategy it's based on this one but for 15m and is constantly in profit including 0.15 fee.
回复
Backtested with 0.08% fees, this strategy loses money.
+1 回复
Hi,
We very much like this Scripts. can you convert the same in python?
回复
Hi, i´d like to know which values i need to modify for 2H and 4H timeframe, thanks.
回复
We need to have heiken ashi candles with this indicator right?
+4 回复
@thefoob, yes
+1 回复
Hello, I still cant backtest; I used the script posted by Cryptooyster and it gives me an error on starting on line 22 and then it goes on. I have been manually backtesting this strategy and so far it works very well with gbp/jpy 4hrs but it would be faster to do it with the strategy tester; specially on the lower time frames.
+1 回复
Hello,
I past your strategy code in a new Pine, but when I hit Add to graphic I have a message error:

raison: line 29: mismatched input 'wper' expecting 'end of line without line continuation'

I am a bit new, maybe I made something wrong
Any idea?
+2 回复
@guikroth Here is ur code to backtest it
//@version=3

//Original Script > @DonovanWall

// Actual Version > @guikroth

//////////////////////////////////////////////////////////////////////////
// Settings for 5min chart, BTCUSDC. For Other coin, change the paremeters
//////////////////////////////////////////////////////////////////////////

strategy(title="Range Filter Buy and Sell 5min", overlay=true)

// Source

src = input(defval=close, title="Source")

// Sampling Period
// Settings for 5min chart, BTCUSDC. For Other coin, change the paremeters

per = input(defval=100, minval=1, title="Sampling Period")

// Range Multiplier

mult = input(defval=3.0, minval=0.1, title="Range Multiplier")

// Smooth Average Range

smoothrng(x, t, m)=>
wper = (t*2) - 1
avrng = ema(abs(x - x), t)
smoothrng = ema(avrng, wper)*m
smoothrng
smrng = smoothrng(src, per, mult)

// Range Filter

rngfilt(x, r)=>
rngfilt = x
rngfilt := x > nz(rngfilt) ? ((x - r) < nz(rngfilt) ? nz(rngfilt) : (x - r)) : ((x + r) > nz(rngfilt) ? nz(rngfilt) : (x + r))
rngfilt
filt = rngfilt(src, smrng)

// Filter Direction

upward = 0.0
upward := filt > filt ? nz(upward) + 1 : filt < filt ? 0 : nz(upward)
downward = 0.0
downward := filt < filt ? nz(downward) + 1 : filt > filt ? 0 : nz(downward)

// Target Bands

hband = filt + smrng
lband = filt - smrng

// Colors

filtcolor = upward > 0 ? lime : downward > 0 ? red : orange
barcolor = (src > filt) and (src > src) and (upward > 0) ? lime : (src > filt) and (src < src) and (upward > 0) ? green :
(src < filt) and (src < src) and (downward > 0) ? red : (src < filt) and (src > src) and (downward > 0) ? maroon : orange

filtplot = plot(filt, color=filtcolor, linewidth=3, title="Range Filter")

// Target

hbandplot = plot(hband, color=aqua, transp=100, title="High Target")
lbandplot = plot(lband, color=fuchsia, transp=100, title="Low Target")

// Fills

fill(hbandplot, filtplot, color=aqua, title="High Target Range")
fill(lbandplot, filtplot, color=fuchsia, title="Low Target Range")

// Bar Color

barcolor(barcolor)

// Break Outs

longCond = na
shortCond = na
longCond := ((src > filt) and (src > src) and (upward > 0)) or ((src > filt) and (src < src) and (upward > 0))
shortCond := ((src < filt) and (src < src) and (downward > 0)) or ((src < filt) and (src > src) and (downward > 0))

CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni

longCondition = longCond and CondIni == -1
if (longCondition)
strategy.entry("buy", strategy.long, comment="BUY")

shortCondition = shortCond and CondIni == 1
if (shortCondition)
strategy.entry("sell", strategy.short, comment="SELL")
+1 回复
dane4 Cryptooyster
@Cryptooyster, I get Add to Chart operation failed, reason: line 29: mismatched input 'wper' expecting 'end of line without line continuation' when trying to run this
回复
首页 股票筛选器 外汇筛选器 加密货币筛选器 财经日历 如何运作 图表功能 价格 网站规则 版主 网站 & 经纪商解决方案 插件 图表解决方案 帮助中心 功能请求 博客 & 新闻 常见问题 维基百科 Twitter
概述 个人资料设置 账号和账单 TradingView代币 我的客服工单 帮助中心 已发表观点 粉丝 正在关注 私人消息 聊天 退出