In [1]:
from algomojo import *

#set the API Key and API secret key, Broker Code and the Version
#Broker Code "ab" = aliceblue, "tj" = tradejini, "zb" = zebu, "en" = enrich for the list of short codes supported kindly check with algomojo team
#default version used Ver = 1.0

tj=api("86cbef19e7e61ccee91e497690d5814e","a256707821d7b97988eef6b90a230e35",broker="tj",version=1.0)

print(tj)
<algomojo.pyalgomojo.api object at 0x0000022962AC3AC0>
In [2]:
#Executes ATM order with offset = 0
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="CE",action="B",qty="75",strike_int=50,offset=0)
Out[2]:
{'NOrdNo': '201120000013807', 'stat': 'Ok'}
In [3]:
#Executes OTM Call 3 strike wide from ATM Options, Offset = +3
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="CE",action="B",qty="75",strike_int=50,offset=3)
Out[3]:
{'NOrdNo': '201120000013809', 'stat': 'Ok'}
In [4]:
#Executes OTM PE 3 strike wide from ATM Options, Offset = -3
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="PE",action="B",qty="75",strike_int=50,offset=-3)
Out[4]:
{'NOrdNo': '201120000013810', 'stat': 'Ok'}
In [5]:
#Executes ITM Call 2 strike wide from ATM Options, Offset = -2
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="CE",action="B",qty="75",strike_int=50,offset=-2)
Out[5]:
{'NOrdNo': '201120000013812', 'stat': 'Ok'}
In [6]:
#Executes ITM Put 2 strike wide from ATM Options, Offset = +2
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="PE",action="B",qty="75",strike_int=50,offset=2)
Out[6]:
{'NOrdNo': '201120000013813', 'stat': 'Ok'}
In [7]:
#Executing Multi legged Option Strategies - Short Straddle
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="CE",action="S",qty="75",strike_int=50,offset=0)
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="PE",action="S",qty="75",strike_int=50,offset=0)
Out[7]:
{'NOrdNo': '201120000013816', 'stat': 'Ok'}
In [8]:
#Executing Multi legged Option Strategies - Iron Condor
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="CE",action="S",qty="75",strike_int=50,offset=1)
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="PE",action="S",qty="75",strike_int=50,offset=-1)

tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="CE",action="B",qty="75",strike_int=50,offset=3)
tj.place_option_order(spot_sym="NIFTY",expiry="26NOV20",opt_type="PE",action="B",qty="75",strike_int=50,offset=-3)
Out[8]:
{'NOrdNo': '201120000013825', 'stat': 'Ok'}