Search
Products
Community
Markets
News
Brokers
More
EN
Cyber Monday sale
Up to 70% OFF
Community
/
Ideas
/
New script
Bitcoin / TetherUS
New script
By CryptoMinerCanada
Follow
Follow
Dec 18, 2022
2
3
3
Dec 18, 2022
Bitcoin buy and sell
// RSI and EMA strategy for Bitcoin on Bitfinex with buy and sell signals
// Constants
// RSI period
rsi_period = 14
// EMA periods
ema_fast_period = 10
ema_slow_period = 20
// Indicators
rsi = rsi(close, rsi_period)
ema_fast = ema(close, ema_fast_period)
ema_slow = ema(close, ema_slow_period)
// Trading logic
if (rsi > 70)
strategy.entry("Long", strategy.long)
strategy.entry("Buy", strategy.long)
else if (rsi < 30)
strategy.entry("Short", strategy.short)
strategy.entry("Sell", strategy.short)
if (ema_fast > ema_slow)
strategy.exit("Exit long", "Long")
strategy.close("Buy")
else if (ema_fast < ema_slow)
strategy.exit("Exit short", "Short")
strategy.close("Sell")
Bitcoin (Cryptocurrency)
Technical Indicators
CryptoMinerCanada
Follow
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
.