diff --git a/README.md b/README.md deleted file mode 100644 index 5fe2a6a..0000000 --- a/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# Awesome Python Scripts :snake: - -PyPI [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/hastagAB/Awesome-Python-Scripts) ![GitHub stars](https://img.shields.io/github/stars/hastagAB/Awesome-Python-Scripts?style=social) - - -## Contents: - -- [Awesome Python Scripts :sunglasses: ](#awesome-python-scripts-sunglasses----) - - [Contents:](#contents) - - [What is this repo?](#what-is-this-repo) - - [What do we have:](#what-do-we-have) - - [How to use:](#how-to-use) - - [Contribution Guidelines:](#contribution-guidelines) - - [Steps required to follow before adding any script](#steps-required-to-follow-before-adding-any-script) -- [If you like the project:](#if-you-like-the-project) -- [Want to connect with me?](#want-to-connect-with-me) - -## What is this repo? -This repo is a compilation of some *awesome* Python scripts that automate some boring tasks or simply make our life easier...or both! - -:cookie: Cookies for all contributors as well~ - -## What do we have: -So far, the following projects have been integrated to this repo: - -| Project Name | Contributors | -|--|--| -|[2048](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/2048)|[Krunal](https://github.com/gitkp11)| -|[AI chatbot](Artificial-intelligence_bot) |[umar abdullahi](https://github.com/umarbrowser) | -|[AI for guess the number](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/AI_for_Guess_the_number) | [Omar Sameh](https://github.com/ShadowHunter15) | -|[Address locator](Location_Of_Adress) | [Chris]() | -|[Asymmetric Encryption](asymmetric_cryptography) |[victor matheus](https://github.com/victormatheusc) | -|[Attachment Unique Mail](Attachment_Unique_Mail) |[Arnav Dandekar](https://github.com/4rnv) | -|[Automated calendar](automated_calendar) | [J.A. Hernández](https://github.com/jesusalberto18) | -|[Automated emails](automated_email) | [Suvigya](https://github.com/SuvigyaJain1) | -|[Battery_notification](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Battery_notification/)|[Krishna Sharma](https://github.com/krishnasharma1386)| -|[Better_CSV_Storage](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Better_CSV_Storage) | [Bhargav Kuvadiya](https://github.com/techdobz) | -|[Bitcoin price GUI](Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) | -|[CLI Calculator](cli_calculator)|[Willian GL](https://github.com/williangl) | -|[COVID visualiser (real-time) ](covid_visualiser)|[Tushar Gupta](https://github.com/tushar5526)| -|[CSV to Excel](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/CSV-to-Excel)|[xemeds](https://github.com/xemeds) | -|[Caesar Cipher](caesar_cipher) |[epi052](https://github.com/epi052) | -|[Checksum tool](Checksum) |[Austin Ewens](https://github.com/aewens) | -|[Clean_up_photo](Clean_up_photo_directory)|[sritanmay001](https://github.com/sritanmy001)| -|[Codechef autosubmitter](Codechef-Code-Submitter) |[Harshit Mahajan](https://github.com/hmahajan99) | -|[Codeforces Checker](codeforcesChecker)|[Jinesh Parakh](https://github.com/jineshparakh)| -|[Colored B&W Image Converter](Color_to_BW_Converter) |[Nitish Srivastava](https://github.com/nitish-iiitd) | -|[Contact 'Leads' Distribution](Contact-Distribution) |[Tiago Cordeiro](https://github.com/tiagocordeiro) | -|[Countdown](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Countdown)|[Jeremias Gomes](https://github.com/j3r3mias)| -|[csv_to_json](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/csv_to_json)|[MoiZ](https://github.com/TechBoyy6)| -|[Cricket Matches web Scraper](CricBuzz_Score_Update) |[Divy Ranjan](https://github.com/divyranjan17) | -|[Crypt socket](Crypt_Socket)|[Willian GL](https://github.com/williangl) | -|[Cryptocurrency Converter](Cryptocurrency-converter) |[AdnCodz](https://github.com/AdnCodez) | -|[Cryptocurrency Prices](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Cryptocurrency-Prices) |[xemeds](https://github.com/xemeds) | -|[Current City Weather](Current_City_Weather) |[Jesse Bridge](https://github.com/jessebridge) | -|[DNA Analysis Toolkit](https://github.com/shmlkv/dna-claude-analysis)|[shmlkv](https://github.com/shmlkv)| -|[DOH DIG](DOH-Dig/) | [Ryan](https://github.com/awsumco) | -|[Database-As-Storage](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Database-As-Storage) | [Bhargav Kuvadiya](https://github.com/techdobz) | -|[Directory Tree Visualizer](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Directory_Tree_Generator) | [Harpreet Singh Saluja](https://github.com/hssaluja25/) | -|[Directory organizer](Directory-organizer) | [Athul P](https://github.com/athulpn) | -|[Download Page as PDF](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Download-page-as-pdf)|[Jeremias Gomes](https://github.com/j3r3mias)| -|[Elasticsearch snapshot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/elastic-snapshot) | [Joe Ryan](https://github.com/joeryan) | -|[English Theasaurus](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/English_Theasauras/) | [Ansh Dhingra](https://github.com/anshdhinhgra47) | -|[Excel Files Merger](Excel_Files_Merger) | [Andrei N](https://github.com/Andrei-Niculae)| -|[Excel to List](Excel_to_ListofList) | [Nitish Srivastava](https://github.com/nitish-iiitd)| -|[Extended_ip_address_info](extended_ip_address_info) | [hafpaf](https://github.com/hafpaf)| -|[Face Recognition](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Face_recognition)|[LOKESH KHURANA](https://github.com/theluvvkhurana)| -|[Fibonacci_Sequence_Generator](Fibonacci_Sequence_Generator) | [John Wesley Kommala](https://github.com/JohnWesleyK)| -|[File Carving](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/File_Carving) | [Yeryeong Kim](https://github.com/icarusicarus/) | -|[File Encrypt Decrypt](file-encrypt-decrypt)|[Aditya Arakeri](https://github.com/adityaarakeri)| -|[FileMagic Organizer](./FileMagic_Organizer)|[malivinayak](https://github.com/malivinayak)| -|[File Organizer](File-Organizer)|[Ayush Bhardwaj](https://github.com/hastagAB)| -|[File Sharing Bot](File-Sharing-Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| -|[File explorer](File-Explorer-Dialog-Box) | [Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| -|[Find PhoneNumber in String](Find-PhoneNumber-in-String)|[Austin Zuniga](https://github.com/AustinZuniga)| -|[Flash card quizzer](Flash-card-Challenge) |[Utkarsh Sharma](https://github.com/Utkarsh1308) | -|[Folder Locker and hider](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Folder%20Locker%20%26%20Hider)|[Prajjwal Pathak](https://github.com/pyguru123)| -|[Folder Manager](Folder_Manager)|[Harsh Raj](https://github.com/DeadProgrammer0)| -|[Frammed text generator](FramedText) | [jcdwalle](https://github.com/jcdwalle)| -|[Get Time By TimeZone](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Get_Time_TimezoneWise)|[Parth Shah](https://github.com/codingis4noobs) | -|[git_automation](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/git_automation)| [loge1998](https://github.com/loge1998)| -|[Github repo creator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Git_repo_creator)|[Harish Tiwari ](https://github.com/optimist2309)| -|[Github Review Bot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Github-Review-Bot)|[Gaurav Giri](https://github.com/gaurovgiri)| -|[GithubBot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Github_Bot)|[Abhilasha](https://github.com/Abhilasha06)| -|[Gmail Mailing Script](mailing) |[mayank-kapur](https://github.com/kapurm17) | -|[Google Meet Joiner](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/google_meet_joiner)|[JohanSanSebastian](https://github.com/JohanSanSebastian)| -|[HTML Table to List](HTML_Table_to_List) | [Nitish Srivastava](https://github.com/nitish-iiitd)| -|[Handwrting DNN recognizer](Handwriting_Recognizer) |[Chris]() | -|[Harry Potter Cloak](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Harry-Potter-Cloak) | [thesmartdeveloperr](https://github.com/thesmartdeveloperr)| -|[IMDB TV Series Info Extractor](imdb_episode_ratings)|[Yash Raj Sarrof](https://github.com/yashYRS) | -|[IMDBQuerier](IMDBQuerier)|[Burak Bekci](https://github.com/Bekci)| -|[IP Address ](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/ipaddress)|[Xenium](https://github.com/xeniumcode)| -|[Image Compressor](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image_Compressor)|[Prathima Kadari](https://github.com/prathimacode-hub)| -|[Image To PDF](images2pdf)|[msaoudallah](https://github.com/msaoudallah)| -|[Image Watermarker (batch)](imageWatermarker)|[Remco Halman](https://github.com/remcohalman)| -|[Image circle formatter](Image-Circulator) |[Berk Gureken](https://github.com/bureken) | -|[Independent RSA Communication Algorithm](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/RSA_Communication)|[Miguel Santos](https://github.com/wi6n3l)| -|[Instadp Web Scrapper](InstadpShower)|[Psychiquest](https://github.com/psychiquest)| -|[Instagram Video Downloader](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/insta_video_downloader)|[Shobhit Bhosure](https://github.com/shobhit99) | -|[JSON file to YAML convertor](https://github.com/saksham117/Awesome-Python-Scripts/tree/master/json-to-yaml)|[Saksham Basandrai](https://github.com/saksham117)| -|[Keylogger](Keylogger) |[Preet Mishra](https://github.com/preetmishra) | -|[Medium Article Downloader](medium_article_downloader)|[coolsonu39](https://github.com/coolsonu39)| -|[Minecraft Server in background](Minecraft_server_in_background)|[Max von Forell](https://github.com/mvforell)| -|[Own IP locator](Location_Of_Own_IP_Adress)|[Chris]()| -|[PDF2text](PDF2text)|[QuangPH](https://github.com/quangph-1686a)| -|[PDFsplitter](PDFsplitter)|[Prathamesh-Ghatole](https://github.com/Prathamesh-Ghatole)| -|[PX to REM](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/PX-to-REM)|[Atthaphon Urairat](https://github.com/uatthaphon) | -|[Pdf to AudioBook Converter](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/PdfToAudio)|[Ayesha Gull](https://github.com/ayeshag7/)| -|[Plagiarism_detector](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Plagiarism_detector)|[Akshita Singhal](https://github.com/akshitasinghal4444)| -|[Port Scanner](Port_Scanner)|[Plutoberth](https://github.com/Plutoberth)| -|[Pressure_Converter](https://github.com/E-wave112/Awesome-Python-Scripts/tree/master/Pressure_Converter)|[E-Wave](https://github.com/E-wave112)| -|[Pretty CSV](Pretty-CSV)|[Frizz925](https://github.com/Frizz925)| -|[PyRecorder](PyRecorder)|[Rocky Jain](https://github.com/jainrocky)| -|[py_based_music_player](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/py_based_music_player) | [Bhargav Kuvadiya](https://github.com/techdobz) | -|[Py_Cleaner](Py_Cleaner) | [Abhishek Dobliyal](https://github.com/Abhishek-Dobliyal)| -|[Python Algebra Solver](Algebra-Solver)|[Sengxay Xayachack](https://github.com/frankxayachack)| -|[RSA Algorithm](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/RSA_Algorithm)|[Chinmay Rane](https://github.com/Chinmayrane16)| -|[RSA Key Pair Generator](RSA-key-pairs) | [Aditya Parikh](https://github.com/obiwan69) | -|[Random Password Generators](Random_Password_Generator)| [Hafpaf](https://github.com/hafpaf) and [Renderer-RCT2](https://github.com/Renderer-RCT2)| -|[Random name generator](Random_Names_Generator)| [Ayush Bhardwaj](https://github.com/hastagAB)| -|[Random_Email_Generator](Random_Email_Generator)|[Shubham Garg](https://github.com/shub-garg)| -|[Remove-Duplicate-Files](Remove-Duplicate-Files)|[Aayushi Varma](https://github.com/aayuv17)| -|[Rock-Paper-Scissor Game](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Rock-Paper-Scissor)|[Punit Sakre](https://github.com/punitsakre23)| -|[send_whatsapp_message](send_whatsapp_message)|[Mukesh Prasad](https://github.com/mukeshprasad)| -|[Send messages to sqs in parallel](send_sqs_messages_in_parallel)|[Jinam Shah](https://github.com/jinamshah)| -|[Server Ping](Ping_Server)|[prince]()| -|[Signature photo to PNG converter](signature2png)|[Rodolfo Ferro](https://github.com/RodolfoFerro)| -|[Simple Webpage Parser](SimpleWebpageParser)|[Nitish Srivastava](https://github.com/nitish-iiitd)| -|[Slideshare downloader](Slideshare-Downloader)|[Chris Goes](https://github.com/GhostofGoes)| -|[SMS your location](SmsYourLocation)|[prince]()| -|[Spotify Downloader](spotify_downloader)|[Sagar Patel](https://github.com/sagar627)| -|[Squid installer for Ubuntu](Squid-Proxy-Installer-for-Ubuntu16)|[Berkay Demir]()| | -|[SSH Host adder](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/SSH_Host_Adder)|[NinoDoko](https://github.com/NinoDoko)| -|[Steg_Tool](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Steg_Tool/)|[Shankar JP](https://github.com/shankarjp)| -|[sudoku-solver](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/sudoku-solver) | [Rishabh Umrao](https://github.com/ayedaemon) | -|[Subtitle downloader](Subtitle-downloader)|[Kaushlendra Pratap](https://github.com/kaushl1998)| -|[TTS - Text to Speech Mp3](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TTS_Text_to_Speech_Mp3)|[Antonio Andrade](https://github.com/xAndrade)| -|[Take Screenshot](Take_screenshot)|[Moad Mohammed Elhebri](https://github.com/moadmmh)| -|[Tambola_Ticket_Generator](Tambola_Ticket_Generator)|[Amandeep_Singh](https://github.com/Synster)| -|[Test Your Internet Speed](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TestMyInternetSpeed)|[TheSmartDeveloperr](https://github.com/thesmartdeveloperr)| -|[TicTacToe AI and 2 players](https://github.com/ShadowHunter15/Awesome-Python-Scripts/tree/master/TicTacToe_AI_and_2_players) | [Omar Sameh](https://github.com/ShadowHunter15) | -|[To Do Bot](To%20Do%20Bot) | [Darshan Patel](https://github.com/DarshanPatel11)| -|[Top_News](Top_News)|[Attupatil](https://github.com/Attupatil)| -|[Translate CLI](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TranslateCLI)|[Rodrigo Oliveira](https://github.com/rodrigocam)| -|[URL shortener](url_shortener)|[Sam Ebison](https://github.com/ebsa491)| -|[Upload Files to S3](Upload_files_to_s3)|[Jayram Nai](https://github.com/jramnai)| -|[Vinegère Cipher](vigenere_cipher)|[victoni](https://github.com/victoni)| -|[Web proxy](Proxy-Request)|[Nikhil Kumar Singh](https://github.com/nikhilkumarsingh)| -|[Website Url Detector](Website_Url_Detector)|[sonniki](https://github.com/sonniki)| -|[Website blocker](Website-Blocker)|[Ayush Bhardwaj](https://github.com/hastagAB)| -|[WiFi Password Viewer](Wifi-Password)|[Sagar Patel](https://github.com/sagar627)| -|[Wikipedia-Search](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Wikipedia-Search)|[Nissaar](https://github.com/Nissaar) | -|[Word Frequency Counter](Word_Frequency_Counter)|[sonniki](https://github.com/sonniki)| -|[Word generator](Word-generator)|[TGLIDE](https://github.com/TGlide)| -|[Work log generator](Work_Log_Generator)|[Maël Pedretti](https://github.com/73VW)| -|[X Scrapper](X_Scrapper)|[Shreeram](https://github.com/iamshreeram)| -|[YTS Torrents](yts_torrents)|[Mayank Nader](https://github.com/makkoncept)| -|[Yoda-speak Translator](speak_like_yoda)|[sonniki](https://github.com/sonniki) | -|[Youtube video downloader](Youtube_Video_Downloader)|[Christopher He](https://github.com/hecris)| -|[Zabbix API](zabbix_api)|[msg4sunny](https://github.com/msg4sunny)| -|[Zip password cracker](zip_password_cracker)|[umar abdullahi](https://github.com/umarbrowser)| -|[Task Scheduler](Task-Scheduler)|[heysagnik](https://github.com/heysagnik)| -|[PDF Password Decypter](PDF_Password_Decrypter)|[parthasdey2304](https://github.com/parthasdey2304)| -|[Password Strength Checker](Password_Strength-checker)|[Parveshiiii](https://github.com/Parveshiiii)| -|[QR Code Generator](QR-code-generator)|[Parveshiiii](https://github.com/Parveshiiii)| - -## How to use: -- Clone/Download the directory and navigate to each folder. Or... -- Simply navigate to the folder and download/copy the scripts! It's *that* simple and easy. -- Setup virtual environment for that scripts: - - `python -m venv env` - - `source env\bin\activate` - - `pip install -r requirements.txt` - -- Run the script :) - -Remember to star the repo if you love the scripts~ :wink: - -## Contribution Guidelines: - -### Steps required to follow before adding any script -- Make a **separate folder** for your script. -- There shouldn't be any **spaces** between the names of the script. (Use underscore or dash Symbol) - - :x: Script One - - :heavy_check_mark: Script_One - - :heavy_check_mark: Script-One - -- The Folder should contain the followings - - - Main Python Script, - - Supporting files for the Script (If any) - - A separate `README.md` File with proper documentation. - - `requirements.txt` file for any required library. - - - How to create `requirements.txt` file - - `cd ` - - Activate your local virtual environment - - `source env\bin\activate` - - `pip freeze > requirements.txt` - -- Add your name & script in the [project's list](https://github.com/hastagAB/Awesome-Python-Scripts#what-do-we-have) above in the same format. [Compulsory] - -- Only One Commit per PR is Adviced. - -# If you like the project: -- **Star this Repo - [Awesome Python Scripts](https://github.com/hastagAB/Awesome-Python-Scripts)** - -- **Follow me on GitHub - [Ayush Bhardwaj](https://github.com/hastagAB)** - -## Want to Connect with Me? -[Linkedin](https://www.linkedin.com/in/hastagab/) -[X/Twitter](https://twitter.com/HastagAB) -[Facebook](https://www.facebook.com/SirHastagAB) -[Instagram](https://www.instagram.com/sirhastagab/) - - -[![](https://img.shields.io/badge/Made%20With%20❤️%20By-HastagAB-red)](https://github.com/hastagAB) diff --git a/SG-Financial-Monitor/LOGIC_GUIDE.md b/SG-Financial-Monitor/LOGIC_GUIDE.md new file mode 100644 index 0000000..f42f19f --- /dev/null +++ b/SG-Financial-Monitor/LOGIC_GUIDE.md @@ -0,0 +1,24 @@ +*This file teaches the user exactly how your "Analytical Brain" works.* +# 🔍 How the Analytical Brain Works +The SG Financial Monitor doesn't just "fetch" prices; it processes them through a mathematical pipeline to provide context. Here is the step-by-step logic. +### 1. The RSI Calculation (14-Period Hourly) +The bot uses the **Relative Strength Index (RSI)**, a momentum oscillator that measures the speed and change of price movements. +**The Process:** + * **Data Retrieval:** The bot pulls the last 100 hours of "Closing Prices" from the Binance API. + * **Calculating "Deltas":** It finds the difference between each hour's closing price and the one before it. + * **Gain/Loss Separation:** * If the price went up, that's a **Gain**. + * If the price went down, that's a **Loss**. + * **Rolling Average:** It calculates the average gain and average loss over the last **14 periods** (hours). + * **Relative Strength (RS):** + * **Final RSI Formula:** + +### 2. Strategic Intelligence Labeling +Once the RSI is calculated, the get_strategy_label function categorizes the asset: + * **RSI > 70:** Market is "Overbought." Buyers are exhausted; a pullback is statistically likely. + * **RSI < 30:** Market is "Oversold." Sellers are exhausted; a price "bounce" is expected. + * **30 - 70:** Market is "Stable." Momentum is neutral. +### 3. Range Position (Daily Context) +To understand if a price is at a "ceiling" or a "floor," the bot calculates the **Range Position**: + + * **> 85%:** The asset is testing **Resistance** (Top of the daily range). + * **< 15%:** The asset is testing **Support** (Bottom of the daily range). diff --git a/SG-Financial-Monitor/README.md b/SG-Financial-Monitor/README.md new file mode 100644 index 0000000..c578c0f --- /dev/null +++ b/SG-Financial-Monitor/README.md @@ -0,0 +1,41 @@ +![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54) +![Status](https://img.shields.io/badge/Status-Active%20Automation-success?style=for-the-badge) +![Focus](https://img.shields.io/badge/Focus-Financial%20Monitoring-blue?style=for-the-badge) + + + +# 🏛️ SG Financial Monitor (Python Edition) +**SG Financial Monitor** is a professional-grade Telegram bot written entirely in **Python**. It serves as a strategic intelligence terminal, fetching live market data and performing real-time technical analysis using industry-standard Python data libraries. +### 🐍 Python Technical Stack +This project leverages the power of Python to handle complex data streams and mathematical calculations: + * **pyTelegramBotAPI**: For high-speed, asynchronous communication with the Telegram Bot API. + * **Pandas**: The core "analytical brain" used to process price dataframes and calculate technical indicators. + * **Requests**: For robust API polling from global financial sources (Binance, CoinGecko, Yahoo Finance). +### 🧠 The Logic: How RSI is Calculated in Python +The bot calculates the **Relative Strength Index (RSI)** by processing the last 100 hours of market data through a custom Python function: + 1. **Data Acquisition**: It fetches a JSON payload of the last 100 hourly "Klines" (candlesticks). + 2. **Series Conversion**: Python’s pandas.Series converts raw strings into floating-point numbers for math operations. + 3. **Calculating Deltas**: Using closes.diff(), Python finds the price change between each hour. + 4. **Smoothing**: It applies a **14-period rolling mean** to separate "Gains" from "Losses." + 5. **The Formula**: + +### ⚙️ Installation Requirements +To run this bot, you must have **Python 3.10** or higher installed on your system (PC, Mac, or Termux). +**1. Install the required Python packages:** +```bash +pip install pyTelegramBotAPI pandas requests + +``` +**2. Configure the script:** +Open sgfinfree.py in your code editor and insert your API_TOKEN. +**3. Launch the terminal:** +```bash +python sgfinfree.py + +``` +### 📊 Strategic Indicators Provided + * **RSI (1h):** Identifies if an asset is Overbought (>70) or Oversold (<30). + * **24h Range Position:** A mathematical calculation showing where the current price sits relative to the day's High and Low. + * **Market Status:** Automated logic that translates raw Python data into "Bullish," "Bearish," or "Neutral" labels. +### ⚖️ Disclaimer +*This code is a tool for informational purposes. It is written in Python for speed and accuracy, but it does not constitute financial advice. Use the data as a reference for your own strategic analysis.* diff --git a/SG-Financial-Monitor/requirements.txt b/SG-Financial-Monitor/requirements.txt new file mode 100644 index 0000000..f589528 --- /dev/null +++ b/SG-Financial-Monitor/requirements.txt @@ -0,0 +1,249 @@ +aiohappyeyeballs==2.6.1 +aiohttp==3.13.5 +aiosignal==1.4.0 +aiosqlite==0.22.1 +altair==6.0.0 +annotated-doc==0.0.4 +annotated-types==0.7.0 +ansicon==1.89.0 +anthropic==0.86.0 +anyio==4.13.0 +apify_fingerprint_datapoints==0.12.0 +arrow==1.4.0 +async-timeout==5.0.1 +asyncpg==0.31.0 +attrs==26.1.0 +bce-python-sdk==0.9.70 +beautifulsoup4==4.14.3 +bidict==0.23.1 +binaryornot==0.6.0 +blessed==1.38.0 +blinker==1.9.0 +blis==1.3.3 +brotli==1.2.0 +browserforge==1.2.4 +cachetools==7.0.5 +catalogue==2.0.10 +certifi==2026.2.25 +cffi==2.0.0 +chardet==5.2.0 +charset-normalizer==3.4.6 +click==8.3.1 +cloudpathlib==0.23.0 +colorama==0.4.6 +colorlog==6.10.1 +confection==1.3.3 +cookiecutter==2.7.1 +crawlee==1.6.2 +crc32c==2.8 +cryptography==46.0.6 +cssselect==1.4.0 +curl_cffi==0.15.0 +cymem==2.0.13 +ddgs==9.12.0 +distro==1.9.0 +docstring_parser==0.17.0 +duckduckgo_search==8.1.1 +editor==1.7.0 +en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl#sha256=1932429db727d4bff3deed6b34cfc05df17794f4a52eeb26cf8928f7c1a0fb85 +et_xmlfile==2.0.0 +filelock==3.28.0 +frozenlist==1.8.0 +fsspec==2026.3.0 +future==1.0.0 +gitdb==4.0.12 +GitPython==3.1.46 +google-ai-generativelanguage==0.6.15 +google-api-core==2.30.0 +google-api-python-client==2.193.0 +google-auth==2.49.1 +google-auth-httplib2==0.3.0 +google-genai==1.69.0 +googleapis-common-protos==1.73.1 +greenlet==3.4.0 +grpcio==1.78.0 +grpcio-status==1.71.2 +h11==0.16.0 +h2==4.3.0 +hf-xet==1.4.3 +hiredis==3.3.1 +hpack==4.1.0 +html5lib==1.1 +httpcore==1.0.9 +httplib2==0.31.2 +httpx==0.28.1 +httpx-aiohttp==0.1.12 +httpx-sse==0.4.3 +hyperframe==6.1.0 +idna==3.11 +imagesize==2.0.0 +impit==0.12.0 +importlib_metadata==8.7.1 +inquirer==3.4.1 +jaro-winkler==2.0.3 +Jinja2==3.1.6 +jinxed==1.4.0 +jiter==0.13.0 +jmespath==1.1.0 +joblib==1.5.3 +json_repair==0.58.7 +jsonschema==4.26.0 +jsonschema-specifications==2025.9.1 +loguru==0.7.3 +lxml==6.0.2 +lxml_html_clean==0.4.4 +markdown-it-py==4.0.0 +MarkupSafe==3.0.3 +mdurl==0.1.2 +more-itertools==11.0.2 +mpmath==1.3.0 +msal==1.36.0 +msgpack==1.1.2 +multidict==6.7.1 +murmurhash==1.0.15 +narwhals==2.19.0 +networkx==3.6.1 +nltk==3.9.4 +numpy==2.4.4 +o365==2.1.9 +oauth-cli-kit==0.1.3 +openai==2.30.0 +opencv-contrib-python==4.10.0.84 +openpyxl==3.1.5 +opentelemetry-api==1.41.0 +opentelemetry-distro==0.62b0 +opentelemetry-exporter-otlp==1.41.0 +opentelemetry-exporter-otlp-proto-common==1.41.0 +opentelemetry-exporter-otlp-proto-grpc==1.41.0 +opentelemetry-exporter-otlp-proto-http==1.41.0 +opentelemetry-instrumentation==0.62b0 +opentelemetry-instrumentation-httpx==0.62b0 +opentelemetry-proto==1.41.0 +opentelemetry-sdk==1.41.0 +opentelemetry-semantic-conventions==0.62b0 +opentelemetry-util-http==0.62b0 +opt-einsum==3.3.0 +packaging==26.0 +pandas==3.0.2 +parsel==1.11.0 +pdf2image==1.17.0 +pdfminer.six==20251230 +pdfplumber==0.11.9 +pillow==12.1.1 +platformdirs==4.9.4 +playwright==1.58.0 +preshed==3.0.13 +prettytable==3.17.0 +primp==1.2.0 +prompt_toolkit==3.0.52 +propcache==0.4.1 +Protego==0.6.0 +proto-plus==1.27.2 +protobuf==5.29.6 +psutil==7.2.2 +py-cpuinfo==9.0.0 +pyarrow==23.0.1 +pyasn1==0.6.3 +pyasn1_modules==0.4.2 +pyclipper==1.4.0 +pycparser==3.0 +pycryptodome==3.23.0 +pydantic==2.12.5 +pydantic-settings==2.13.1 +pydantic_core==2.41.5 +pydeck==0.9.1 +pyee==13.0.1 +Pygments==2.19.2 +PyJWT==2.12.1 +PyMuPDF==1.27.2.2 +pyparsing==3.3.2 +pypdfium2==5.6.0 +pytesseract==0.3.13 +python-bidi==0.6.7 +python-dateutil==2.9.0.post0 +python-dotenv==1.2.2 +python-engineio==4.13.1 +python-multipart==0.0.22 +python-slugify==8.0.4 +python-socks==2.8.1 +python-telegram-bot==22.7 +pywin32==311 +PyYAML==6.0.2 +questionary==2.1.1 +RapidFuzz==3.14.3 +readchar==4.2.2 +redis==7.4.0 +referencing==0.37.0 +regex==2026.2.28 +requests==2.33.0 +requests-file==3.0.1 +requests-toolbelt==1.0.0 +rich==14.3.3 +rpds-py==0.30.0 +ruamel.yaml==0.19.1 +runs==1.3.0 +safetensors==0.7.0 +scikit-learn==1.8.0 +scipy==1.17.1 +setuptools==82.0.1 +shapely==2.1.2 +shellingham==1.5.4 +simple-websocket==1.1.0 +six==1.17.0 +slack_sdk==3.41.0 +slackify_markdown==0.2.2 +smart_open==7.5.1 +smmap==5.0.3 +sniffio==1.3.1 +-e git+https://github.com/society-ai/society-ai-sdk.git@686fba7160349d799c87171cbefbddd64f4ea58b#egg=society_ai_sdk +societyai==0.1.3 +socksio==1.0.0 +soupsieve==2.8.3 +spacy==3.8.14 +spacy-legacy==3.0.12 +spacy-loggers==1.0.5 +SQLAlchemy==2.0.49 +srsly==2.5.3 +sse-starlette==3.3.3 +starlette==1.0.0 +streamlit==1.56.0 +sympy==1.14.0 +tavily-python==0.7.23 +tenacity==9.1.4 +text-unidecode==1.3 +textblob==0.20.0 +thinc==8.3.13 +threadpoolctl==3.6.0 +tifffile==2026.3.3 +tiktoken==0.12.0 +tldextract==5.3.1 +toml==0.10.2 +torchvision==0.26.0 +tornado==6.5.5 +tqdm==4.67.3 +typer==0.24.1 +typing-inspection==0.4.2 +typing_extensions==4.15.0 +tzdata==2025.3 +tzlocal==5.3.1 +ujson==5.12.0 +uritemplate==4.2.0 +urllib3==2.6.3 +uvicorn==0.42.0 +w3lib==2.4.1 +wasabi==1.1.3 +watchdog==6.0.0 +wcwidth==0.6.0 +weasel==1.0.0 +webencodings==0.5.1 +websocket-client==1.9.0 +websockets==13.1 +wheel==0.46.3 +win32_setctime==1.2.0 +wrapt==2.1.2 +wsproto==1.3.2 +xlsxwriter==3.2.9 +xmod==1.9.0 +yarl==1.23.0 +zipp==3.23.1 +zstandard==0.25.0 diff --git a/SG-Financial-Monitor/sgfinfree.py b/SG-Financial-Monitor/sgfinfree.py new file mode 100644 index 0000000..cdc8324 --- /dev/null +++ b/SG-Financial-Monitor/sgfinfree.py @@ -0,0 +1,135 @@ +import telebot +import requests +import pandas as pd + +# --- CONFIGURATION --- +# Replace with your token from @BotFather +API_TOKEN='Write your API Token here' +bot = telebot.TeleBot(API_TOKEN) + +# --- ANALYTICAL BRAIN --- + +def calculate_rsi(symbol): + """Calculates RSI using the last 100 hours of Binance data.""" + try: + url = f"https://api.binance.com/api/v3/klines?symbol={symbol}USDT&interval=1h&limit=100" + data = requests.get(url, timeout=5).json() + closes = pd.Series([float(x[4]) for x in data]) + delta = closes.diff() + gain = (delta.where(delta > 0, 0)).rolling(window=14).mean() + loss = (-delta.where(delta < 0, 0)).rolling(window=14).mean() + rs = gain / loss + rsi = 100 - (100 / (1 + rs)) + return f"{rsi.iloc[-1]:.2f}" + except: return "N/A" + +def get_strategy_label(rsi, range_pos): + """Translates raw numbers into strategic advice.""" + analysis = "" + if rsi != "N/A": + val = float(rsi) + if val > 70: analysis += "⚠️ *OVERBOUGHT:* Market is overheated. Correction likely.\n" + elif val < 30: analysis += "✅ *OVERSOLD:* High value zone. Potential bounce.\n" + else: analysis += "⚖️ *STABLE:* Momentum is currently neutral.\n" + + if range_pos > 85: analysis += "🚀 *RESISTANCE:* Testing the daily ceiling.\n" + elif range_pos < 15: analysis += "🛡️ *SUPPORT:* Testing the daily floor.\n" + + return analysis if analysis else "📊 *SIDEWAYS:* Market is consolidating." + +# --- COMMAND HANDLERS --- + +@bot.message_handler(commands=['start', 'help']) +def send_welcome(message): + # This creates the 'Grey Text' placeholder in the message box + markup = telebot.types.ReplyKeyboardMarkup( + resize_keyboard=True, + input_field_placeholder="Type /p [ticker] here..." + ) + + welcome_text = ( + "🏦 *Welcome to SG Financial Monitor*\n" + "──────────────────\n" + "Strategic Intelligence Terminal for active market monitoring.\n\n" + "🛠 *How to use:*\n" + "Simply type `/p` followed by any asset name or ticker.\n\n" + "🔹 *Crypto:* `/p xrp` | `/p cardano` | `/p bitcoin`\n" + "🔹 *Stocks:* `/p tsla` | `/p nvda` | `/p apple`\n\n" + "📊 *Indicators Included:*\n" + "• Real-time Price & 24h Change\n" + "• RSI (1h) Momentum Analysis\n" + "• Global Market Ranking (Crypto)\n" + "• 52-Week Range Context (Stocks)\n" + "──────────────────\n" + "⚠️ *DISCLAIMER:* This is an automated monitoring tool. Content does NOT constitute financial advice. Trade at your own risk." + ) + bot.send_message(message.chat.id, welcome_text, parse_mode="Markdown", reply_markup=markup) + +@bot.message_handler(commands=['p']) +def handle_price(message): + query = message.text.replace('/p ', '').strip() + if not query or query == "/p": + bot.reply_to(message, "Please enter an asset. Example: `/p xrp`") + return + + bot.send_chat_action(message.chat.id, 'typing') + + # 1. ATTEMPT CRYPTO (Binance + CoinGecko) + try: + # Search for ID (allows searching by name like 'Ripple') + s_res = requests.get(f"https://api.coingecko.com/api/v3/search?query={query}", timeout=5).json() + if s_res['coins']: + c = s_res['coins'][0] + m_res = requests.get(f"https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids={c['id']}", timeout=5).json() + if m_res: + m = m_res[0] + rsi = calculate_rsi(c['symbol'].upper()) + # Calculate Daily Range Position + r_pos = ((m['current_price'] - m['low_24h']) / (m['high_24h'] - m['low_24h'])) * 100 if (m['high_24h'] - m['low_24h']) != 0 else 50 + strategy = get_strategy_label(rsi, r_pos) + + resp = ( + f"🏦 *SG Financial Monitor*\n" + f"──────────────────\n" + f"🪙 *Asset:* {m['name']} ({c['symbol'].upper()})\n" + f"💰 *Price:* ${m['current_price']:,.4f} ({m['price_change_percentage_24h']:.2f}%)\n" + f"🏆 *Rank:* #{m['market_cap_rank']} | *RSI:* {rsi}\n" + f"📊 *Range Pos:* {r_pos:.1f}%\n" + f"──────────────────\n" + f"🧠 *STRATEGIC ANALYSIS:*\n{strategy}\n" + f"──────────────────\n" + f"📍 *Source:* CoinGecko + Binance Intelligence\n" + f"\n ⚖️ Not financial advice. Informational only.\n📢 Share the Alpha: Forward this briefing." + ) + bot.reply_to(message, resp, parse_mode="Markdown") + return + except Exception as e: pass + + # 2. ATTEMPT STOCKS (Yahoo Finance) + try: + y_url = f"https://query1.finance.yahoo.com/v8/finance/chart/{query.upper()}" + res = requests.get(y_url, headers={'User-Agent': 'Mozilla/5.0'}, timeout=5).json() + meta = res['chart']['result'][0]['meta'] + price = meta['regularMarketPrice'] + change = ((price - meta['previousClose']) / meta['previousClose']) * 100 + + resp = ( + f"🏛️ *SG Financial Monitor*\n" + f"──────────────────\n" + f"📈 *Stock:* {query.upper()}\n" + f"💵 *Price:* ${price:,.2f} ({change:+.2f}%)\n" + f"🗓️ *Prev Close:* ${meta['previousClose']:,.2f}\n" + f"──────────────────\n" + f"🧠 *MARKET STATUS:* {'📈 Bullish' if change > 0 else '📉 Bearish'}\n" + f"──────────────────\n" + f"📍 *Source:* Yahoo Finance Intelligence\n" + f"\n⚖️ Not financial advice. Informational only.\n📢 Share the Alpha: Forward this briefing." + ) + bot.reply_to(message, resp, parse_mode="Markdown") + except: + bot.reply_to(message, "❌ *Asset Not Found.* Please check the ticker and try again.") + +# --- START POLLING --- +print("--- SG Financial Monitor is LIVE ---") +bot.polling(none_stop=True) +