INVITE-ONLY SCRIPT

Super BitMoon v1

Theo Kingii91
Set time frame to 12hr & candles to heikin ashi

Copy and paste following script into the pine editor:

//version=2
strategy("Super BitMoon v1", overlay=true, commission_value = 0.25, default_qty_type=strategy.percent_of_equity, default_qty_value = 100)

/////////////////////////////////////////////////////////////
//START - SET DATE RANGE

// === BACKTEST RANGE ===
FromMonth = input(defval = 1, title = "From Month", minval = 1)
FromDay = input(defval = 1, title = "From Day", minval = 1)
FromYear = input(defval = 2012, title = "From Year")
ToMonth = input(defval = 12, title = "To Month", minval = 1)
ToDay = input(defval = 31, title = "To Day", minval = 1)
ToYear = input(defval = 2018, title = "To Year")

startDate = time > timestamp(FromYear, FromMonth, FromDay, 00, 00)
endDate = time < timestamp(ToYear, ToMonth, ToDay, 23, 59)
withinTimeRange = startDate and endDate

/////////////////////////////////////////////////////////////
//END - SET DATE RANGE



/////////////////////////////////////////////////////////////
//START - INDICATORS

//ATR STOP
length = input(5, title="ATR Stop's Length")
mult = input(1, minval=0.01, title="ATR Stop's Multiple")
atr_ = atr(length)
max1 = max(nz(max_[1]), close)
min1 = min(nz(min_[1]), close)
is_uptrend_prev = nz(is_uptrend[1], true)
stop = is_uptrend_prev ? max1 - mult * atr_ : min1 + mult * atr_
vstop_prev = nz(vstop[1])
vstop1 = is_uptrend_prev ? max(vstop_prev, stop) : min(vstop_prev, stop)
is_uptrend = close - vstop1 >= 0
is_trend_changed = is_uptrend != is_uptrend_prev
max_ = is_trend_changed ? close : max1
min_ = is_trend_changed ? close : min1
vstop = is_trend_changed ? is_uptrend ? max_ - mult * atr_ : min_ + mult * atr_ : vstop1

//SYNTHETIC VIX
pd = input(5, title="Synthetic VIX's Length")
bbl = input(5, title="Synthetic VIX's Bollinger Band's Length")
mult2 = input(0.33, minval=0.01, title="Synthetic VIX's Bollinger Band's Std Dev")
wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100
sDev = mult2 * stdev(wvf, bbl)
midLine = sma(wvf, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev

//RSI
rsi = rsi(close, input(4,title="RSI's Length"))
ob = input(60,title="RSI's Oversold Level")
os = input(40,title="RSI's Oversold Level")

/////////////////////////////////////////////////////////////
//END - INDICATORS



/////////////////////////////////////////////////////////////
//START - TRADING RULES
direction = input(defval=1, title = "Strategy Direction", type=integer, minval=-1, maxval=1)
strategy.risk.allow_entry_in(direction == 0 ? strategy.direction.all : (direction < 0 ? strategy.direction.short : strategy.direction.long))

condition1 = crossunder(wvf, upperBand) and close > vstop and withinTimeRange
condition2 = crossunder(rsi, os) and withinTimeRange

strategy.entry("BUY", strategy.long, when = condition1)
strategy.entry("SELL", strategy.short, when = condition2)

/////////////////////////////////////////////////////////////
//END - TRADING RULES
OscillatorsTrend AnalysisVolatility

Tập lệnh chỉ hiển thị cho người được mời

Quyền truy cập vào tập lệnh này bị hạn chế đối với người dùng được tác giả ủy quyền và thường yêu cầu thanh toán. Bạn có thể thêm nó vào mục yêu thích của mình, nhưng bạn sẽ chỉ có thể sử dụng nó sau khi yêu cầu sự cho phép từ tác giả. Liên hệ Kingii91 để thêm thông tin, hoặc làm theo hướng dẫn của tác giả bên dưới.

Xin lưu ý rằng đây là tập lệnh riêng tư, chỉ dành cho người được mời và người kiểm duyệt tập lệnh không phân tích. Chưa xác định có tuân thủ với Quy tắc nội bộ không. TradingView đề xuất bạn không thanh toán và sử dụng tập lệnh trừ khi bạn tin tưởng 100% vào tác giả của tập lệnh và hiểu cách hoạt động của tập lệnh. Trong nhiều trường hợp, bạn có thể tìm thấy giải pháp thay thế nguồn mở tốt miễn phí trong Tập lệnh cộng đồng của chúng tôi.

Hướng dẫn của tác giả

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Cảnh báo: vui lòng đọc trước khi yêu cầu quyền truy cập.

Thông báo miễn trừ trách nhiệm