while25
Write your own trading strategies, chart indicators and dashboards in plain Python, and run them inside the While25 trading platform.
Documentation · Examples · Download While25 · Discord
What you can build
| What it is | Read more | |
|---|---|---|
| Strategy | Code that places orders when your rules say so | Your first module |
| Indicator | A line, histogram or zone drawn on the chart | Indicators |
| Monitor | Code that watches the market and alerts you | Monitors |
| App | A panel of your own in the platform | Panels |
| Backtest | Any logic, any model, any mix of instruments and timeframes | Backtests |
You write a Python class. While25 feeds it prices, sends its orders to your broker, and draws what it produces.
Install
pip install while25
Python 3.11 or newer, no dependencies, fully typed. You can write and test your code on any computer; to run it against live markets, use While25 Desktop.
A strategy in 10 lines
import while25
from while25 import Strategy, on
class BuyTheDip(Strategy):
id = "buy_the_dip"
label = "Buy the dip"
@on.bar("EQ:US:AAPL", "1D") # runs once a day, when the bar closes
def on_day(self, ctx, bar):
if bar["close"] < bar["open"] * 0.97: # fell 3% today
while25.buy("EQ:US:AAPL", 10)
Open the Code Editor in While25, paste it, and press Run. The platform shows the strategy as armed and lists every order it sends.
Documentation
The full guide is at while25.com/docs: a page per topic, search, and every example explained.
- What wakes a module: every tick, each closed bar, on a timer, on news
- Market data: history, live prices, news, index members
- Orders: market, limit, stop, bracket and trailing orders
- Options, combos and futures
- Backtests, and backtesting without peeking ahead
- Testing your code with pytest, without the platform
Using an AI assistant? Point it at llms.txt, or llms-full.txt for the whole guide in one file.
The guide's Markdown sources are in docs/, and the examples' code in examples/.
Contributing
Bug reports and ideas are welcome in Issues. Run the tests with:
pip install -r requirements-dev.txt
pytest
License
Metadata
Release files for while25 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| while25-0.1.2.tar.gz | 451.9 kB | Without provenance | Details for while25-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| while25-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for while25-0.1.2-py3-none-any.whl |
Total release size: 880.0 kB
Release files / while25-0.1.2.tar.gz
| Download URL | while25-0.1.2.tar.gz |
|---|---|
| Size | 451.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d095ac962d4550b590dfdf8f3ac9b9083a0a3a797b15eff6b2402391389cb4f
|
|
BLAKE2b-256 checksum How to use checksums |
e193889b74f8aab973af9ca239c9b97a95ce7f7faf23f00a39c3eb61d87ba0f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0
|
Release files / while25-0.1.2-py3-none-any.whl
| Download URL | while25-0.1.2-py3-none-any.whl |
|---|---|
| Size | 428.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf0708f216f527521ac36e38a3e58f359158c96fa9eff2ecb5493fedc22ba758
|
|
BLAKE2b-256 checksum How to use checksums |
ea939d37a755e9ac59d682b0572ee40d7504fd67301a4b8195bf3af56f9008af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.0
|
Security for while25 0.1.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.