这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Scalp_bnb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
pkg install python
pip install ccxt
pip install numpy
import ccxt
import time
import numpy as np

# SETARI BOT
symbol = "BNB/USDT"
order_size = 0.03 # Cantitatea cumparata/vanduta
scalp_percent = 0.001 # 0.1% miscari necesare
cooldown = 2 # secunde intre verificari

# CONECTARE BINANCE
exchange = ccxt.binance({
"apiKey": "API_KEY",
"secret": "API_SECRET"
})

# Functie pentru pret curent
def get_price():
return exchange.fetch_ticker(symbol)["last"]

# Pret initial
last_price = get_price()

print("Bot pornit pentru BNB Scalping!")

while True:
try:
price = get_price()

change = (price - last_price) / last_price

# CUMPARA cand pretul scade brusc (scalping)
if change <= -scalp_percent:
print(f"↓ Scade rapid -> CUMPARA la {price}")
# exchange.create_market_buy_order(symbol, order_size)
last_price = price

# VINDE cand pretul urca rapid
elif change >= scalp_percent:
print(f"↑ Creste rapid -> VINDE la {price}")
# exchange.create_market_sell_order(symbol, order_size)
last_price = price

time.sleep(cooldown)

except Exception as e:
print("Eroare:", e)
time.sleep(3)