BITTREX:ETHUSDT   Ethereum / Tether
I finished this MACD & BB strategy. Back testing shows promising results in just 7 months worth of trades. Below is the script feel free to play around with it, and if you can make any improvements please share..

Oh, on the alerts.. I realize that the script has to be in study mode.. I may use this in study mode once I'm done to trigger alerts to be sent to Gunbot.. Any ideas on that are welcomed too.

//@version=3
strategy("MACD & BB Strategy Script - ETH/USDT 4 HR", overlay=true)

/////
MacdSrc = input(close, title="Source")

macdfastLength = input(4, minval=1)
macdslowLength=input(22,minval=1)
macdsignalLength = input(9,minval=1)

fastMA = ema (MacdSrc, macdfastLength)
slowMA = ema (MacdSrc, macdslowLength)
macd = fastMA - slowMA
macdsignal = sma ( macd , macdsignalLength)
macdhist = macd - macdsignal

/////
BBsrc = input(high, title = "source")

len             = input(19, title = "timeframe / # of period's")
bbbase = ema (BBsrc, len             )
evar             = (BBsrc - bbbase)*(BBsrc - bbbase)
evar2 = (sum( evar             , len             ))/len
std = sqrt(evar2)
Multiplier = input(2, minval = 0.01, title = "# of STDEV's")
bbupper = bbbase + (Multiplier * std)
bblower = bbbase - (Multiplier * std)

/////
buyMACD = cross( macd , macdsignal) and macd > macdsignal
sellMACD = cross( macd , macdsignal) and macd < macdsignal
buyBB = crossunder(BBsrc, bblower)
sellBB = crossover(BBsrc, bbupper)

if (crossover(macdhist, 0))
strategy.entry("MacdLE", strategy.long, comment="MACD Entry", when=buyMACD)

if (crossunder(macdhist, 0))
strategy.close_all(when = sellMACD)

longCondition = crossunder(BBsrc, bblower)
if (longCondition)
strategy.entry("BB Entry", strategy.long, comment="BB Entry", when=buyBB)

shortCondition = crossover(BBsrc, bbupper)
if (shortCondition)
strategy.close_all(when=sellBB)

/////
alertcondition(buyMACD, title='MACD Buy')
alertcondition(sellMACD, title='MACD Sell', message='MACD Sell Signal!')
alertcondition(buyBB, title='BB Buy', message='BB Buy Signal!')
alertcondition(sellBB, title='BB Sell', message='BB Sell Signal!')

/////
plot(bbbase, color = purple, linewidth = 1, title = "BB Basis")
plot(bbupper, color = blue, linewidth = 1, title = "BB Upper band")
plot(bblower, color = blue, linewidth = 1, title = "BB Down band")
評論: All trading involves high risk; past performance is not necessarily indicative of future results. Hypothetical or simulated performance results have certain inherent limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not actually been executed, the results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown.
I used the script on ZCash since it has been trading sideways.. Over a year if you would have bought and held Zcash you would have made 45.21%.. Back testing my script to trigger buy/sell positions with ZCash it would have hypothetically made 656.71% over 12 months..
回覆
ZH 繁體中文
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
AR العربية
HE עברית
首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 如何運作 圖表功能 網站規則 版主 網站 & 經紀商解決方案 小工具 圖表庫 功能請求 部落格 & 新聞 常見問題 幫助 & 維基 推特
個人資料 個人資料設定 帳戶和帳單 我的支援工單 聯絡客服 發表的想法 粉絲 正在關注 私人訊息 在線聊天 登出