Skip to main content
PyneCore Logo

PyneCore™

Pine Script in Python - Without Limitations

Python License

🚀 Have Pine Script code? Get automatic Python translation →

What is PyneCore?

PyneCore brings TradingView's Pine Script capabilities to Python through a revolutionary approach - it transforms regular Python code to behave like Pine Script through AST transformations, while maintaining the full power of the Python ecosystem.

Instead of creating another object-oriented wrapper or a new language, PyneCore modifies your Python code at import time, giving you the intuitive bar-by-bar execution model of Pine Script without leaving Python's rich environment.

Key Features

  • Native Pine Script Semantics in Python: Write familiar Python code that runs with Pine Script's bar-by-bar execution model
  • AST Transformation Magic: Your code is transformed at import time to implement Pine Script behavior
  • High Performance: Zero mandatory external dependencies with highly optimized implementation
  • Series & Persistent Variables: Full support for Pine Script's time series and state persistence
  • Function Isolation: Each function call gets its own isolated persistent state
  • NA Handling: Graceful handling of missing data with Pine Script's NA system
  • Technical Analysis Library: Comprehensive set of Pine Script-compatible indicators and functions
  • Strategy Backtesting: Pine Script compatible framework for developing and testing trading strategies

Quick Example

"""
@pyne
"""
from pynecore import Series
from pynecore.lib import script, close, ta, plot, color, input

@script.indicator(title="Bollinger Bands")
def main(
    length=input.int("Length", 20, minval=1),
    mult=input.float("Multiplier", 2.0, minval=0.1, step=0.1),
    src=input.source("Source", close)
):
    # Calculate Bollinger Bands
    basis = ta.sma(src, length)
    dev = mult * ta.stdev(src, length)

    upper = basis + dev
    lower = basis - dev

    # Output to chart
    plot(basis, "Basis", color=color.orange)
    plot(upper, "Upper", color=color.blue)
    plot(lower, "Lower", color=color.blue)

Innovative Concepts

PyneCore introduces several revolutionary concepts:

1. Magic Comment & Import Hook

Identify your scripts with a simple magic comment:

"""
@pyne
"""

This activates PyneCore's import hook system which intercepts Python imports and applies AST transformations to recognized scripts.

2. Series Variables

Track historical data across bars, just like in Pine Script:

from pynecore import Series

price: Series[float] = close
previous_price = price[1]  # Access previous bar's price

3. Persistent Variables

Maintain state between bars with simple type annotations:

from pynecore import Persistent

counter: Persistent[int] = 0
counter += 1  # Increments with each bar

4. Function Isolation

Each call to a function maintains its own isolated state:

def my_indicator(src, length):
    # Each call gets its own instance of sum
    sum: Persistent[float] = 0
    sum += src
    return sum / length

Installation

# Basic installation
pip install pynesys-pynecore

# With CLI tools (recommended)
pip install pynesys-pynecore[cli]

# With all features including data providers
pip install pynesys-pynecore[all]

Note for Windows users: PyneCore requires timezone data that is not included in Windows by default. The [cli] and [all] installations automatically include the tzdata package. If you're using the basic installation and encounter timezone errors, install it manually with pip install tzdata.

Getting Started

Create a Simple Script

  1. Create a file with the @pyne annotation:
"""
@pyne
"""
from pynecore.lib import script, close, plot

@script.indicator("My First Indicator")
def main():
    # Calculate a simple moving average
    sma_value = (close + close[1] + close[2]) / 3

    # Plot the result
    plot(sma_value, "Simple Moving Average")
  1. Run your script with the PyneCore CLI:
# First, download some price data
pyne data download ccxt --symbol "BYBIT:BTC/USDT:USDT"

# Then run your script on the data
pyne run my_script.py ccxt_BYBIT_BTC_USDT_USDT_1D.ohlcv

Working with Pine Script Files

PyneCore also supports running Pine Script files directly with automatic compilation:

# Run a Pine Script file directly (requires PyneSys API key)
pyne run my_indicator.pine ccxt_BYBIT_BTC_USDT_USDT_1D.ohlcv --api-key YOUR_API_KEY

# Or compile Pine Script to Python first
pyne compile my_indicator.pine --api-key YOUR_API_KEY

# Then run the compiled Python file
pyne run my_indicator.py ccxt_BYBIT_BTC_USDT_USDT_1D.ohlcv

Note: Pine Script compilation requires a PyneSys API key. Get yours at pynesys.io.

Why Choose PyneCore?

  • Beyond TradingView Limitations: No more platform restrictions, code size limits, or subscription fees
  • Python Ecosystem Access: Use Python's data science, ML, and analysis libraries alongside trading logic
  • Performance & Precision: Designed for speed and precision, the same results as Pine Script
  • Open Source Foundation: The core library and runtime is open source under Apache 2.0 license
  • Professional Trading Tools: Build institutional-grade systems with Pine Script simplicity
  • Advanced Backtesting: Run sophisticated strategy tests outside platform constraints

