A pinescript-like financial data analysis and trading package
Project description
pinetwig 0.2.2
PineTwig is a pinescript-like financial data analysis and trading package.
Requirements
- Python 3.7 or above on Windows, Linux or macOS
Installation
pip install pinetwig
Examples
Create main.py
file with one of the following examples:
Scraping data from Binance.
import pinetwig as pt
df = pt.getDataFromBinance(ticker="BTCUSDT", interval="1h", start="2 day ago UTC", end="now")
print(df)
Scraping data from TradingView.
import pinetwig as pt
df = pt.getDataFromTradingView(ticker="NASDAQ:AAPL", interval="5m", length=5000)
print(df)
List available indicators and functions.
import pinetwig as pt
print("Indicators:", pt.all_indicators)
print("Functions:", pt.all_functions)
Generating a ray and visualizing.
import pinetwig as pt
x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
y = [-1, 1, -1, 1, -1, 1, -1, 1, -1, 1]
ray = pt.ray(x, (0, 0), (2, 1))
pt.visualize(lines={"Values": {"x": x, "y": y}, "Ray": {"x": x, "y": ray}})
Visualizing a financial dataframe.
import pinetwig as pt
df = pt.getDataFromBinance(ticker="BTCUSDT", interval="1h", start="2 day ago UTC", end="now")
df["SMA12"] = pt.sma(df["Close"], 12)
df["Linear Reg."] = pt.linreg(list(range(len(df))), df["Close"].tolist())
chart = pt.FancyChart(df, theme="light")
chart.show()
Learn more
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
pinetwig-0.2.2.tar.gz
(10.1 kB
view details)
File details
Details for the file pinetwig-0.2.2.tar.gz
.
File metadata
- Download URL: pinetwig-0.2.2.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f03d17be76ff71cdb28db4b1d4f36e1100335d9e90c178552120304c6f2429eb |
|
MD5 | 6d3a9d0edd8a85ecc181441755870c3c |
|
BLAKE2b-256 | 1ce91e23ea51518631122f3bc83d2cb87d5053ec79677e700812454cccaf0e44 |