hi @Benthomas use this code for it. # step_values reference : https://www1.nseindia.com/content/fo/sos_scheme.xls step_values = {'AARTIIND': 20, 'ACC': 20, 'ADANIENT': 20.....}
Please help me to get the adjacent strikes trading symbols
To form adjacent strikes trading symbol, you can fetch the current spot value using the LTP quote and then add strike Interval(i.e 50, 100, etc) to the strike price.
and price.
For the price, you will have to form the required symbol(as stated above) and request the same using the LTP quote.
Hi, I just want to exit the losing straddle leg first, and the other leg after 10 seconds when a condition is met. Please give some logic.
Is there any order precedence in executing CE and PE. I noticed (may be wrong), when closing all open positions through API, PE orders are executed first.
use this code for it.
# step_values reference : https://www1.nseindia.com/content/fo/sos_scheme.xls
step_values = {'AARTIIND': 20, 'ACC': 20, 'ADANIENT': 20.....}
def option_name_finder(ltp, multiplier, name, exipry, ce_pe):
step_value = step_values[name]
atm_strike = round(ltp/step_value)*step_value + multiplier*step_value
option_name = name + exipry + str(atm_strike) + 'CE'
return option_name
I just want to exit the losing straddle leg first, and the other leg after 10 seconds when a condition is met.
Please give some logic.
Is there any order precedence in executing CE and PE. I noticed (may be wrong), when closing all open positions through API, PE orders are executed first.
Thanks
find the loosing leg option name
exit the loosing leg..
time.sleep(10)
exit the second leg..