⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
thread-self
/
root
/
home
/
python
/
Edit File: tpkontrol.py
import argparse from binance.client import Client from binance.enums import * from requests.exceptions import ConnectTimeout import redis parser = argparse.ArgumentParser() parser.add_argument("-symbol", help="Sembol Giriniz") args = parser.parse_args() symbol=args.symbol r=redis.Redis() current_position=r.hget("symbols",symbol).decode("utf-8") while True: try: c_unrealized_profit = float(current_position['unRealizedProfit']) c_notional = float(current_position['notional']) c_leverage = int(current_position['leverage']) c_roi = (c_unrealized_profit / (c_notional / c_leverage)) * 100 current_position_roi = round(c_roi, 2) if current_position['positionSide']=='LONG' else round(c_roi, 2)*-1 if current_position['positionSide']=='LONG': if current_position_roi > float(dbcoin['highroi']): islem.execute('UPDATE `coinlist` set `highroi`=%s where `id`=%s',(current_position_roi,dbcoin['id'])) baglanti.commit() high_roi=current_position_roi else: high_roi=float(dbcoin['highroi']) target_roi=high_roi - float(ayar['tp']) elif current_position['positionSide']=='SHORT': if current_position_roi > float(dbcoin['deeproi']): islem.execute('UPDATE `coinlist` set `deeproi`=%s where `id`=%s',(current_position_roi,dbcoin['id'])) baglanti.commit() deep_roi=current_position_roi else: deep_roi=float(dbcoin['deeproi']) target_roi=deep_roi - float(ayar['tp']) yon='LONG' if current_position['positionSide']=='SHORT' else 'SHORT' if current_position_roi <= target_roi and current_position_roi >=int(ayar['hedef']): pozisyonkapat(client,current_position,False) exit() except ConnectTimeout: print("Bağlantı zaman aşımı hatası. Yeniden deneyin.")
Simpan