# LIVE python_strategies
## Steps to install Strategy Library for LIVE
```python
pip install breeze_strategies==1.0.22
```
## Updating Library
```python
pip install --upgrade breeze_strategies
```
## code usage
```python
#Import the library
from breeze_strategies import Strategies
#Configure the strategy using API Keys and set maxprofit/takeprofit level.
#Type 1
obj = Strategies(app_key = "your app key",
secret_key = "your secret key",
api_session = "your api session",
max_profit = "your max profit",
max_loss = "your max loss")
#Execute the strategy
obj.straddle(strategy_type = "long",
stock_code = "NIFTY",
strike_price = "18700",
quantity = "50",
expiry_date = "2023-06-29T06:00:00.000Z")
#Execute the strangle strategy
obj.strangle(strike_price_call = "18700",strike_price_put = "18300", strategy_type = "long",stock_code = "NIFTY", quantity = "50", expiry_date = "2023-06-29T06:00:00.000Z")
#Execute Single Leg
obj.single_leg(right = "Call", strategy_type = "short",stock_code = "NIFTY", strike_price = "18700", quantity = "50", expiry_date = "2023-06-29T06:00:00.000Z")
#Execute the Four leg strategy
#Nifty
obj.four_leg(stock_code="NIFTY",
quantity="25",
expiry_date="2024-08-14T06:00:00.000Z",
call_short_strike="24900",
put_short_strike="23000",
call_long_strike="24850",
put_long_strike="23050"
)
#BankNifty
obj.four_leg(stock_code="CNXBAN",
quantity="15",
expiry_date="2024-08-14T06:00:00.000Z",
call_short_strike="52600",
put_short_strike="47600",
call_long_strike="52700",
put_long_strike="47900"
)
#SquareOff existing positions and exit the strategy of straddle
obj.stop()
#SquareOff existing positions and exit the strategy of strangle
obj.stop_strategy(is_strangle = True)
#SquareOff existing positions and exit the strategy In case of single_leg pass single_leg flag as True as mentioned below
obj.stop_strategy(single_leg = True)
#SquareOff existing positions and exit the strategy of Four Leg
obj.stop_strategy(is_FourLeg = True)
#Generate Profit & Loss report (this method will work for both straddle and strangle)
obj.get_pnl()
```
### Note:
### (i) If the maximum loss or maximum profit is not reached by the end of the day, the order will be carried over to the next day, and the maximum profit and maximum loss will no longer be monitored.
### (ii) Ensure that the maximum profit is a positive value and the maximum loss is a negative value.
### (iii) Verify that all parameters are entered correctly.
### (iv) Kindly monitor the position on the website.
### (v) Ensure a stable internet connection at all times.
Raw data
{
"_id": null,
"home_page": "https://github.com/Idirect-Tech/python_strategies/tree/master",
"name": "breeze-strategies",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "ICICI Direct Breeze",
"author_email": "breezeapi@icicisecurities.com",
"download_url": "https://files.pythonhosted.org/packages/c9/33/14542e897b644e7e806e9545afbe423c104dbbed0de991c69c9227e42c32/breeze_strategies-1.0.23.tar.gz",
"platform": null,
"description": "# LIVE python_strategies\r\n\r\n## Steps to install Strategy Library for LIVE\r\n\r\n\r\n```python\r\n\r\npip install breeze_strategies==1.0.22\r\n\r\n```\r\n\r\n## Updating Library\r\n\r\n```python\r\n\r\npip install --upgrade breeze_strategies\r\n\r\n```\r\n\r\n## code usage\r\n\r\n```python\r\n\r\n#Import the library\r\nfrom breeze_strategies import Strategies\r\n\r\n#Configure the strategy using API Keys and set maxprofit/takeprofit level.\r\n\r\n#Type 1\r\nobj = Strategies(app_key = \"your app key\",\r\n secret_key = \"your secret key\",\r\n api_session = \"your api session\",\r\n max_profit = \"your max profit\",\r\n max_loss = \"your max loss\")\r\n\r\n\r\n\r\n#Execute the strategy\r\nobj.straddle(strategy_type = \"long\",\r\n stock_code = \"NIFTY\",\r\n strike_price = \"18700\",\r\n quantity = \"50\",\r\n expiry_date = \"2023-06-29T06:00:00.000Z\")\r\n\r\n#Execute the strangle strategy\r\nobj.strangle(strike_price_call = \"18700\",strike_price_put = \"18300\", strategy_type = \"long\",stock_code = \"NIFTY\", quantity = \"50\", expiry_date = \"2023-06-29T06:00:00.000Z\")\r\n\r\n#Execute Single Leg\r\nobj.single_leg(right = \"Call\", strategy_type = \"short\",stock_code = \"NIFTY\", strike_price = \"18700\", quantity = \"50\", expiry_date = \"2023-06-29T06:00:00.000Z\")\r\n\r\n\r\n#Execute the Four leg strategy\r\n\r\n#Nifty \r\nobj.four_leg(stock_code=\"NIFTY\",\r\n quantity=\"25\",\r\n expiry_date=\"2024-08-14T06:00:00.000Z\",\r\n call_short_strike=\"24900\",\r\n put_short_strike=\"23000\",\r\n call_long_strike=\"24850\",\r\n put_long_strike=\"23050\"\r\n )\r\n\r\n#BankNifty\r\nobj.four_leg(stock_code=\"CNXBAN\",\r\n quantity=\"15\",\r\n expiry_date=\"2024-08-14T06:00:00.000Z\",\r\n call_short_strike=\"52600\",\r\n put_short_strike=\"47600\",\r\n call_long_strike=\"52700\",\r\n put_long_strike=\"47900\"\r\n )\r\n\r\n\r\n#SquareOff existing positions and exit the strategy of straddle\r\nobj.stop() \r\n\r\n#SquareOff existing positions and exit the strategy of strangle\r\nobj.stop_strategy(is_strangle = True) \r\n\r\n#SquareOff existing positions and exit the strategy In case of single_leg pass single_leg flag as True as mentioned below\r\nobj.stop_strategy(single_leg = True)\r\n\r\n#SquareOff existing positions and exit the strategy of Four Leg\r\nobj.stop_strategy(is_FourLeg = True)\r\n\r\n#Generate Profit & Loss report (this method will work for both straddle and strangle)\r\nobj.get_pnl()\r\n\r\n```\r\n\r\n### Note:\r\n### (i) If the maximum loss or maximum profit is not reached by the end of the day, the order will be carried over to the next day, and the maximum profit and maximum loss will no longer be monitored.\r\n### (ii) Ensure that the maximum profit is a positive value and the maximum loss is a negative value.\r\n### (iii) Verify that all parameters are entered correctly.\r\n### (iv) Kindly monitor the position on the website.\r\n### (v) Ensure a stable internet connection at all times.\r\n\r\n\r\n \r\n",
"bugtrack_url": null,
"license": null,
"summary": "ICICIDIRECT's breezeconnect strategies in python",
"version": "1.0.23",
"project_urls": {
"Homepage": "https://github.com/Idirect-Tech/python_strategies/tree/master"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c93314542e897b644e7e806e9545afbe423c104dbbed0de991c69c9227e42c32",
"md5": "7fe7951753ebb3fc0fb82f318c23da53",
"sha256": "8e59b607fb0bb3bc1b16d3b8609e86c500d7f9dbf0fe112236fb2586f4da2d54"
},
"downloads": -1,
"filename": "breeze_strategies-1.0.23.tar.gz",
"has_sig": false,
"md5_digest": "7fe7951753ebb3fc0fb82f318c23da53",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 18558,
"upload_time": "2024-08-19T10:44:13",
"upload_time_iso_8601": "2024-08-19T10:44:13.790460Z",
"url": "https://files.pythonhosted.org/packages/c9/33/14542e897b644e7e806e9545afbe423c104dbbed0de991c69c9227e42c32/breeze_strategies-1.0.23.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-19 10:44:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Idirect-Tech",
"github_project": "python_strategies",
"github_not_found": true,
"lcname": "breeze-strategies"
}