Pine Script Migration Made Easy

Have existing Pine Script code you want to run in Python? PyneSys now offers automatic Pine Script to PyneCore translation through our web platform and Discord bot.

🚀 Get Started Instantly

  • Try for free on Discord: Use /pine-help in our Discord for instant conversion - 3 free translations!
  • Full service: Visit pynesys.io for subscriptions and higher limits

💡 Support the Ecosystem

Love PyneCore and want to see it grow? Consider a Seed subscription or higher ($5+/mo) to support continued development:

  • Daily translations of your Pine Script files (5+ per day)
  • Larger script support for complex indicators and strategies
  • Direct contribution to keeping PyneCore open source and advancing

Every subscription helps maintain this free, open-source runtime and drives innovation in algorithmic trading tools.

Documentation & Support

Community

License

PyneCore is licensed under the Apache License 2.0.

Disclaimer

Pine Script™ is a trademark of TradingView, Inc. PyneCore is not affiliated with, endorsed by, or sponsored by TradingView. This project is an independent implementation that aims to provide compatibility with the Pine Script language concept in the Python ecosystem.

Risk Warning

Trading involves significant risk of loss and is not suitable for all investors. The use of PyneCore does not guarantee any specific results. Past performance is not indicative of future results.

  • PyneCore is provided "as is" without any warranty of any kind
  • PyneCore is not a trading advisor and does not provide trading advice
  • Scripts created with PyneCore should be thoroughly tested before using with real funds
  • Users are responsible for their own trading decisions
  • You should consult with a licensed financial advisor before making any financial decisions

By using PyneCore, you acknowledge that you are using the software at your own risk. The creators and contributors of PyneCore shall not be held liable for any financial loss or damage resulting from the use of this software.

Commercial Support

PyneCore is part of the PyneSys ecosystem. For commercial support, custom development, or enterprise solutions:


Elevate Your Trading with the Power of Python & Pine Script

Metadata

Release files for pynesys-pynecore 6.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynesys-pynecore 6.10.1
File Size Uploaded
pynesys_pynecore-6.10.1.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pynesys-pynecore 6.10.1
File Interpreter ABI Platform
pynesys_pynecore-6.10.1-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / pynesys_pynecore-6.10.1.tar.gz

Download URL pynesys_pynecore-6.10.1.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
44a3bcce882b765a087b002b57b316d7e3740bd6835b66e68e3dd31c80f2b739
BLAKE2b-256 checksum
How to use checksums
07b5ce79c322f427777eb97f01f59a945d64f24c18405a0c799fd39d4da93475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / pynesys_pynecore-6.10.1-py3-none-any.whl

Download URL pynesys_pynecore-6.10.1-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
201a5243d96481ed180bfcd1d9d0f27305ea6cf8ec30696427fecf71c704b76e
BLAKE2b-256 checksum
How to use checksums
024081f10c7c281d566ef9db283c396f8654cb311f026e32a9153a5248843aa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release history Release notifications | RSS feed

6.10.2

2 release files

This release

6.10.1 This release

2 release files

6.10.0

2 release files

6.9.4

2 release files

6.9.3

2 release files

6.9.2

2 release files

6.9.1

2 release files

6.9.0

2 release files

6.8.14

2 release files

6.8.13

2 release files

6.8.12

2 release files

6.8.11

2 release files

6.8.10

2 release files

6.8.9

2 release files

6.8.8

2 release files

6.8.7

2 release files

6.8.6

2 release files

6.8.5

2 release files

6.8.4

2 release files

6.8.3

2 release files

6.8.2

2 release files

6.8.1

2 release files

6.8.0

2 release files

6.7.0

2 release files

6.6.2

2 release files

6.6.1

2 release files

6.6.0

2 release files

6.5.7

2 release files

6.5.6

2 release files

6.5.5

2 release files

6.5.4

2 release files

6.5.3

2 release files

6.5.2

2 release files

6.5.1

2 release files

6.5.0

2 release files

6.4.9

2 release files

6.4.8

2 release files

6.4.7

2 release files

6.4.6

2 release files

6.4.5

2 release files

6.4.4

2 release files

6.4.3

2 release files

6.4.2

2 release files

6.4.1

2 release files

6.4.0

2 release files

6.3.9

2 release files

6.3.8

2 release files

6.3.7

2 release files

6.3.6

2 release files

6.3.5

2 release files

6.3.4

2 release files

6.3.3

2 release files

6.3.2

2 release files

6.3.1

2 release files

6.3.0

2 release files

6.2.1

2 release files

6.1.2

2 release files

6.1.1

2 release files

6.1.0

2 release files

6.0.17

2 release files

6.0.16

2 release files

6.0.12

2 release files

6.0.11

2 release files

6.0.10

2 release files

6.0.9

2 release files

6.0.8

2 release files

6.0.7

2 release files

6.0.6

2 release files

6.0.5

2 release files

6.0.4

2 release files

6.0.3

2 release files

6.0.2

2 release files

6.0.1

2 release files

6.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page