Skip to main content

A user-friendly project to filter symbols of Tehran Stock Exchange

Project description

pytse-filter: Tehran Stock Exchange Data Processing Library

Welcome to the pytse-filter library, a Python package designed for processing and analyzing Tehran Stock Exchange (TSE) symbol data through user-defined text filters. This library simplifies the task of filtering TSE data based on various conditions, making it an essential tool for traders and analysts.

Prerequisites

Before you begin, ensure you have the following:

  • Python 3.x installed on your system.
  • Required packages: pandas, pandas_ta, requests, and tqdm installed via pip.

Installation

Install pytse-filter easily using pip:

pip install pytse_filter

Or, for the latest version from the repository:

pip install git+https://github.com/farhad-mohammadi/pytse-filter.git

Alternatively, clone and install from the source:

git clone https://github.com/farhad-mohammadi/pytse-filter
cd pytse_filter
pip install .

Dependencies will be automatically resolved and installed.

Usage

pytse-filter is divided into two main components: Realtime and History. These cater to users ranging from beginners to professionals, providing tools for both real-time data processing and historical data analysis.

Realtime Filtering

For real-time data filtering, import the RealTime class and use it as follows:

from pytse_filter import RealTime

# Define your conditions
conditions = 'pl < py and power_of_demand > 1'

# Filter data based on conditions
df = RealTime().filter_by_text_condition(conditions)
print(df)

# Save results to Excel (optional)
df.to_excel('myfilter.xlsx')

Advanced Realtime Monitoring

Advanced users can continuously monitor symbol status changes:

from pytse_filter import RealTime
from time import sleep
import sys

# Initialize market data
market = RealTime()

# Fetch and monitor sell queue symbols
sell_queue_symbols = market.filter_by_text_condition('pl == tmin')
# ... rest of the advanced monitoring code ...

Historical Data Analysis

The History class allows for in-depth historical stock data analysis:

from pytse_filter import History

# Download and update data with the latest market information
History().download_summary()

# Apply filters based on technical indicators and patterns
conditions = 'rsi14 < 30 and macd > 0'
df = History().filter_by_text_condition(conditions)
print(df)

# Save filtered data (optional)
df.to_excel('filtered_symbols.xlsx')

Comprehensive Analysis

Combine realtime and historical data for a complete analysis setup:

from pytse_filter import History, RealTime
# ... code to combine and analyze data ...

Writing Conditions

Define criteria for filtering stock data using a simple text string format. Utilize variables from RealTimeVariables.xlsx and HistoryVariable.xlsx, and employ comparison and logical operators to create complex conditions.

License

pytse-filter is MIT licensed. See the LICENSE file for more details.

For the full user guide, examples, and advanced usage instructions, please refer to the user_guide.md included with this package, or visit the GitHub repository.

Happy trading! 📈💹

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytse_filter-1.45.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytse_filter-1.45-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file pytse_filter-1.45.tar.gz.

File metadata

  • Download URL: pytse_filter-1.45.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.0

File hashes

Hashes for pytse_filter-1.45.tar.gz
Algorithm Hash digest
SHA256 21c3c237f149452cbfc0198ed5d67649437ee40c8d741c86f2fb46781ba8e6cb
MD5 212447de47d416e14a431546b21601bf
BLAKE2b-256 de8d10385c0f2a4e84f32e8c1728679a36cb71e6dcdec46698d6d77cf9ad7739

See more details on using hashes here.

File details

Details for the file pytse_filter-1.45-py3-none-any.whl.

File metadata

  • Download URL: pytse_filter-1.45-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.0

File hashes

Hashes for pytse_filter-1.45-py3-none-any.whl
Algorithm Hash digest
SHA256 b4c80aa708f6badd4baf3d93067c853a2badb0f893af47395ca20fda4847b044
MD5 f70ae025b76429502788bf6922d4ffd2
BLAKE2b-256 c1229db4e6c5e5d3b649746defae2a885d2fa86e34252ee186409d2ae93aceb7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page