kggi

EMA50Diff & MACD Strategy

One of my attempts to create a strategy for BTC.

Its a combination of EMA50Diff (the difference between spot and EMA50) and MACD.
Buy signal if (EMA50Diff) < -(EMADiffThreshold),
(MACD bearish crossunder),
(MACD) < -(MACDThreshold),
(EMA50Diff) > (EMA50Diff 1 candle ago),
(EMA50Diff 1 candle ago) < (EMA50Diff 2 candles ago)

Sell signal if (EMA50Diff) > (EMADiffThreshold),
(MACD bullish crossover),
(MACD) > (MACDThreshold),
(EMA50Diff) < (EMA50Diff 1 candle ago),
(EMA50Diff 1 candle ago) > (EMA50Diff 2 candles ago)

Exit either when target or stoploss get reached.

Initial capital is set to 100k and its currently going all-in on every trade but im looking for a better way to handle position sizes already..
Also i included slippage of 30 ticks and exchange commission of 0.15% (e.g. 2x BitMEX market taker fee)

Works best on 15m on bitfinex, bitstamp and gdax and i'm still trying to optimize it for bitmex too, will update when i got there..
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?