Choose Option Strike in Condition Builder

Hi there,

I need to Check ORB Open Price of Nifty 50 spot (09:15 to 09:29) and construct Condition Builder in Options with Strike price as ORB open of Nifty spot, If LTP of Option (with strike price as Nifty 50 ORB open) cross below the ORB Low of the Option (with strike price as Nifty 50 ORB open), then it should take the trade. I coded the below

But in above condition, only Option with Strike as ATM is checked and not the strike of ORB Open of Nifty 50 spot. But i need to select the Option with Strike as ORB Open (ORB from 09:15 to 09:29).

Basically my requirement is to build a condition builder with Option strike price as ORB Open (from 09:15 to 09:29) and check if LTP of PE Option with strike of ORB Open of Nifty Spot is lower than or equal to ORB of PE option with Strike of ORB Open of Nifty Spot.

Please advise.

You can do this with “Initiate Variables” feature.

Please check this:

In that video, i could see the Run time variables for STRIKE PRICE is used in the Position builder. I need to choose the STRIKE in my condition builder. The only STRIKE option in the Condition builder is to either choose ATM or specific strike price. I couldn’t choose the Nifty Spot Strike at 09:15 to check the condition. Could you please help.

Chose ATM. The variables under “Initialise Variables” are assigned values at 1st condition check, which is defined in by user in Advanced Setting under “Start condition check after exchange open”. Select 1 second there. So the values will be assigned at 09:15:01 which means they will be based on open spot of NIFTY 50.

Your strategy must be in active state at 9:15.
But keep in mind that if you take universal exit and reactivate (manually or through Reactivate after setting) during market open time then values will be reassigned at the time of reactivation and these will be based on spot at the time of reactivation.

Ok. If i chose ATM from dropdown, then in “Initialize variables” should i assign variables to ATM something like below. So that in Condition builder, the PE ATM will choose ATM that is set in “Initialize variables”.

No. You build the PE ATM instrument itself in “Initialise Variable”.

Variable name say: “MyATMPE”

Then use keyword “Instrument Name” to assign value to it and point to NIFTY 50 PE ATM as shown below:
MyATMPE

Then use condition check as below:
Condition

Thanks for your prompt response.

I have updated as below for ORB strategy from 09:30 to 09:45. The CE/PE Option strike price should be Nifty Spot ATM at 09:30 Please check if it is good.

image

image

Advanced Settings:-
image

Looks good if you want CE_ATM and PE_ATM instrument strike to be based on spot at 9:30 AM and then take low of it between 9:30 to 9:44AM.
You need to add AND Time(NFO) >= 09:45 as ORB of :30 to 9:44 will return “None” before this time.

Thank you. I have updated my strategy. Will check on live market and post you an update.

Hi Sharad,
I checked in todays Market (02nd May 2023), The Nifty Spot at 09:30 is 18,161.45 which is rounded to 18150. That should be my Option strike price. But the strategy has considered 18250 as option Strike (Which is based on Nifty future 18,228.60). Not sure why. Can you please check.
image

Strategy:

image

image

image

Hello Surendran,
It appears that Instrument Name formula will take ATM based on Future only and there is no provision to make it to do it based on spot. Only in position builder with Fx can we specify ATM based on spot, I couldn’t find a way to do it in condition builder.

Hi,
Curious to know why the Fx feature available in Position builder is not available in condition builder ?. Is there any difficulties in setting up or enabling this Fx option in condition builder ? Because this would greatly help the people developing strategies in Options.

Please add the above option.

Hi. need a condition where it should check the combine ATM CE and PE price of banknifty and if price move 5 percent up of last 5 minute then it should sell the ATM CE and PE

What hapoens when you select ATM-SPOT instead of ATM?