bot.py
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
The issue is a code dump of a trading bot script with an exposed API token. The work likely involves removing or securing the token, understanding the bot's structure in bot.py, and checking for other security issues. Start by examining the repository's existing bot code to see how tokens are managed, then replace the hardcoded token with environment variables or a config file. Test that the bot still runs after the change.
Written by the indexing model from the issue text.
Description
import telebot
from telebot import types
import yfinance as yf
import pandas as pd
import pandas_ta as ta # مكتبة للتحليل الفني المتقدم
import random
import time
API_TOKEN = '8520359044:AAE_rauPy-TUhNgOYxkIByOC-5fnV9Aj15c'
bot = telebot.TeleBot(API_TOKEN)
def advanced_analysis(symbol):
try:
# جلب بيانات كافية للتحليل (آخر 200 دقيقة)
df = yf.download(symbol, period='1d', interval='1m', progress=False)
if df.empty or len(df) < 50: return "⚠️ سيولة ضعيفة حالياً، انتظر توفر البيانات."
# 1. حساب المؤشرات الفنية
df['EMA_200'] = ta.ema(df['Close'], length=50) # متوسط الاتجاه
df['RSI'] = ta.rsi(df['Close'], length=14) # قوة الزخم
last_row = df.iloc[-1]
prev_row = df.iloc[-2]
current_price = float(last_row['Close'])
rsi_val = float(last_row['RSI'])
ema_val = float(last_row['EMA_200'])
# 2. منطق "الفلترة الاحترافية"
signal = "⚖️ انتظر فرصة أفضل"
decision = None
# شروط الشراء القوية (SMC + Trend)
if current_price > ema_val and rsi_val < 70 and last_row['Close'] > last_row['Open']:
if current_price > df['High'].iloc[-5:-1].max(): # كسر قمة قريبة (MSB)
decision = "BUY"
signal = f"🟢 **إشارة شراء (CALL) قوية**\n🔥 السعر فوق الـ EMA ومتجه للأعلى."
# شروط البيع القوية (SMC + Trend)
elif current_price < ema_val and rsi_val > 30 and last_row['Close'] < last_row['Open']:
if current_price < df['Low'].iloc[-5:-1].min(): # كسر قاع قريب (MSB)
decision = "SELL"
signal = f"🔴 **إشارة بيع (PUT) قوية**\n🔥 السعر كسر الهيكل لأسفل."
if decision:
win_rate = random.randint(88, 94)
return f"{signal}\n🎯 السعر: `{current_price:.5f}`\n📈 RSI: {rsi_val:.1f}\n✅ الثقة: {win_rate}%"
else:
return "⚠️ **السوق حالياً متذبذب (عرضي)**\nلا توجد إشارة دخول آمنة، يفضل الانتظار."
except Exception as e:
return "❌ فشل التحليل الفني، حاول مرة أخرى."
--- الواجهة والأوامر ---
@bot.message_handler(commands=['start'])
def start(message):
markup = types.ReplyKeyboardMarkup(row_width=2, resize_keyboard=True)
markup.add('EUR/USD', 'GBP/USD', 'USD/JPY', 'XAU/USD (الذهب)', '📊 فحص السيولة')
bot.send_message(message.chat.id, "💎 بوت التحليل الاحترافي V4.0\nتم تفعيل فلاتر SMC و EMA لضمان دقة الإشارات.", reply_markup=markup)
@bot.message_handler(func=lambda message: True)
def handle_requests(message):
pairs = {'EUR/USD': 'EURUSD=X', 'GBP/USD': 'GBPUSD=X', 'USD/JPY': 'JPY=X', 'XAU/USD (الذهب)': 'GC=F'}
if message.text in pairs:
loading = bot.send_message(message.chat.id, "🔍 جاري فحص 200 شمعة وتطبيق فلاتر السيولة...")
result = advanced_analysis(pairs[message.text])
final_msg = (
f"📥 **نتائج التحليل الفوري**\n"
f"--------------------------\n"
f"💹 الزوج: {message.text}\n"
f"{result}\n"
f"--------------------------\n"
f"💡 *نصيحة: إذا ظهرت رسالة 'انتظر'، فلا تدخل الصفقة أبداً.*"
)
bot.delete_message(message.chat.id, loading.message_id)
bot.send_message(message.chat.id, final_msg, parse_mode="Markdown")
if name == "main":
bot.polling(none_stop=True)
- Dominant language
- Python
- Stars
- 225
- Forks
- 672
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AbirHasan2005/PyroFilesStoreBot
-
KetabOpen
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
bot.pyOpen
Difficulty 3/5 1-2 days Newbie friendliness 30/100
AbirHasan2005/PyroFilesStoreBot#69 · 1 comment ·
-
requirements.txtOpen
Difficulty 1/5 Under an hour Newbie friendliness 20/100
-
bot.pyOpen
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
requirements.txtOpen
Difficulty 1/5 Under an hour Newbie friendliness 10/100
All issues in AbirHasan2005/PyroFilesStoreBot
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Qiskit/qiskit-ibm-runtime#3431 · 1 comment ·
Maintainers usually reply within 1 day
-
[Lesson] A compatibility-gate rejection is a verdict, not something to overwrite with --accept-riskOpenlesson-submission needs-ac pending-review
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Ikalus1988/MisakaNet#2870 ·
Maintainers usually reply within 1 day
-
feature:LinkChecker
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
digitalfabrik/integreat-cms#4594 ·
Maintainers usually reply within 5 days