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")
Comment: 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..
Reply
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 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out