uzahiron11

Skrip menentukan buy and sell berpatokan dengan ema 9 x ema21

BINANCE:XRPUSDT   XRP / TetherUS
import talib

# Fungsi untuk menentukan buy dan sell
def determine_signal(data):
# Menghitung EMA 9 dan EMA 21
ema9 = talib.EMA(data, timeperiod=9)
ema21 = talib.EMA(data, timeperiod=21)

# Menentukan signal buy dan sell
signal = ""
if ema9 > ema21 and ema9 <= ema21:
signal = "Buy"
elif ema9 < ema21 and ema9 >= ema21:
signal = "Sell"

return signal

# Contoh data harga crypto
data =

# Menentukan signal untuk data tersebut
signal = determine_signal(data)
print(signal)
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.