A collection of investment tools used by the Turtle Traders.
Project description
turtle-trading
A Python Package containing a collection of investing tools using the Turtle Traders Original Rules. All code is based on the ideas in The Original Turtle Trading Rules.
Download using pip:
pip install turtle-trading
position_sizing
module
""" using the position_sizing module """
from turtle_trading.position_sizing import getn, getunit
import datetime
date = datetime.date(2023, 11, 10)
getn(ticker='aapl') # >>> 2.5725
getn(ticker='aapl', date=date) # >>> 2.9932
getunit(ticker='aapl', account=1000000, n=1.2) # >>> 44.8898
getunit(ticker='aapl', account=1000000, date=date) # >>> 17.9233
entries
module
""" using the entries module """
from turtle_trading.entries import getsignal, addunits
getsignal(ticker='aapl', system=1) # >>> True
getsignal(ticker='aapl', system=2) # >>> True
addunits(breakout=310, n=2.50) # >>> [310, 311.25, 312.5, 313.75]
addunits(breakouts=310, n=2.50, units=6) # >>> [310, 311.25, 312.5, 313.75, 315.0, 316.25]
More will be published soon.
For issues, look here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
turtle_trading-2.7.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for turtle_trading-2.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a15dd8e251abf6eca1076a3954acd0a348ed526bc8bf4094bf84c45a0b278e0a |
|
MD5 | 9d889985785c90cfae05d18fdacd3357 |
|
BLAKE2b-256 | a08712674cae160de5a3fb56718f9fecd18344d2ba016e25cf09de1c5ab1cf19 |