Skip to main content

This is a basic trading strategy backtesting library. It can be used to backtest option strategies.

Three files are needed to backtest the option strategies. One file with the futures data. Another file with the call option data. Third file with the put option data.

Ensure the below format for the files and the files should be of the csv format.

Futures file : Order of Columns : yyyy-mm-dd, date, month, year, expiry_date(of the format dd-(first three characters of month)-yy example : 26-May-22), open, high, low, close Call Option File : Order of Columns : datetime year month Date expiry_date Time strike_price open high low close (example : 2022-01-03 9:15:00 2022 1 3 27-Jan-22 9:15:00 15500 1961.55 2010 1961.55 2004.45) Put Option File : Order of Columns : datetime year month date expiry_date time strike_price open high low close (example : 2022-04-01 9:15:00 2022 4 1 28-Apr-22 9:15:00 15500 25.1 25.55 19.95 20.1)

Argument list for ironCondorStrategy : self, putFile, callFile, spotFile, sellPut, sellCall, buyCall, buyPut, entry, exit, lotSize

example of code

from AlgoAshutosh import *

object = ironCondor() object.ironCondorStrategy(“/Users/username/Desktop/putOptionsFile.csv”,”/Users/username/Desktop/callOptionsFile.csv”,”/Users/username/Desktop/futuresFile.csv”,100,100,200,200,1,10,50) This means if spot price is 15000 then call sold at strike price 15000+100, call bought at 15000+200, put sold at strike price 15000-100, put bought at 15000-200, would be backtested. The entry would be at the first day of the month and exit at expiry date - 10 days before. So for example to exit position at expiry date pass that argument as 0. 50 represents the lot size.

Argument list for shortStraddleStrategy : self, putFile, callFile, spotFile, entry, exit, lotSize

Argument list for shortStrangleStrategy : self, putFile, callFile, spotFile, sellPut, sellCall, entry,exit, lotSize

CHANGELOG

0.0.1 (09/07/2022)

-First Release

Metadata

Release files for AlgoAshutosh 0.0.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 AlgoAshutosh 0.0.1
File Size Uploaded Provenance Actions
AlgoAshutosh-0.0.1.tar.gz 4.4 kB Without provenance Details for AlgoAshutosh-0.0.1.tar.gz

Release files / AlgoAshutosh-0.0.1.tar.gz

Download URL AlgoAshutosh-0.0.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c1acb41569fcffef88e0f2cbd74865d6f4b1bb3fdf6fd1604e37060e296c06f2
BLAKE2b-256 checksum
How to use checksums
d877b36c1c631d40ed78827fe8f166c0c5da3bfd270a3db163506e34f7fc18c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Security for AlgoAshutosh 0.0.1

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

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